From c910d898e5c4714879074220b96317dc19dd4e44 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 30 Jun 2009 10:59:36 -0700 Subject: [PATCH] .29 patches --- ...ing-restore-original-register-values.patch | 134 ++++++++++++++++++ ...y-the-dma_mask-for-parport_pc-device.patch | 48 +++++++ ...thout-pm-support-by-pci_target_state.patch | 48 +++++++ ...oft_reset-during-transitions-from-d3.patch | 42 ++++++ .../pcmcia-cm4000-fix-lock-imbalance.patch | 32 +++++ ...essing-on-large-memory-isp23xx-parts.patch | 33 +++++ queue-2.6.29/series | 7 + ...idi_event-fix-decoding-of-rpn-events.patch | 38 +++++ 8 files changed, 382 insertions(+) create mode 100644 queue-2.6.29/parport_pc-after-superio-probing-restore-original-register-values.patch create mode 100644 queue-2.6.29/parport_pc-set-properly-the-dma_mask-for-parport_pc-device.patch create mode 100644 queue-2.6.29/pci-pm-fix-handling-of-devices-without-pm-support-by-pci_target_state.patch create mode 100644 queue-2.6.29/pci-pm-follow-pci_pm_ctrl_no_soft_reset-during-transitions-from-d3.patch create mode 100644 queue-2.6.29/pcmcia-cm4000-fix-lock-imbalance.patch create mode 100644 queue-2.6.29/qla2xxx-correct-overflow-during-dump-processing-on-large-memory-isp23xx-parts.patch create mode 100644 queue-2.6.29/sound-seq_midi_event-fix-decoding-of-rpn-events.patch diff --git a/queue-2.6.29/parport_pc-after-superio-probing-restore-original-register-values.patch b/queue-2.6.29/parport_pc-after-superio-probing-restore-original-register-values.patch new file mode 100644 index 00000000000..1be032a59a9 --- /dev/null +++ b/queue-2.6.29/parport_pc-after-superio-probing-restore-original-register-values.patch @@ -0,0 +1,134 @@ +From e2434dc1c19412639dd047a4d4eff8ed0e5d0d50 Mon Sep 17 00:00:00 2001 +From: Jens Rottmann +Date: Mon, 22 Jun 2009 16:51:49 +0100 +Subject: parport_pc: after superio probing restore original register values + +From: Jens Rottmann + +commit e2434dc1c19412639dd047a4d4eff8ed0e5d0d50 upstream. + +CONFIG_PARPORT_PC_SUPERIO probes for various superio chips by writing +byte sequences to a set of different potential I/O ranges. But the +probed ranges are not exclusive to parallel ports. Some of our boards +just happen to have a watchdog in one of them. Took us almost a week +to figure out why some distros reboot without warning after running +flawlessly for 3 hours. For exactly 170 = 0xAA minutes, that is ... + +Fixed by restoring original values after probing. Also fixed too small +request_region() in detect_and_report_it87(). + +Signed-off-by: Jens Rottmann +Signed-off-by: Alan Cox +Acked-by: Jeff Garzik +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/parport/parport_pc.c | 31 +++++++++++++++++++++++++------ + 1 file changed, 25 insertions(+), 6 deletions(-) + +--- a/drivers/parport/parport_pc.c ++++ b/drivers/parport/parport_pc.c +@@ -1413,11 +1413,13 @@ static void __devinit decode_smsc(int ef + + static void __devinit winbond_check(int io, int key) + { +- int devid,devrev,oldid,x_devid,x_devrev,x_oldid; ++ int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid; + + if (!request_region(io, 3, __func__)) + return; + ++ origval = inb(io); /* Save original value */ ++ + /* First probe without key */ + outb(0x20,io); + x_devid=inb(io+1); +@@ -1437,6 +1439,8 @@ static void __devinit winbond_check(int + oldid=inb(io+1); + outb(0xaa,io); /* Magic Seal */ + ++ outb(origval, io); /* in case we poked some entirely different hardware */ ++ + if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid)) + goto out; /* protection against false positives */ + +@@ -1447,11 +1451,15 @@ out: + + static void __devinit winbond_check2(int io,int key) + { +- int devid,devrev,oldid,x_devid,x_devrev,x_oldid; ++ int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid; + + if (!request_region(io, 3, __func__)) + return; + ++ origval[0] = inb(io); /* Save original values */ ++ origval[1] = inb(io + 1); ++ origval[2] = inb(io + 2); ++ + /* First probe without the key */ + outb(0x20,io+2); + x_devid=inb(io+2); +@@ -1470,6 +1478,10 @@ static void __devinit winbond_check2(int + oldid=inb(io+2); + outb(0xaa,io); /* Magic Seal */ + ++ outb(origval[0], io); /* in case we poked some entirely different hardware */ ++ outb(origval[1], io + 1); ++ outb(origval[2], io + 2); ++ + if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid)) + goto out; /* protection against false positives */ + +@@ -1480,11 +1492,13 @@ out: + + static void __devinit smsc_check(int io, int key) + { +- int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev; ++ int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev; + + if (!request_region(io, 3, __func__)) + return; + ++ origval = inb(io); /* Save original value */ ++ + /* First probe without the key */ + outb(0x0d,io); + x_oldid=inb(io+1); +@@ -1508,6 +1522,8 @@ static void __devinit smsc_check(int io, + rev=inb(io+1); + outb(0xaa,io); /* Magic Seal */ + ++ outb(origval, io); /* in case we poked some entirely different hardware */ ++ + if ((x_id == id) && (x_oldrev == oldrev) && + (x_oldid == oldid) && (x_rev == rev)) + goto out; /* protection against false positives */ +@@ -1544,11 +1560,12 @@ static void __devinit detect_and_report_ + static void __devinit detect_and_report_it87(void) + { + u16 dev; +- u8 r; ++ u8 origval, r; + if (verbose_probing) + printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n"); +- if (!request_region(0x2e, 1, __func__)) ++ if (!request_region(0x2e, 2, __func__)) + return; ++ origval = inb(0x2e); /* Save original value */ + outb(0x87, 0x2e); + outb(0x01, 0x2e); + outb(0x55, 0x2e); +@@ -1568,8 +1585,10 @@ static void __devinit detect_and_report_ + outb(r | 8, 0x2F); + outb(0x02, 0x2E); /* Lock */ + outb(0x02, 0x2F); ++ } else { ++ outb(origval, 0x2e); /* Oops, sorry to disturb */ + } +- release_region(0x2e, 1); ++ release_region(0x2e, 2); + } + #endif /* CONFIG_PARPORT_PC_SUPERIO */ + diff --git a/queue-2.6.29/parport_pc-set-properly-the-dma_mask-for-parport_pc-device.patch b/queue-2.6.29/parport_pc-set-properly-the-dma_mask-for-parport_pc-device.patch new file mode 100644 index 00000000000..1d3f409d6aa --- /dev/null +++ b/queue-2.6.29/parport_pc-set-properly-the-dma_mask-for-parport_pc-device.patch @@ -0,0 +1,48 @@ +From dfa7c4d869b7d3d37b70f1de856f2901b6ebfcf0 Mon Sep 17 00:00:00 2001 +From: FUJITA Tomonori +Date: Mon, 22 Jun 2009 16:54:27 +0100 +Subject: parport_pc: set properly the dma_mask for parport_pc device + +From: FUJITA Tomonori + +commit dfa7c4d869b7d3d37b70f1de856f2901b6ebfcf0 upstream. + +parport_pc_probe_port() creates the own 'parport_pc' device if the +device argument is NULL. Then parport_pc_probe_port() doesn't +initialize the dma_mask and coherent_dma_mask of the device and calls +dma_alloc_coherent with it. dma_alloc_coherent fails because +dma_alloc_coherent() doesn't accept the uninitialized dma_mask: + +http://lkml.org/lkml/2009/6/16/150 + +Long ago, X86_32 and X86_64 had the own dma_alloc_coherent +implementations; X86_32 accepted a device having dma_mask that is not +initialized however X86_64 didn't. When we merged them, we chose to +prohibit a device having dma_mask that is not initialized. I think +that it's good to require drivers to set up dma_mask (and +coherent_dma_mask) properly if the drivers want DMA. + +Signed-off-by: FUJITA Tomonori +Reported-by: Malcom Blaney +Tested-by: Malcom Blaney +Signed-off-by: Alan Cox +Acked-by: Jeff Garzik +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/parport/parport_pc.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/parport/parport_pc.c ++++ b/drivers/parport/parport_pc.c +@@ -2211,6 +2211,9 @@ struct parport *parport_pc_probe_port (u + if (IS_ERR(pdev)) + return NULL; + dev = &pdev->dev; ++ ++ dev->coherent_dma_mask = DMA_BIT_MASK(24); ++ dev->dma_mask = &dev->coherent_dma_mask; + } + + ops = kmalloc(sizeof (struct parport_operations), GFP_KERNEL); diff --git a/queue-2.6.29/pci-pm-fix-handling-of-devices-without-pm-support-by-pci_target_state.patch b/queue-2.6.29/pci-pm-fix-handling-of-devices-without-pm-support-by-pci_target_state.patch new file mode 100644 index 00000000000..c17ecdd09b1 --- /dev/null +++ b/queue-2.6.29/pci-pm-fix-handling-of-devices-without-pm-support-by-pci_target_state.patch @@ -0,0 +1,48 @@ +From d2abdf62882d982c58e7a6b09ecdcfcc28075e2e Mon Sep 17 00:00:00 2001 +From: Rafael J. Wysocki +Date: Sun, 14 Jun 2009 21:25:02 +0200 +Subject: PCI PM: Fix handling of devices without PM support by pci_target_state() + +From: Rafael J. Wysocki + +commit d2abdf62882d982c58e7a6b09ecdcfcc28075e2e upstream. + +If a PCI device is not power-manageable either by the platform, or +with the help of the native PCI PM interface, pci_target_state() will +return either PCI_D3hot, or PCI_POWER_ERROR for it, depending on +whether or not the device is configured to wake up the system. Alas, +none of these return values is correct, because each of them causes +pci_prepare_to_sleep() to return error code, although it should +complete successfully in such a case. + +Fix this problem by making pci_target_state() always return PCI_D0 +for devices that cannot be power managed. + +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Jesse Barnes +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -1196,15 +1196,14 @@ pci_power_t pci_target_state(struct pci_ + default: + target_state = state; + } ++ } else if (!dev->pm_cap) { ++ target_state = PCI_D0; + } else if (device_may_wakeup(&dev->dev)) { + /* + * Find the deepest state from which the device can generate + * wake-up events, make it the target state and enable device + * to generate PME#. + */ +- if (!dev->pm_cap) +- return PCI_POWER_ERROR; +- + if (dev->pme_support) { + while (target_state + && !(dev->pme_support & (1 << target_state))) diff --git a/queue-2.6.29/pci-pm-follow-pci_pm_ctrl_no_soft_reset-during-transitions-from-d3.patch b/queue-2.6.29/pci-pm-follow-pci_pm_ctrl_no_soft_reset-during-transitions-from-d3.patch new file mode 100644 index 00000000000..7d70146a97a --- /dev/null +++ b/queue-2.6.29/pci-pm-follow-pci_pm_ctrl_no_soft_reset-during-transitions-from-d3.patch @@ -0,0 +1,42 @@ +From f62795f1e892ca9269849fa83de97621da7e02c0 Mon Sep 17 00:00:00 2001 +From: Rafael J. Wysocki +Date: Mon, 18 May 2009 22:51:12 +0200 +Subject: PCI PM: Follow PCI_PM_CTRL_NO_SOFT_RESET during transitions from D3 + +From: Rafael J. Wysocki + +commit f62795f1e892ca9269849fa83de97621da7e02c0 upstream. + +According to the PCI PM specification (PCI Bus Power Management +Interface Specification, Rev. 1.2, Section 5.4.1) we are supposed to +reinitialize devices that have PCI_PM_CTRL_NO_SOFT_RESET clear during +all transitions from PCI_D3hot to PCI_D0, but we only do it if the +device's current_state field is equal to PCI_UNKNOWN. + +This may lead to problems if a device with PCI_PM_CTRL_NO_SOFT_RESET +unset is put into PCI_D3hot at run time by its driver and +pci_set_power_state() is used to put it back into PCI_D0, because in +that case the device will remain uninitialized after +pci_set_power_state() has returned. Prevent that from happening by +modifying pci_raw_set_power_state() to reinitialize devices with +PCI_PM_CTRL_NO_SOFT_RESET unset during all transitions from D3 to D0. + +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Jesse Barnes +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -479,6 +479,8 @@ pci_raw_set_power_state(struct pci_dev * + pmcsr &= ~PCI_PM_CTRL_STATE_MASK; + pmcsr |= state; + break; ++ case PCI_D3hot: ++ case PCI_D3cold: + case PCI_UNKNOWN: /* Boot-up */ + if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot + && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) { diff --git a/queue-2.6.29/pcmcia-cm4000-fix-lock-imbalance.patch b/queue-2.6.29/pcmcia-cm4000-fix-lock-imbalance.patch new file mode 100644 index 00000000000..138209c3bd3 --- /dev/null +++ b/queue-2.6.29/pcmcia-cm4000-fix-lock-imbalance.patch @@ -0,0 +1,32 @@ +From 69ae59d7d8df14413cf0a97b3e372d7dc8352563 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Mon, 22 Jun 2009 18:42:10 +0100 +Subject: pcmcia/cm4000: fix lock imbalance + +From: Jiri Slaby + +commit 69ae59d7d8df14413cf0a97b3e372d7dc8352563 upstream. + +Don't return from switch/case, break instead, so that we unlock BKL. + +Signed-off-by: Jiri Slaby +Signed-off-by: Alan Cox +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/pcmcia/cm4000_cs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/char/pcmcia/cm4000_cs.c ++++ b/drivers/char/pcmcia/cm4000_cs.c +@@ -1575,7 +1575,8 @@ static long cmm_ioctl(struct file *filp, + clear_bit(LOCK_IO, &dev->flags); + wake_up_interruptible(&dev->ioq); + +- return 0; ++ rc = 0; ++ break; + case CM_IOCSPTS: + { + struct ptsreq krnptsreq; diff --git a/queue-2.6.29/qla2xxx-correct-overflow-during-dump-processing-on-large-memory-isp23xx-parts.patch b/queue-2.6.29/qla2xxx-correct-overflow-during-dump-processing-on-large-memory-isp23xx-parts.patch new file mode 100644 index 00000000000..49fbf3967a6 --- /dev/null +++ b/queue-2.6.29/qla2xxx-correct-overflow-during-dump-processing-on-large-memory-isp23xx-parts.patch @@ -0,0 +1,33 @@ +From e18e963b7e533149676b5d387d0a56160df9f111 Mon Sep 17 00:00:00 2001 +From: Andrew Vasquez +Date: Wed, 17 Jun 2009 10:30:31 -0700 +Subject: qla2xxx: Correct (again) overflow during dump-processing on large-memory ISP23xx parts. + +From: Andrew Vasquez + +commit e18e963b7e533149676b5d387d0a56160df9f111 upstream. + +Commit 7b867cf76fbcc8d77867cbec6f509f71dce8a98f ([SCSI] qla2xxx: +Refactor qla data structures) inadvertently reverted +e792121ec85672c1fa48f79d13986a3f4f56c590 ([SCSI] qla2xxx: Correct +overflow during dump-processing on large-memory ISP23xx parts.). + +Signed-off-by: Andrew Vasquez +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/qla2xxx/qla_dbg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/qla2xxx/qla_dbg.c ++++ b/drivers/scsi/qla2xxx/qla_dbg.c +@@ -218,7 +218,7 @@ qla24xx_soft_reset(struct qla_hw_data *h + + static int + qla2xxx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint16_t *ram, +- uint16_t ram_words, void **nxt) ++ uint32_t ram_words, void **nxt) + { + int rval; + uint32_t cnt, stat, timer, words, idx; diff --git a/queue-2.6.29/series b/queue-2.6.29/series index 58ca2de7494..d17d9e4ccf6 100644 --- a/queue-2.6.29/series +++ b/queue-2.6.29/series @@ -24,3 +24,10 @@ send_sigio_to_task-sanitize-the-usage-of-fown-signum.patch md-raid5-add-missing-call-to-schedule-after-prepare_to_wait.patch vt_ioctl-fix-lock-imbalance.patch x86-set-cpu_llc_id-on-amd-cpus.patch +parport_pc-after-superio-probing-restore-original-register-values.patch +parport_pc-set-properly-the-dma_mask-for-parport_pc-device.patch +pci-pm-fix-handling-of-devices-without-pm-support-by-pci_target_state.patch +pci-pm-follow-pci_pm_ctrl_no_soft_reset-during-transitions-from-d3.patch +pcmcia-cm4000-fix-lock-imbalance.patch +qla2xxx-correct-overflow-during-dump-processing-on-large-memory-isp23xx-parts.patch +sound-seq_midi_event-fix-decoding-of-rpn-events.patch diff --git a/queue-2.6.29/sound-seq_midi_event-fix-decoding-of-rpn-events.patch b/queue-2.6.29/sound-seq_midi_event-fix-decoding-of-rpn-events.patch new file mode 100644 index 00000000000..ea8caec8142 --- /dev/null +++ b/queue-2.6.29/sound-seq_midi_event-fix-decoding-of-rpn-events.patch @@ -0,0 +1,38 @@ +From 6423f9ea8035138d70bae1a278d3b57b743f8b3e Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Mon, 22 Jun 2009 10:01:59 +0200 +Subject: sound: seq_midi_event: fix decoding of (N)RPN events + +From: Clemens Ladisch + +commit 6423f9ea8035138d70bae1a278d3b57b743f8b3e upstream. + +When decoding (N)RPN sequencer events into raw MIDI commands, the +extra_decode_xrpn() function had accidentally swapped the MSB and LSB +controller values of both the parameter number and the data value. + +Signed-off-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/seq/seq_midi_event.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/sound/core/seq/seq_midi_event.c ++++ b/sound/core/seq/seq_midi_event.c +@@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_ + if (dev->nostat && count < 12) + return -ENOMEM; + cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); +- bytes[0] = ev->data.control.param & 0x007f; +- bytes[1] = (ev->data.control.param & 0x3f80) >> 7; +- bytes[2] = ev->data.control.value & 0x007f; +- bytes[3] = (ev->data.control.value & 0x3f80) >> 7; ++ bytes[0] = (ev->data.control.param & 0x3f80) >> 7; ++ bytes[1] = ev->data.control.param & 0x007f; ++ bytes[2] = (ev->data.control.value & 0x3f80) >> 7; ++ bytes[3] = ev->data.control.value & 0x007f; + if (cmd != dev->lastcmd && !dev->nostat) { + if (count < 9) + return -ENOMEM; -- 2.47.2