From f2c468806b00534272b9853af23adc59bede3d9a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Apr 2012 10:36:40 -0700 Subject: [PATCH] 3.0-stable patches added patches: pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch usb-gadget-eliminate-null-pointer-dereference-bugfix.patch usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch --- ...nterrupts-on-intel-sandy-bridge-gpus.patch | 85 +++++++++++++++++++ queue-3.0/series | 4 + ...nate-null-pointer-dereference-bugfix.patch | 53 ++++++++++++ ...when-musb-glue-omap-gets-initialized.patch | 41 +++++++++ ...-error-check-for-pm_runtime_get_sync.patch | 45 ++++++++++ 5 files changed, 228 insertions(+) create mode 100644 queue-3.0/pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch create mode 100644 queue-3.0/usb-gadget-eliminate-null-pointer-dereference-bugfix.patch create mode 100644 queue-3.0/usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch create mode 100644 queue-3.0/usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch diff --git a/queue-3.0/pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch b/queue-3.0/pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch new file mode 100644 index 00000000000..cc91b1ca72e --- /dev/null +++ b/queue-3.0/pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch @@ -0,0 +1,85 @@ +From f67fd55fa96f7d7295b43ffbc4a97d8f55e473aa Mon Sep 17 00:00:00 2001 +From: Thomas Jarosch +Date: Wed, 7 Dec 2011 22:08:11 +0100 +Subject: PCI: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs + +From: Thomas Jarosch + +commit f67fd55fa96f7d7295b43ffbc4a97d8f55e473aa upstream. + +Some BIOS implementations leave the Intel GPU interrupts enabled, +even though no one is handling them (f.e. i915 driver is never loaded). +Additionally the interrupt destination is not set up properly +and the interrupt ends up -somewhere-. + +These spurious interrupts are "sticky" and the kernel disables +the (shared) interrupt line after 100.000+ generated interrupts. + +Fix it by disabling the still enabled interrupts. +This resolves crashes often seen on monitor unplug. + +Tested on the following boards: +- Intel DH61CR: Affected +- Intel DH67BL: Affected +- Intel S1200KP server board: Affected +- Asus P8H61-M LE: Affected, but system does not crash. + Probably the IRQ ends up somewhere unnoticed. + +According to reports on the net, the Intel DH61WW board is also affected. + +Many thanks to Jesse Barnes from Intel for helping +with the register configuration and to Intel in general +for providing public hardware documentation. + +Signed-off-by: Thomas Jarosch +Tested-by: Charlie Suffin +Signed-off-by: Jesse Barnes +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/quirks.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -2822,6 +2822,40 @@ static void __devinit fixup_ti816x_class + } + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_TI, 0xb800, fixup_ti816x_class); + ++/* ++ * Some BIOS implementations leave the Intel GPU interrupts enabled, ++ * even though no one is handling them (f.e. i915 driver is never loaded). ++ * Additionally the interrupt destination is not set up properly ++ * and the interrupt ends up -somewhere-. ++ * ++ * These spurious interrupts are "sticky" and the kernel disables ++ * the (shared) interrupt line after 100.000+ generated interrupts. ++ * ++ * Fix it by disabling the still enabled interrupts. ++ * This resolves crashes often seen on monitor unplug. ++ */ ++#define I915_DEIER_REG 0x4400c ++static void __devinit disable_igfx_irq(struct pci_dev *dev) ++{ ++ void __iomem *regs = pci_iomap(dev, 0, 0); ++ if (regs == NULL) { ++ dev_warn(&dev->dev, "igfx quirk: Can't iomap PCI device\n"); ++ return; ++ } ++ ++ /* Check if any interrupt line is still enabled */ ++ if (readl(regs + I915_DEIER_REG) != 0) { ++ dev_warn(&dev->dev, "BIOS left Intel GPU interrupts enabled; " ++ "disabling\n"); ++ ++ writel(0, regs + I915_DEIER_REG); ++ } ++ ++ pci_iounmap(dev, regs); ++} ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq); ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); ++ + static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, + struct pci_fixup *end) + { diff --git a/queue-3.0/series b/queue-3.0/series index a00589127fe..6af9e289ae0 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -20,3 +20,7 @@ drivers-tty-amiserial.c-add-missing-tty_unlock.patch usb-sierra-avoid-qmi-wwan-interface-on-mc77xx.patch ehci-always-clear-the-sts_flr-status-bit.patch usb-fix-deadlock-in-bconfigurationvalue-attribute-method.patch +usb-gadget-eliminate-null-pointer-dereference-bugfix.patch +usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch +usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch +pci-add-quirk-for-still-enabled-interrupts-on-intel-sandy-bridge-gpus.patch diff --git a/queue-3.0/usb-gadget-eliminate-null-pointer-dereference-bugfix.patch b/queue-3.0/usb-gadget-eliminate-null-pointer-dereference-bugfix.patch new file mode 100644 index 00000000000..70ccd90460b --- /dev/null +++ b/queue-3.0/usb-gadget-eliminate-null-pointer-dereference-bugfix.patch @@ -0,0 +1,53 @@ +From 92b0abf80c5c5f0e0d71d1309688a330fd74731b Mon Sep 17 00:00:00 2001 +From: Andrzej Pietrasiewicz +Date: Wed, 28 Mar 2012 09:30:50 +0200 +Subject: usb: gadget: eliminate NULL pointer dereference (bugfix) + +From: Andrzej Pietrasiewicz + +commit 92b0abf80c5c5f0e0d71d1309688a330fd74731b upstream. + +usb: gadget: eliminate NULL pointer dereference (bugfix) + +This patch fixes a bug which causes NULL pointer dereference in +ffs_ep0_ioctl. The bug happens when the FunctionFS is not bound (either +has not been bound yet or has been bound and then unbound) and can be +reproduced with running the following commands: + +$ insmod g_ffs.ko +$ mount -t functionfs func /dev/usbgadget +$ ./null + +where null.c is: + +#include +#include + +int main(void) +{ + int fd = open("/dev/usbgadget/ep0", O_RDWR); + ioctl(fd, FUNCTIONFS_CLEAR_HALT); + + return 0; +} + +Signed-off-by: Andrzej Pietrasiewicz +Signed-off-by: Kyungmin Park +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_fs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/f_fs.c ++++ b/drivers/usb/gadget/f_fs.c +@@ -720,7 +720,7 @@ static long ffs_ep0_ioctl(struct file *f + if (code == FUNCTIONFS_INTERFACE_REVMAP) { + struct ffs_function *func = ffs->func; + ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV; +- } else if (gadget->ops->ioctl) { ++ } else if (gadget && gadget->ops->ioctl) { + ret = gadget->ops->ioctl(gadget, code, value); + } else { + ret = -ENOTTY; diff --git a/queue-3.0/usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch b/queue-3.0/usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch new file mode 100644 index 00000000000..292635b1fd0 --- /dev/null +++ b/queue-3.0/usb-musb-omap-fix-crash-when-musb-glue-omap-gets-initialized.patch @@ -0,0 +1,41 @@ +From 3006dc8c627d738693e910c159630e4368c9e86c Mon Sep 17 00:00:00 2001 +From: Kishon Vijay Abraham I +Date: Wed, 21 Mar 2012 21:30:20 +0530 +Subject: usb: musb: omap: fix crash when musb glue (omap) gets initialized + +From: Kishon Vijay Abraham I + +commit 3006dc8c627d738693e910c159630e4368c9e86c upstream. + +pm_runtime_enable is being called after omap2430_musb_init. Hence +pm_runtime_get_sync in omap2430_musb_init does not have any effect (does +not enable clocks) resulting in a crash during register access. It is +fixed here. + +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/omap2430.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/musb/omap2430.c ++++ b/drivers/usb/musb/omap2430.c +@@ -464,14 +464,14 @@ static int __init omap2430_probe(struct + goto err2; + } + ++ pm_runtime_enable(&pdev->dev); ++ + ret = platform_device_add(musb); + if (ret) { + dev_err(&pdev->dev, "failed to register musb device\n"); + goto err2; + } + +- pm_runtime_enable(&pdev->dev); +- + return 0; + + err2: diff --git a/queue-3.0/usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch b/queue-3.0/usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch new file mode 100644 index 00000000000..5399b50a83d --- /dev/null +++ b/queue-3.0/usb-musb-omap-fix-the-error-check-for-pm_runtime_get_sync.patch @@ -0,0 +1,45 @@ +From ad579699c4f0274bf522a9252ff9b20c72197e48 Mon Sep 17 00:00:00 2001 +From: Shubhrajyoti D +Date: Thu, 22 Mar 2012 12:48:06 +0530 +Subject: usb: musb: omap: fix the error check for pm_runtime_get_sync + +From: Shubhrajyoti D + +commit ad579699c4f0274bf522a9252ff9b20c72197e48 upstream. + +pm_runtime_get_sync returns a signed integer. In case of errors +it returns a negative value. This patch fixes the error check +by making it signed instead of unsigned thus preventing register +access if get_sync_fails. Also passes the error cause to the +debug message. + +Cc: Kishon Vijay Abraham I +Signed-off-by: Shubhrajyoti D +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/omap2430.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/usb/musb/omap2430.c ++++ b/drivers/usb/musb/omap2430.c +@@ -295,7 +295,8 @@ static int musb_otg_notifications(struct + + static int omap2430_musb_init(struct musb *musb) + { +- u32 l, status = 0; ++ u32 l; ++ int status = 0; + struct device *dev = musb->controller; + struct musb_hdrc_platform_data *plat = dev->platform_data; + struct omap_musb_board_data *data = plat->board_data; +@@ -312,7 +313,7 @@ static int omap2430_musb_init(struct mus + + status = pm_runtime_get_sync(dev); + if (status < 0) { +- dev_err(dev, "pm_runtime_get_sync FAILED"); ++ dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); + goto err1; + } + -- 2.47.3