From ad4162f3712ddf25e148cff1e7dc37eafdff3e51 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 14 Sep 2005 09:56:38 +0100 Subject: [ARM SMP] Add timer/watchdog defines for MPCore The timer/watchdog register definitions were missing from the mpcore watchdog patch. Add them. Signed-off-by: Russell King --- drivers/char/watchdog/mpcore_wdt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index c694eee1fb2..75ca84ed4ad 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c @@ -30,6 +30,8 @@ #include #include #include + +#include #include struct mpcore_wdt { -- cgit v1.2.3-18-g5258 From 39eb936c7ec8ef1dccb88d3bcfc1c5fa2410c472 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Tue, 13 Sep 2005 00:36:45 +0200 Subject: [PATCH] sata_sis: Fix typo in sata port2 initialisation This patch fixes a nasty typo I introduced in my previous patch (commit f2c853bca542f5ac0b036377637192a74f2091c2). The right offset of the second port in pure sata mode is 64 and not 0x64. Thanks to Martin Schuster for pointing this to me Signed-off-by: Arnaud Patard --- Signed-off-by: Jeff Garzik --- drivers/scsi/sata_sis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index a63f93186e4..237c1986f01 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c @@ -289,7 +289,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) if (ent->device != 0x182) { if ((pmr & SIS_PMR_COMBINED) == 0) { printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in SATA mode\n"); - port2_start=0x64; + port2_start = 64; } else { printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in combined mode\n"); -- cgit v1.2.3-18-g5258 From 668e4bc7229c1866f65f3bef6ab011f8c9034089 Mon Sep 17 00:00:00 2001 From: Uwe Koziolek Date: Sun, 11 Sep 2005 17:03:35 +0200 Subject: [PATCH] sata_sis: uninitialized variable There is an uninitialized variable issue in sata_sis.c Signed-off-by: Jeff Garzik --- drivers/scsi/sata_sis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index 237c1986f01..b227e51d12f 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c @@ -161,7 +161,7 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) { struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); unsigned int cfg_addr = get_scr_cfg_addr(ap->port_no, sc_reg, pdev->device); - u32 val, val2; + u32 val, val2 = 0; u8 pmr; if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ -- cgit v1.2.3-18-g5258 From 32a3658533c6f4c6bf370dd730213e802464ef9b Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Wed, 14 Sep 2005 09:52:42 -0400 Subject: [PATCH] pci: only call pci_restore_bars at boot Certain (SGI?) ia64 boxes object to having their PCI BARs restored unless absolutely necessary. This patch restricts calling pci_restore_bars from pci_set_power_state unless the current state is PCI_UNKNOWN, the actual (i.e. physical) state of the device is PCI_D3hot, and the device indicates that it will lose its configuration when transitioning to PCI_D0. Signed-off-by: John W. Linville Signed-off-by: Linus Torvalds --- drivers/pci/pci.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 992db89adce..259d247b755 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -309,17 +309,25 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); - /* If we're in D3, force entire word to 0. + /* If we're (effectively) in D3, force entire word to 0. * This doesn't affect PME_Status, disables PME_En, and * sets PowerState to 0. */ - if (dev->current_state >= PCI_D3hot) { - if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) + switch (dev->current_state) { + case PCI_UNKNOWN: /* Boot-up */ + if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot + && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) need_restore = 1; + /* Fall-through: force to D0 */ + case PCI_D3hot: + case PCI_D3cold: + case PCI_POWER_ERROR: pmcsr = 0; - } else { + break; + default: pmcsr &= ~PCI_PM_CTRL_STATE_MASK; pmcsr |= state; + break; } /* enter specified state */ -- cgit v1.2.3-18-g5258 From c7fb0b35ada6e0e691e70af5591a2006fbec85b5 Mon Sep 17 00:00:00 2001 From: Ivan Kokshaysky Date: Wed, 14 Sep 2005 23:05:30 +0400 Subject: [PATCH] yenta oops fix In some cases, especially on modern laptops with a lot of PCI and cardbus bridges, we're unable to assign correct secondary/subordinate bus numbers to all cardbus bridges due to BIOS limitations unless we are using "pci=assign-busses" boot option. So some cardbus controllers may not have attached subordinate pci_bus structure, and yenta driver must cope with it - just ignore such cardbus bridges. For example, see https://bugzilla.novell.com/show_bug.cgi?id=113778 Signed-off-by: Ivan Kokshaysky Signed-off-by: Linus Torvalds --- drivers/pcmcia/yenta_socket.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index f0997c36c9b..2e43911b487 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1045,7 +1045,18 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i { struct yenta_socket *socket; int ret; - + + /* + * If we failed to assign proper bus numbers for this cardbus + * controller during PCI probe, its subordinate pci_bus is NULL. + * Bail out if so. + */ + if (!dev->subordinate) { + printk(KERN_ERROR "Yenta: no bus associated with %s!\n", + pci_name(dev)); + return -ENODEV; + } + socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL); if (!socket) return -ENOMEM; -- cgit v1.2.3-18-g5258 From 5a23f34798f15838fe1b7f0fd7e5be388e08c2b2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 14 Sep 2005 13:05:17 -0700 Subject: Fix yenta error message when unable to find a bus assignment And mention 'pci=assign-busses' as a possible fix. Signed-off-by: Linus Torvalds --- drivers/pcmcia/yenta_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 2e43911b487..ba4d78e5b12 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1052,8 +1052,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i * Bail out if so. */ if (!dev->subordinate) { - printk(KERN_ERROR "Yenta: no bus associated with %s!\n", - pci_name(dev)); + printk(KERN_ERR "Yenta: no bus associated with %s! " + "(try 'pci=assign-busses')\n", pci_name(dev)); return -ENODEV; } -- cgit v1.2.3-18-g5258 From 84d370b906b0eb00277a841216987285cf4114d4 Mon Sep 17 00:00:00 2001 From: Karsten Keil Date: Wed, 14 Sep 2005 14:19:13 -0700 Subject: [PATCH] i4l: Sedlbauer speed star II V 3.1 exist with various subversions the 4th id field should be not used Signed-off-by: Karsten Keil Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/hisax/sedlbauer_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index c6b5bf7d2ac..dc334aab433 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c @@ -611,7 +611,7 @@ static int sedlbauer_event(event_t event, int priority, } /* sedlbauer_event */ static struct pcmcia_device_id sedlbauer_ids[] = { - PCMCIA_DEVICE_PROD_ID1234("SEDLBAUER", "speed star II", "V 3.1", "(c) 93 - 98 cb ", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a, 0x50d4149c), + PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "speed star II", "V 3.1", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a), PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D67", 0x81fb79f5, 0xe4e9bc12, 0x397b7e90), PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D98", 0x81fb79f5, 0xe4e9bc12, 0x2e5c7fce), PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK", 0x81fb79f5, 0xe4e9bc12, 0x8db143fe), -- cgit v1.2.3-18-g5258 From 0ed8e048c9e11e69ec951f94066105e80cdc59fd Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Wed, 14 Sep 2005 14:19:15 -0700 Subject: [PATCH] nv_i2c oops fix The call to fb_firmware_edid may return NULL but this is not checked before trying to memcpy using this pointer. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/nvidia/nv_i2c.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index ace484fa61c..12f2884d3f0 100644 --- a/drivers/video/nvidia/nv_i2c.c +++ b/drivers/video/nvidia/nv_i2c.c @@ -209,10 +209,13 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) if (!edid && conn == 1) { /* try to get from firmware */ - edid = kmalloc(EDID_LENGTH, GFP_KERNEL); - if (edid) - memcpy(edid, fb_firmware_edid(info->device), - EDID_LENGTH); + const u8 *e = fb_firmware_edid(info->device); + + if (e != NULL) { + edid = kmalloc(EDID_LENGTH, GFP_KERNEL); + if (edid) + memcpy(edid, e, EDID_LENGTH); + } } if (out_edid) -- cgit v1.2.3-18-g5258 From ef4cbee0b0d0f791bb593f99b702410f3c0efce6 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Wed, 14 Sep 2005 14:19:18 -0700 Subject: [PATCH] hvc_console: start kernel thread before registering tty Its possible that we can write to the hvc_console tty as soon it is registered. Recently this started happening due to (what looks like) a change to the hotplug code. Unfortunately at this stage we have not started the khvcd kernel thread and oops. The solution is to start the kernel thread before registering the tty. Signed-off-by: Anton Blanchard Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/hvc_console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index cddb789902d..f9217763467 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c @@ -839,9 +839,6 @@ int __init hvc_init(void) hvc_driver->flags = TTY_DRIVER_REAL_RAW; tty_set_operations(hvc_driver, &hvc_ops); - if (tty_register_driver(hvc_driver)) - panic("Couldn't register hvc console driver\n"); - /* Always start the kthread because there can be hotplug vty adapters * added later. */ hvc_task = kthread_run(khvcd, NULL, "khvcd"); @@ -851,6 +848,9 @@ int __init hvc_init(void) return -EIO; } + if (tty_register_driver(hvc_driver)) + panic("Couldn't register hvc console driver\n"); + return 0; } module_init(hvc_init); -- cgit v1.2.3-18-g5258 From 2d93486c6c110cf81db720359b4ec20de9c91450 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 14 Sep 2005 22:36:03 +0100 Subject: [ARM] 2907/1: GCC 4 serial driver compile fixes Patch from Vincent Sanders When building the ARM platforms several serial drivers fail to compile with GCC 4.01 due to extern/static ambiguity. Signed-off-by: Vincent Sanders Signed-off-by: Russell King --- drivers/serial/21285.c | 2 +- drivers/serial/amba-pl010.c | 2 +- drivers/serial/amba-pl011.c | 2 +- drivers/serial/clps711x.c | 2 +- drivers/serial/pxa.c | 4 ++-- drivers/serial/sa1100.c | 2 +- drivers/serial/serial_lh7a40x.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index aec39fb261c..b5cf39468d1 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -463,7 +463,7 @@ static int __init serial21285_console_setup(struct console *co, char *options) return uart_set_options(port, co, baud, parity, bits, flow); } -extern struct uart_driver serial21285_reg; +static struct uart_driver serial21285_reg; static struct console serial21285_console = { diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 978e12437e6..679e678c7e6 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -689,7 +689,7 @@ static int __init pl010_console_setup(struct console *co, char *options) return uart_set_options(port, co, baud, parity, bits, flow); } -extern struct uart_driver amba_reg; +static struct uart_driver amba_reg; static struct console amba_console = { .name = "ttyAM", .write = pl010_console_write, diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 56071309744..1ff629c7475 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -701,7 +701,7 @@ static int __init pl011_console_setup(struct console *co, char *options) return uart_set_options(&uap->port, co, baud, parity, bits, flow); } -extern struct uart_driver amba_reg; +static struct uart_driver amba_reg; static struct console amba_console = { .name = "ttyAMA", .write = pl011_console_write, diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index d822896b488..78c1f36ad9b 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -525,7 +525,7 @@ static int __init clps711xuart_console_setup(struct console *co, char *options) return uart_set_options(port, co, baud, parity, bits, flow); } -extern struct uart_driver clps711x_reg; +static struct uart_driver clps711x_reg; static struct console clps711x_console = { .name = "ttyCL", .write = clps711xuart_console_write, diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index eaa0af83529..672b359b07c 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c @@ -589,8 +589,8 @@ serial_pxa_type(struct uart_port *port) #ifdef CONFIG_SERIAL_PXA_CONSOLE -extern struct uart_pxa_port serial_pxa_ports[]; -extern struct uart_driver serial_pxa_reg; +static struct uart_pxa_port serial_pxa_ports[]; +static struct uart_driver serial_pxa_reg; #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 1225b14f6e9..dd8aed24235 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -799,7 +799,7 @@ sa1100_console_setup(struct console *co, char *options) return uart_set_options(&sport->port, co, baud, parity, bits, flow); } -extern struct uart_driver sa1100_reg; +static struct uart_driver sa1100_reg; static struct console sa1100_console = { .name = "ttySA", .write = sa1100_console_write, diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index 8302376800c..d01dbe5da3b 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c @@ -632,7 +632,7 @@ static int __init lh7a40xuart_console_setup (struct console* co, char* options) return uart_set_options (port, co, baud, parity, bits, flow); } -extern struct uart_driver lh7a40x_reg; +static struct uart_driver lh7a40x_reg; static struct console lh7a40x_console = { .name = "ttyAM", .write = lh7a40xuart_console_write, -- cgit v1.2.3-18-g5258 From da16e3245a4827d969943ca0493a4a6e34009342 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 14 Sep 2005 22:54:45 +0100 Subject: [I2C] Add a functionality method, and remove algorithm ids This allows i2c-pxa to finally build. Signed-off-by: Russell King --- drivers/i2c/busses/i2c-pxa.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index fdf53ce0424..44b595d90a4 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -914,19 +914,23 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num return ret; } +static u32 i2c_pxa_functionality(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; +} + static struct i2c_algorithm i2c_pxa_algorithm = { - .name = "PXA-I2C-Algorithm", - .id = I2C_ALGO_PXA, .master_xfer = i2c_pxa_xfer, + .functionality = i2c_pxa_functionality, }; static struct pxa_i2c i2c_pxa = { .lock = SPIN_LOCK_UNLOCKED, .wait = __WAIT_QUEUE_HEAD_INITIALIZER(i2c_pxa.wait), .adap = { - .name = "pxa2xx-i2c", - .id = I2C_ALGO_PXA, + .owner = THIS_MODULE, .algo = &i2c_pxa_algorithm, + .name = "pxa2xx-i2c", .retries = 5, }, }; -- cgit v1.2.3-18-g5258 From 7b6a186d65589901a73d460070504a5e02703c45 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Thu, 15 Sep 2005 20:58:57 +0800 Subject: [PATCH] savagefb: Fix load failure of the Twister chipset - The Twister chipsets are actually prosavages. Reclassify them as such and remove the S3_SAVAGE_TWISTER id. - Fix i2c code if fb_firmware_edid() returns NULL Signed-off-by: Antonino Daplas Signed-off-by: Linus Torvalds --- drivers/video/savage/savagefb-i2c.c | 11 +++++++---- drivers/video/savage/savagefb.h | 4 ---- drivers/video/savage/savagefb_driver.c | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'drivers') diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 959404ad68f..3c98457783c 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -274,10 +274,13 @@ int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid) if (!edid) { /* try to get from firmware */ - edid = kmalloc(EDID_LENGTH, GFP_KERNEL); - if (edid) - memcpy(edid, fb_firmware_edid(info->device), - EDID_LENGTH); + const u8 *e = fb_firmware_edid(info->device); + + if (e) { + edid = kmalloc(EDID_LENGTH, GFP_KERNEL); + if (edid) + memcpy(edid, e, EDID_LENGTH); + } } if (out_edid) diff --git a/drivers/video/savage/savagefb.h b/drivers/video/savage/savagefb.h index d6f94742c9f..ea17f7e0482 100644 --- a/drivers/video/savage/savagefb.h +++ b/drivers/video/savage/savagefb.h @@ -60,8 +60,6 @@ #define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000)) -#define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) || (chip == S3_PROSAVAGEDDR)) - /* Chip tags. These are used to group the adapters into * related families. */ @@ -74,8 +72,6 @@ typedef enum { S3_PROSAVAGE, S3_SUPERSAVAGE, S3_SAVAGE2000, - S3_PROSAVAGEDDR, - S3_TWISTER, S3_LAST } savage_chipset; diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index b5ca3ef8271..7c285455c92 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -1773,8 +1773,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) } } - if (S3_SAVAGE_MOBILE_SERIES(par->chip) || - (S3_MOBILE_TWISTER_SERIES(par->chip) && !par->crtonly)) + if (S3_SAVAGE_MOBILE_SERIES(par->chip) && !par->crtonly) par->display_type = DISP_LCD; else if (dvi || (par->chip == S3_SAVAGE4 && par->dvi)) par->display_type = DISP_DFP; @@ -1783,7 +1782,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) /* Check LCD panel parrmation */ - if (par->chip == S3_SAVAGE_MX) { + if (par->display_type == DISP_LCD) { unsigned char cr6b = VGArCR( 0x6b ); int panelX = (VGArSEQ (0x61) + @@ -1922,15 +1921,15 @@ static int __devinit savage_init_fb_info (struct fb_info *info, snprintf (info->fix.id, 16, "ProSavageKM"); break; case FB_ACCEL_S3TWISTER_P: - par->chip = S3_TWISTER; + par->chip = S3_PROSAVAGE; snprintf (info->fix.id, 16, "TwisterP"); break; case FB_ACCEL_S3TWISTER_K: - par->chip = S3_TWISTER; + par->chip = S3_PROSAVAGE; snprintf (info->fix.id, 16, "TwisterK"); break; case FB_ACCEL_PROSAVAGE_DDR: - par->chip = S3_PROSAVAGEDDR; + par->chip = S3_PROSAVAGE; snprintf (info->fix.id, 16, "ProSavageDDR"); break; case FB_ACCEL_PROSAVAGE_DDRK: -- cgit v1.2.3-18-g5258 From 6d36ba629e0ef47a03d3703ee1d38143c25532a8 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Thu, 15 Sep 2005 21:14:56 +0800 Subject: [PATCH] vgacon: Fix sanity checking in vgacon_resize Reported by: walt "I routinely switch the console font during bootup to 8x8 so I can get 50 lines per screen. Until 09 Sept, just changing to the small font automatically gave me all 50 lines -- but now I'm only getting 25 lines even with the small font. The bottom half of the screen displays the text that already scrolled off the top." This bug is due to an erroneous check in the recently added hook, vgacon_resize(). It checks the new height against the original number of rows of the console. Because the original number of rows depends on both the scanline and the font height, check it instead against the scanline/fontheight. Signed-off-by: Antonino Daplas Signed-off-by: Linus Torvalds --- drivers/video/console/vgacon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 0705cd74141..6ef6f7760e4 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -1020,7 +1020,9 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font) static int vgacon_resize(struct vc_data *c, unsigned int width, unsigned int height) { - if (width % 2 || width > ORIG_VIDEO_COLS || height > ORIG_VIDEO_LINES) + if (width % 2 || width > ORIG_VIDEO_COLS || + height > (ORIG_VIDEO_LINES * vga_default_font_height)/ + c->vc_font.height) return -EINVAL; if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */ -- cgit v1.2.3-18-g5258 From 065d9cac98a5406ecd5a1368f8fd38f55739dee9 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Thu, 15 Sep 2005 21:34:33 +0800 Subject: [PATCH] vc: Use correct size on buffer copy in vc_resize In the unlikely case of the new screen width much wider then the old, use (old_row_size * new_rows) instead of new_screen_size to prevent a buffer overrun during the copy. Signed-off-by: Antonino Daplas Signed-off-by: Linus Torvalds --- drivers/char/vt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1e33cb032e0..e91268e8683 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -810,13 +810,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) * from the top and bottom of cursor position */ old_origin += (vc->vc_y - new_rows/2) * old_row_size; - end = old_origin + new_screen_size; + end = old_origin + (old_row_size * new_rows); } } else /* * Cursor near the top, copy contents from the top of buffer */ - end = (old_rows > new_rows) ? old_origin + new_screen_size : + end = (old_rows > new_rows) ? old_origin + + (old_row_size * new_rows) : vc->vc_scr_end; update_attr(vc); -- cgit v1.2.3-18-g5258