From: Greg Kroah-Hartman Date: Mon, 17 Nov 2008 06:35:20 +0000 (-0800) Subject: more .27 patches X-Git-Tag: v2.6.27.7~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3258a81399a220cb31eebb16fc8c2a1fa96a013a;p=thirdparty%2Fkernel%2Fstable-queue.git more .27 patches --- diff --git a/queue-2.6.27/acpi-ec-revert-msleep-patch.patch b/queue-2.6.27/acpi-ec-revert-msleep-patch.patch new file mode 100644 index 00000000000..bdedf114bb0 --- /dev/null +++ b/queue-2.6.27/acpi-ec-revert-msleep-patch.patch @@ -0,0 +1,40 @@ +From 1cfe62c8010ac56e1bd3827e30386a87cc2f3594 Mon Sep 17 00:00:00 2001 +From: Alexey Starikovskiy +Date: Tue, 28 Oct 2008 00:35:30 +0300 +Subject: ACPI: EC: revert msleep patch + +From: Alexey Starikovskiy + +commit 1cfe62c8010ac56e1bd3827e30386a87cc2f3594 upstream. + +With the better solution for EC interrupt storm issue, +there is no need to use msleep over udelay. + +References: + http://bugzilla.kernel.org/show_bug.cgi?id=11810 + http://bugzilla.kernel.org/show_bug.cgi?id=10724 + +Signed-off-by: Alexey Starikovskiy +Signed-off-by: Len Brown +Cc: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/ec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -239,10 +239,10 @@ static int ec_check_sci(struct acpi_ec * + static int ec_poll(struct acpi_ec *ec) + { + unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); +- msleep(1); ++ udelay(ACPI_EC_UDELAY); + while (time_before(jiffies, delay)) { + gpe_transaction(ec, acpi_ec_read_status(ec)); +- msleep(1); ++ udelay(ACPI_EC_UDELAY); + if (ec_transaction_done(ec)) + return 0; + } diff --git a/queue-2.6.27/acpi-ec-wait-for-last-write-gpe.patch b/queue-2.6.27/acpi-ec-wait-for-last-write-gpe.patch new file mode 100644 index 00000000000..4fb121a4554 --- /dev/null +++ b/queue-2.6.27/acpi-ec-wait-for-last-write-gpe.patch @@ -0,0 +1,77 @@ +From dd15f8c42af09031e27da5b4d697ce925511f2e1 Mon Sep 17 00:00:00 2001 +From: Alexey Starikovskiy +Date: Sat, 8 Nov 2008 21:42:30 +0300 +Subject: ACPI: EC: wait for last write gpe + +From: Alexey Starikovskiy + +commit dd15f8c42af09031e27da5b4d697ce925511f2e1 upstream. + +There is a possibility that EC might break if next command is +issued within 1 us after write or burst-disable command. + +Suggestd-by: Zhao Yakui +Signed-off-by: Alexey Starikovskiy +Signed-off-by: Len Brown +Cc: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/ec.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -102,6 +102,7 @@ struct transaction { + u8 command; + u8 wlen; + u8 rlen; ++ bool done; + }; + + static struct acpi_ec { +@@ -178,7 +179,7 @@ static int ec_transaction_done(struct ac + unsigned long flags; + int ret = 0; + spin_lock_irqsave(&ec->curr_lock, flags); +- if (!ec->curr || (!ec->curr->wlen && !ec->curr->rlen)) ++ if (!ec->curr || ec->curr->done) + ret = 1; + spin_unlock_irqrestore(&ec->curr_lock, flags); + return ret; +@@ -195,17 +196,20 @@ static void gpe_transaction(struct acpi_ + acpi_ec_write_data(ec, *(ec->curr->wdata++)); + --ec->curr->wlen; + } else +- /* false interrupt, state didn't change */ +- ++ec->curr->irq_count; +- ++ goto err; + } else if (ec->curr->rlen > 0) { + if ((status & ACPI_EC_FLAG_OBF) == 1) { + *(ec->curr->rdata++) = acpi_ec_read_data(ec); +- --ec->curr->rlen; ++ if (--ec->curr->rlen == 0) ++ ec->curr->done = true; + } else +- /* false interrupt, state didn't change */ +- ++ec->curr->irq_count; +- } ++ goto err; ++ } else if (ec->curr->wlen == 0 && (status & ACPI_EC_FLAG_IBF) == 0) ++ ec->curr->done = true; ++ goto unlock; ++err: ++ /* false interrupt, state didn't change */ ++ ++ec->curr->irq_count; + unlock: + spin_unlock_irqrestore(&ec->curr_lock, flags); + } +@@ -265,6 +269,7 @@ static int acpi_ec_transaction_unlocked( + spin_lock_irqsave(&ec->curr_lock, tmp); + /* following two actions should be kept atomic */ + t->irq_count = 0; ++ t->done = false; + ec->curr = t; + acpi_ec_write_cmd(ec, ec->curr->command); + if (ec->curr->command == ACPI_EC_COMMAND_QUERY) diff --git a/queue-2.6.27/series b/queue-2.6.27/series index bc42dd5c288..1b1d14a912f 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -36,3 +36,8 @@ usb-gadget-cdc-acm-deadlock-fix.patch usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch usb-fix-ps3-usb-shutdown-problems.patch usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch +usb-ehci-fix-divide-by-zero-bug.patch +usb-ehci-fix-handling-of-dead-controllers.patch +usb-don-t-register-endpoints-for-interfaces-that-are-going-away.patch +acpi-ec-revert-msleep-patch.patch +acpi-ec-wait-for-last-write-gpe.patch diff --git a/queue-2.6.27/usb-don-t-register-endpoints-for-interfaces-that-are-going-away.patch b/queue-2.6.27/usb-don-t-register-endpoints-for-interfaces-that-are-going-away.patch new file mode 100644 index 00000000000..43ed4ac8250 --- /dev/null +++ b/queue-2.6.27/usb-don-t-register-endpoints-for-interfaces-that-are-going-away.patch @@ -0,0 +1,69 @@ +From 352d026338378b1f13f044e33c1047da6e470056 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Wed, 29 Oct 2008 15:16:58 -0400 +Subject: USB: don't register endpoints for interfaces that are going away + +From: Alan Stern + +commit 352d026338378b1f13f044e33c1047da6e470056 upstream. + +This patch (as1155) fixes a bug in usbcore. When interfaces are +deleted, either because the device was disconnected or because of a +configuration change, the extra attribute files and child endpoint +devices may get left behind. This is because the core removes them +before calling device_del(). But during device_del(), after the +driver is unbound the core will reinstall altsetting 0 and recreate +those extra attributes and children. + +The patch prevents this by adding a flag to record when the interface +is in the midst of being unregistered. When the flag is set, the +attribute files and child devices will not be created. + +Signed-off-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/message.c | 1 + + drivers/usb/core/sysfs.c | 2 +- + include/linux/usb.h | 2 ++ + 3 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/message.c ++++ b/drivers/usb/core/message.c +@@ -1091,6 +1091,7 @@ void usb_disable_device(struct usb_devic + continue; + dev_dbg(&dev->dev, "unregistering interface %s\n", + dev_name(&interface->dev)); ++ interface->unregistering = 1; + usb_remove_sysfs_intf_files(interface); + device_del(&interface->dev); + } +--- a/drivers/usb/core/sysfs.c ++++ b/drivers/usb/core/sysfs.c +@@ -816,7 +816,7 @@ int usb_create_sysfs_intf_files(struct u + struct usb_host_interface *alt = intf->cur_altsetting; + int retval; + +- if (intf->sysfs_files_created) ++ if (intf->sysfs_files_created || intf->unregistering) + return 0; + + /* The interface string may be present in some altsettings +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -108,6 +108,7 @@ enum usb_interface_condition { + * (in probe()), bound to a driver, or unbinding (in disconnect()) + * @is_active: flag set when the interface is bound and not suspended. + * @sysfs_files_created: sysfs attributes exist ++ * @unregistering: flag set when the interface is being unregistered + * @needs_remote_wakeup: flag set when the driver requires remote-wakeup + * capability during autosuspend. + * @needs_altsetting0: flag set when a set-interface request for altsetting 0 +@@ -163,6 +164,7 @@ struct usb_interface { + enum usb_interface_condition condition; /* state of binding */ + unsigned is_active:1; /* the interface is not suspended */ + unsigned sysfs_files_created:1; /* the sysfs attributes exist */ ++ unsigned unregistering:1; /* unregistration is in progress */ + unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ + unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ + unsigned needs_binding:1; /* needs delayed unbind/rebind */ diff --git a/queue-2.6.27/usb-ehci-fix-divide-by-zero-bug.patch b/queue-2.6.27/usb-ehci-fix-divide-by-zero-bug.patch new file mode 100644 index 00000000000..a481895b3e9 --- /dev/null +++ b/queue-2.6.27/usb-ehci-fix-divide-by-zero-bug.patch @@ -0,0 +1,42 @@ +From 372dd6e8ed924e876f3beb598721e813ad7fa323 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Wed, 12 Nov 2008 17:02:57 -0500 +Subject: USB: EHCI: fix divide-by-zero bug + +From: Alan Stern + +commit 372dd6e8ed924e876f3beb598721e813ad7fa323 upstream. + +This patch (as1164) fixes a bug in the EHCI scheduler. The interval +value it uses is already in linear format, not logarithmically coded. +The existing code can sometimes crash the system by trying to divide +by zero. + +Signed-off-by: Alan Stern +Cc: David Brownell +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-sched.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/ehci-sched.c ++++ b/drivers/usb/host/ehci-sched.c +@@ -918,7 +918,7 @@ iso_stream_init ( + */ + stream->usecs = HS_USECS_ISO (maxp); + bandwidth = stream->usecs * 8; +- bandwidth /= 1 << (interval - 1); ++ bandwidth /= interval; + + } else { + u32 addr; +@@ -951,7 +951,7 @@ iso_stream_init ( + } else + stream->raw_mask = smask_out [hs_transfers - 1]; + bandwidth = stream->usecs + stream->c_usecs; +- bandwidth /= 1 << (interval + 2); ++ bandwidth /= interval << 3; + + /* stream->splits gets created from raw_mask later */ + stream->address = cpu_to_hc32(ehci, addr); diff --git a/queue-2.6.27/usb-ehci-fix-handling-of-dead-controllers.patch b/queue-2.6.27/usb-ehci-fix-handling-of-dead-controllers.patch new file mode 100644 index 00000000000..6801b462154 --- /dev/null +++ b/queue-2.6.27/usb-ehci-fix-handling-of-dead-controllers.patch @@ -0,0 +1,89 @@ +From 67b2e029743a52670d77864723b4d0d40f7733b5 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Wed, 12 Nov 2008 17:04:53 -0500 +Subject: USB: EHCI: fix handling of dead controllers + +From: Alan Stern + +commit 67b2e029743a52670d77864723b4d0d40f7733b5 upstream. + +This patch (as1165) makes a few small changes in the logic used by +ehci-hcd when it encounters a controller error: + + Instead of printing out the masked status, it prints the + original status as read directly from the hardware. + + It doesn't check for the STS_HALT status bit before taking + action. The mere fact that the STS_FATAL bit is set means + that something bad has happened and the controller needs to + be reset. With the old code this test could never succeed + because the STS_HALT bit was masked out from the status. + +I anticipate that this will prevent the occasional "irq X: nobody cared" +problem people encounter when their EHCI controllers die. + +Signed-off-by: Alan Stern +Cc: David Brownell +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-hcd.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd + static irqreturn_t ehci_irq (struct usb_hcd *hcd) + { + struct ehci_hcd *ehci = hcd_to_ehci (hcd); +- u32 status, pcd_status = 0, cmd; ++ u32 status, masked_status, pcd_status = 0, cmd; + int bh; + + spin_lock (&ehci->lock); +@@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_ + goto dead; + } + +- status &= INTR_MASK; +- if (!status) { /* irq sharing? */ ++ masked_status = status & INTR_MASK; ++ if (!masked_status) { /* irq sharing? */ + spin_unlock(&ehci->lock); + return IRQ_NONE; + } + + /* clear (just) interrupts */ +- ehci_writel(ehci, status, &ehci->regs->status); ++ ehci_writel(ehci, masked_status, &ehci->regs->status); + cmd = ehci_readl(ehci, &ehci->regs->command); + bh = 0; + +@@ -731,19 +731,18 @@ static irqreturn_t ehci_irq (struct usb_ + + /* PCI errors [4.15.2.4] */ + if (unlikely ((status & STS_FATAL) != 0)) { ++ ehci_err(ehci, "fatal error\n"); + dbg_cmd (ehci, "fatal", ehci_readl(ehci, + &ehci->regs->command)); + dbg_status (ehci, "fatal", status); +- if (status & STS_HALT) { +- ehci_err (ehci, "fatal error\n"); ++ ehci_halt(ehci); + dead: +- ehci_reset (ehci); +- ehci_writel(ehci, 0, &ehci->regs->configured_flag); +- /* generic layer kills/unlinks all urbs, then +- * uses ehci_stop to clean up the rest +- */ +- bh = 1; +- } ++ ehci_reset(ehci); ++ ehci_writel(ehci, 0, &ehci->regs->configured_flag); ++ /* generic layer kills/unlinks all urbs, then ++ * uses ehci_stop to clean up the rest ++ */ ++ bh = 1; + } + + if (bh)