From: Greg Kroah-Hartman Date: Thu, 24 Jan 2013 17:25:30 +0000 (-0800) Subject: 3.7-stable patches X-Git-Tag: v3.0.61~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7342e924f06df470fa4e8d18c266974d528a1c2;p=thirdparty%2Fkernel%2Fstable-queue.git 3.7-stable patches added patches: drivers-firmware-dmi_scan.c-check-dmi-version-when-get.patch drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch media-gspca_kinect-add-kinect-for-windows-usb-id.patch revert-drivers-misc-ti-st-remove-gpio-handling.patch scsi-sd-reshuffle-init_sd-to-avoid-crash.patch usb-dwc3-gadget-fix-ep-maxburst-for-ep0.patch usb-gadget-functionfs-fix-missing-braces-in-parse_opts.patch usb-musb-cppi_dma-drop-__init-annotation.patch usb-uhci-fix-irq-race-during-initialization.patch --- diff --git a/queue-3.7/drivers-firmware-dmi_scan.c-check-dmi-version-when-get.patch b/queue-3.7/drivers-firmware-dmi_scan.c-check-dmi-version-when-get.patch new file mode 100644 index 00000000000..237fe9c0972 --- /dev/null +++ b/queue-3.7/drivers-firmware-dmi_scan.c-check-dmi-version-when-get.patch @@ -0,0 +1,76 @@ +From f1d8e614d74b09531b9a85e812485340f3df7b1c Mon Sep 17 00:00:00 2001 +From: Zhenzhong Duan +Date: Thu, 20 Dec 2012 15:05:13 -0800 +Subject: drivers/firmware/dmi_scan.c: check dmi version when get + system uuid + +From: Zhenzhong Duan + +commit f1d8e614d74b09531b9a85e812485340f3df7b1c upstream. + +As of version 2.6 of the SMBIOS specification, the first 3 fields of the +UUID are supposed to be little-endian encoded. + +Also a minor fix to match variable meaning and mute checkpatch.pl + +[akpm@linux-foundation.org: tweak code comment] +Signed-off-by: Zhenzhong Duan +Cc: Feng Jin +Cc: Jean Delvare +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Abdallah Chatila +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/dmi_scan.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +--- a/drivers/firmware/dmi_scan.c ++++ b/drivers/firmware/dmi_scan.c +@@ -16,6 +16,7 @@ + */ + static char dmi_empty_string[] = " "; + ++static u16 __initdata dmi_ver; + /* + * Catch too early calls to dmi_check_system(): + */ +@@ -161,8 +162,10 @@ static void __init dmi_save_uuid(const s + return; + + for (i = 0; i < 16 && (is_ff || is_00); i++) { +- if(d[i] != 0x00) is_ff = 0; +- if(d[i] != 0xFF) is_00 = 0; ++ if (d[i] != 0x00) ++ is_00 = 0; ++ if (d[i] != 0xFF) ++ is_ff = 0; + } + + if (is_ff || is_00) +@@ -172,7 +175,15 @@ static void __init dmi_save_uuid(const s + if (!s) + return; + +- sprintf(s, "%pUB", d); ++ /* ++ * As of version 2.6 of the SMBIOS specification, the first 3 fields of ++ * the UUID are supposed to be little-endian encoded. The specification ++ * says that this is the defacto standard. ++ */ ++ if (dmi_ver >= 0x0206) ++ sprintf(s, "%pUL", d); ++ else ++ sprintf(s, "%pUB", d); + + dmi_ident[slot] = s; + } +@@ -414,6 +425,7 @@ static int __init dmi_present(const char + * DMI version 0.0 means that the real version is taken from + * the SMBIOS version, which we don't know at this point. + */ ++ dmi_ver = (buf[14] & 0xf0) << 4 | (buf[14] & 0x0f); + if (buf[14] != 0) + printk(KERN_INFO "DMI %d.%d present.\n", + buf[14] >> 4, buf[14] & 0xF); diff --git a/queue-3.7/drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch b/queue-3.7/drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch new file mode 100644 index 00000000000..70b3d8e5cbe --- /dev/null +++ b/queue-3.7/drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch @@ -0,0 +1,149 @@ +From 9f9c9cbb60576a1518d0bf93fb8e499cffccf377 Mon Sep 17 00:00:00 2001 +From: Zhenzhong Duan +Date: Thu, 20 Dec 2012 15:05:14 -0800 +Subject: drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists + +From: Zhenzhong Duan + +commit 9f9c9cbb60576a1518d0bf93fb8e499cffccf377 upstream. + +The right dmi version is in SMBIOS if it's zero in DMI region + +This issue was originally found from an oracle bug. +One customer noticed system UUID doesn't match between dmidecode & uek2. + + - HP ProLiant BL460c G6 : + # cat /sys/devices/virtual/dmi/id/product_uuid + 00000000-0000-4C48-3031-4D5030333531 + # dmidecode | grep -i uuid + UUID: 00000000-0000-484C-3031-4D5030333531 + +From SMBIOS 2.6 on, spec use little-endian encoding for UUID other than +network byte order. + +So we need to get dmi version to distinguish. If version is 0.0, the +real version is taken from the SMBIOS version. This is part of original +kernel comment in code. + +[akpm@linux-foundation.org: checkpatch fixes] +Signed-off-by: Zhenzhong Duan +Cc: Feng Jin +Cc: Jean Delvare +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Abdallah Chatila +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/dmi_scan.c | 62 +++++++++++++++++++++++++++++++++----------- + 1 file changed, 47 insertions(+), 15 deletions(-) + +--- a/drivers/firmware/dmi_scan.c ++++ b/drivers/firmware/dmi_scan.c +@@ -119,12 +119,12 @@ static int __init dmi_walk_early(void (* + return 0; + } + +-static int __init dmi_checksum(const u8 *buf) ++static int __init dmi_checksum(const u8 *buf, u8 len) + { + u8 sum = 0; + int a; + +- for (a = 0; a < 15; a++) ++ for (a = 0; a < len; a++) + sum += buf[a]; + + return sum == 0; +@@ -415,30 +415,57 @@ static int __init dmi_present(const char + u8 buf[15]; + + memcpy_fromio(buf, p, 15); +- if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) { ++ if (dmi_checksum(buf, 15)) { + dmi_num = (buf[13] << 8) | buf[12]; + dmi_len = (buf[7] << 8) | buf[6]; + dmi_base = (buf[11] << 24) | (buf[10] << 16) | + (buf[9] << 8) | buf[8]; + +- /* +- * DMI version 0.0 means that the real version is taken from +- * the SMBIOS version, which we don't know at this point. +- */ +- dmi_ver = (buf[14] & 0xf0) << 4 | (buf[14] & 0x0f); +- if (buf[14] != 0) +- printk(KERN_INFO "DMI %d.%d present.\n", +- buf[14] >> 4, buf[14] & 0xF); +- else +- printk(KERN_INFO "DMI present.\n"); + if (dmi_walk_early(dmi_decode) == 0) { ++ if (dmi_ver) ++ pr_info("SMBIOS %d.%d present.\n", ++ dmi_ver >> 8, dmi_ver & 0xFF); ++ else { ++ dmi_ver = (buf[14] & 0xF0) << 4 | ++ (buf[14] & 0x0F); ++ pr_info("Legacy DMI %d.%d present.\n", ++ dmi_ver >> 8, dmi_ver & 0xFF); ++ } + dmi_dump_ids(); + return 0; + } + } ++ dmi_ver = 0; + return 1; + } + ++static int __init smbios_present(const char __iomem *p) ++{ ++ u8 buf[32]; ++ int offset = 0; ++ ++ memcpy_fromio(buf, p, 32); ++ if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) { ++ dmi_ver = (buf[6] << 8) + buf[7]; ++ ++ /* Some BIOS report weird SMBIOS version, fix that up */ ++ switch (dmi_ver) { ++ case 0x021F: ++ case 0x0221: ++ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n", ++ dmi_ver & 0xFF, 3); ++ dmi_ver = 0x0203; ++ break; ++ case 0x0233: ++ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n", 51, 6); ++ dmi_ver = 0x0206; ++ break; ++ } ++ offset = 16; ++ } ++ return dmi_present(buf + offset); ++} ++ + void __init dmi_scan_machine(void) + { + char __iomem *p, *q; +@@ -456,7 +483,7 @@ void __init dmi_scan_machine(void) + if (p == NULL) + goto error; + +- rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ ++ rc = smbios_present(p); + dmi_iounmap(p, 32); + if (!rc) { + dmi_available = 1; +@@ -474,7 +501,12 @@ void __init dmi_scan_machine(void) + goto error; + + for (q = p; q < p + 0x10000; q += 16) { +- rc = dmi_present(q); ++ if (memcmp(q, "_SM_", 4) == 0 && q - p <= 0xFFE0) ++ rc = smbios_present(q); ++ else if (memcmp(q, "_DMI_", 5) == 0) ++ rc = dmi_present(q); ++ else ++ continue; + if (!rc) { + dmi_available = 1; + dmi_iounmap(p, 0x10000); diff --git a/queue-3.7/media-gspca_kinect-add-kinect-for-windows-usb-id.patch b/queue-3.7/media-gspca_kinect-add-kinect-for-windows-usb-id.patch new file mode 100644 index 00000000000..8bc654b828c --- /dev/null +++ b/queue-3.7/media-gspca_kinect-add-kinect-for-windows-usb-id.patch @@ -0,0 +1,32 @@ +From 98fd485795db064d0885150e2c0c7f296d8fe06e Mon Sep 17 00:00:00 2001 +From: Jacob Schloss +Date: Sun, 9 Dec 2012 20:18:25 -0300 +Subject: media: gspca_kinect: add Kinect for Windows USB id + +From: Jacob Schloss + +commit 98fd485795db064d0885150e2c0c7f296d8fe06e upstream. + +Add the USB ID for the Kinect for Windows RGB camera so it can be used +with the gspca_kinect driver. + +Signed-off-by: Jacob Schloss +Signed-off-by: Antonio Ospite +Signed-off-by: Hans de Goede +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/usb/gspca/kinect.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/usb/gspca/kinect.c ++++ b/drivers/media/usb/gspca/kinect.c +@@ -381,6 +381,7 @@ static const struct sd_desc sd_desc = { + /* -- module initialisation -- */ + static const struct usb_device_id device_table[] = { + {USB_DEVICE(0x045e, 0x02ae)}, ++ {USB_DEVICE(0x045e, 0x02bf)}, + {} + }; + diff --git a/queue-3.7/revert-drivers-misc-ti-st-remove-gpio-handling.patch b/queue-3.7/revert-drivers-misc-ti-st-remove-gpio-handling.patch new file mode 100644 index 00000000000..7f364d93225 --- /dev/null +++ b/queue-3.7/revert-drivers-misc-ti-st-remove-gpio-handling.patch @@ -0,0 +1,105 @@ +From a7e2ca17039edb5f782be519eaf9d8ea500ba7cc Mon Sep 17 00:00:00 2001 +From: Luciano Coelho +Date: Mon, 21 Jan 2013 13:12:42 +0200 +Subject: Revert "drivers/misc/ti-st: remove gpio handling" + +From: Luciano Coelho + +commit a7e2ca17039edb5f782be519eaf9d8ea500ba7cc upstream. + +This reverts commit eccf2979b2c034b516e01b8a104c3739f7ef07d1. + +The reason is that it broke TI WiLink shared transport on Panda. +Also, callback functions should not be added to board files anymore, +so revert to implementing the power functions in the driver itself. + +Additionally, changed a variable name ('status' to 'err') so that this +revert compiles properly. + +Acked-by: Tony Lindgren +Signed-off-by: Luciano Coelho +[changed "err" back to "status" to get it to build in 3.7 - gregkh] +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/ti-st/st_kim.c | 37 ++++++++++++++++++++++++++++++++++++- + 1 file changed, 36 insertions(+), 1 deletion(-) + +--- a/drivers/misc/ti-st/st_kim.c ++++ b/drivers/misc/ti-st/st_kim.c +@@ -468,6 +468,11 @@ long st_kim_start(void *kim_data) + if (pdata->chip_enable) + pdata->chip_enable(kim_gdata); + ++ /* Configure BT nShutdown to HIGH state */ ++ gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); ++ mdelay(5); /* FIXME: a proper toggle */ ++ gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); ++ mdelay(100); + /* re-initialize the completion */ + INIT_COMPLETION(kim_gdata->ldisc_installed); + /* send notification to UIM */ +@@ -509,7 +514,8 @@ long st_kim_start(void *kim_data) + * (b) upon failure to either install ldisc or download firmware. + * The function is responsible to (a) notify UIM about un-installation, + * (b) flush UART if the ldisc was installed. +- * (c) invoke platform's chip disabling routine. ++ * (c) reset BT_EN - pull down nshutdown at the end. ++ * (d) invoke platform's chip disabling routine. + */ + long st_kim_stop(void *kim_data) + { +@@ -541,6 +547,13 @@ long st_kim_stop(void *kim_data) + err = -ETIMEDOUT; + } + ++ /* By default configure BT nShutdown to LOW state */ ++ gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); ++ mdelay(1); ++ gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); ++ mdelay(1); ++ gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); ++ + /* platform specific disable */ + if (pdata->chip_disable) + pdata->chip_disable(kim_gdata); +@@ -732,6 +745,20 @@ static int kim_probe(struct platform_dev + /* refer to itself */ + kim_gdata->core_data->kim_data = kim_gdata; + ++ /* Claim the chip enable nShutdown gpio from the system */ ++ kim_gdata->nshutdown = pdata->nshutdown_gpio; ++ status = gpio_request(kim_gdata->nshutdown, "kim"); ++ if (unlikely(status)) { ++ pr_err(" gpio %ld request failed ", kim_gdata->nshutdown); ++ return status; ++ } ++ ++ /* Configure nShutdown GPIO as output=0 */ ++ status = gpio_direction_output(kim_gdata->nshutdown, 0); ++ if (unlikely(status)) { ++ pr_err(" unable to configure gpio %ld", kim_gdata->nshutdown); ++ return status; ++ } + /* get reference of pdev for request_firmware + */ + kim_gdata->kim_pdev = pdev; +@@ -767,10 +794,18 @@ static int kim_probe(struct platform_dev + + static int kim_remove(struct platform_device *pdev) + { ++ /* free the GPIOs requested */ ++ struct ti_st_plat_data *pdata = pdev->dev.platform_data; + struct kim_data_s *kim_gdata; + + kim_gdata = dev_get_drvdata(&pdev->dev); + ++ /* Free the Bluetooth/FM/GPIO ++ * nShutdown gpio from the system ++ */ ++ gpio_free(pdata->nshutdown_gpio); ++ pr_info("nshutdown GPIO Freed"); ++ + debugfs_remove_recursive(kim_debugfs_dir); + sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp); + pr_info("sysfs entries removed"); diff --git a/queue-3.7/scsi-sd-reshuffle-init_sd-to-avoid-crash.patch b/queue-3.7/scsi-sd-reshuffle-init_sd-to-avoid-crash.patch new file mode 100644 index 00000000000..ea593055cfd --- /dev/null +++ b/queue-3.7/scsi-sd-reshuffle-init_sd-to-avoid-crash.patch @@ -0,0 +1,66 @@ +From afd5e34b2bb34881d3a789e62486814a49b47faa Mon Sep 17 00:00:00 2001 +From: "Joel D. Diaz" +Date: Wed, 10 Oct 2012 10:36:11 +0200 +Subject: SCSI: sd: Reshuffle init_sd to avoid crash + +From: "Joel D. Diaz" + +commit afd5e34b2bb34881d3a789e62486814a49b47faa upstream. + +scsi_register_driver will register a prep_fn() function, which +in turn migh need to use the sd_cdp_pool for DIF. +Which hasn't been initialised at this point, leading to +a crash. So reshuffle the init_sd() and exit_sd() paths +to have the driver registered last. + +Signed-off-by: Joel D. Diaz +Signed-off-by: Hannes Reinecke +Signed-off-by: James Bottomley +Cc: CAI Qian +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -3116,10 +3116,6 @@ static int __init init_sd(void) + if (err) + goto err_out; + +- err = scsi_register_driver(&sd_template.gendrv); +- if (err) +- goto err_out_class; +- + sd_cdb_cache = kmem_cache_create("sd_ext_cdb", SD_EXT_CDB_SIZE, + 0, 0, NULL); + if (!sd_cdb_cache) { +@@ -3133,8 +3129,15 @@ static int __init init_sd(void) + goto err_out_cache; + } + ++ err = scsi_register_driver(&sd_template.gendrv); ++ if (err) ++ goto err_out_driver; ++ + return 0; + ++err_out_driver: ++ mempool_destroy(sd_cdb_pool); ++ + err_out_cache: + kmem_cache_destroy(sd_cdb_cache); + +@@ -3157,10 +3160,10 @@ static void __exit exit_sd(void) + + SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n")); + ++ scsi_unregister_driver(&sd_template.gendrv); + mempool_destroy(sd_cdb_pool); + kmem_cache_destroy(sd_cdb_cache); + +- scsi_unregister_driver(&sd_template.gendrv); + class_unregister(&sd_disk_class); + + for (i = 0; i < SD_MAJORS; i++) diff --git a/queue-3.7/series b/queue-3.7/series index 12bccb51fbb..2d74a922299 100644 --- a/queue-3.7/series +++ b/queue-3.7/series @@ -22,3 +22,12 @@ pci-allow-pcie_aspm-force-even-when-fadt-indicates-it-is-unsupported.patch pci-pciehp-use-per-slot-workqueues-to-avoid-deadlock.patch pci-shpchp-handle-push-button-event-asynchronously.patch pci-shpchp-use-per-slot-workqueues-to-avoid-deadlock.patch +revert-drivers-misc-ti-st-remove-gpio-handling.patch +media-gspca_kinect-add-kinect-for-windows-usb-id.patch +usb-uhci-fix-irq-race-during-initialization.patch +usb-dwc3-gadget-fix-ep-maxburst-for-ep0.patch +usb-gadget-functionfs-fix-missing-braces-in-parse_opts.patch +usb-musb-cppi_dma-drop-__init-annotation.patch +scsi-sd-reshuffle-init_sd-to-avoid-crash.patch +drivers-firmware-dmi_scan.c-check-dmi-version-when-get.patch +drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch diff --git a/queue-3.7/usb-dwc3-gadget-fix-ep-maxburst-for-ep0.patch b/queue-3.7/usb-dwc3-gadget-fix-ep-maxburst-for-ep0.patch new file mode 100644 index 00000000000..e30a700094b --- /dev/null +++ b/queue-3.7/usb-dwc3-gadget-fix-ep-maxburst-for-ep0.patch @@ -0,0 +1,30 @@ +From 6048e4c69d80600baba35856651056860d5d8f5a Mon Sep 17 00:00:00 2001 +From: Pratyush Anand +Date: Fri, 18 Jan 2013 16:53:56 +0530 +Subject: usb: dwc3: gadget: fix ep->maxburst for ep0 + +From: Pratyush Anand + +commit 6048e4c69d80600baba35856651056860d5d8f5a upstream. + +dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by +default initialize ep->maxburst to 1 for ep0. + +Signed-off-by: Pratyush Anand +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -1605,6 +1605,7 @@ static int __devinit dwc3_gadget_init_en + + if (epnum == 0 || epnum == 1) { + dep->endpoint.maxpacket = 512; ++ dep->endpoint.maxburst = 1; + dep->endpoint.ops = &dwc3_gadget_ep0_ops; + if (!epnum) + dwc->gadget.ep0 = &dep->endpoint; diff --git a/queue-3.7/usb-gadget-functionfs-fix-missing-braces-in-parse_opts.patch b/queue-3.7/usb-gadget-functionfs-fix-missing-braces-in-parse_opts.patch new file mode 100644 index 00000000000..2c6d81ec239 --- /dev/null +++ b/queue-3.7/usb-gadget-functionfs-fix-missing-braces-in-parse_opts.patch @@ -0,0 +1,44 @@ +From b810075002c9f25a6da83cecda39d789000a04a9 Mon Sep 17 00:00:00 2001 +From: Benoit Goby +Date: Tue, 8 Jan 2013 19:57:09 -0800 +Subject: usb: gadget: FunctionFS: Fix missing braces in parse_opts + +From: Benoit Goby + +commit b810075002c9f25a6da83cecda39d789000a04a9 upstream. + +Add missing braces around an if block in ffs_fs_parse_opts. This broke +parsing the uid/gid mount options and causes mount to fail when using +uid/gid. This has been introduced by commit b9b73f7c (userns: Convert usb +functionfs to use kuid/kgid where appropriate) in 3.7. + +Signed-off-by: Benoit Goby +Acked-by: Michal Nazarewicz +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_fs.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/usb/gadget/f_fs.c ++++ b/drivers/usb/gadget/f_fs.c +@@ -1153,15 +1153,15 @@ static int ffs_fs_parse_opts(struct ffs_ + pr_err("%s: unmapped value: %lu\n", opts, value); + return -EINVAL; + } +- } +- else if (!memcmp(opts, "gid", 3)) ++ } else if (!memcmp(opts, "gid", 3)) { + data->perms.gid = make_kgid(current_user_ns(), value); + if (!gid_valid(data->perms.gid)) { + pr_err("%s: unmapped value: %lu\n", opts, value); + return -EINVAL; + } +- else ++ } else { + goto invalid; ++ } + break; + + default: diff --git a/queue-3.7/usb-musb-cppi_dma-drop-__init-annotation.patch b/queue-3.7/usb-musb-cppi_dma-drop-__init-annotation.patch new file mode 100644 index 00000000000..221993b5bcc --- /dev/null +++ b/queue-3.7/usb-musb-cppi_dma-drop-__init-annotation.patch @@ -0,0 +1,54 @@ +From 091a62c9b3d899d99dbf4e3dbebc8dfa3edbccdd Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Fri, 14 Dec 2012 21:30:27 +0300 +Subject: usb: musb: cppi_dma: drop '__init' annotation + +From: Sergei Shtylyov + +commit 091a62c9b3d899d99dbf4e3dbebc8dfa3edbccdd upstream. + +This patch fixes the following: + +WARNING: vmlinux.o(.text+0x1e709c): Section mismatch in reference from the funct +ion dma_controller_create() to the function .init.text:cppi_controller_start() +The function dma_controller_create() references +the function __init cppi_controller_start(). +This is often because dma_controller_create lacks a __init +annotation or the annotation of cppi_controller_start is wrong. + +This warning is there due to the deficiency in the commit 07a67bbb (usb: musb: +Make dma_controller_create __devinit). + +Since the start() method is only called from musb_init_controller() which is +not annotated, drop '__init' annotation from cppi_controller_start() and also +cppi_pool_init() since it gets called from that function, to avoid another +section mismatch warning... + +Signed-off-by: Sergei Shtylyov +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/cppi_dma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/musb/cppi_dma.c ++++ b/drivers/usb/musb/cppi_dma.c +@@ -105,7 +105,7 @@ static void cppi_reset_tx(struct cppi_tx + musb_writel(&tx->tx_complete, 0, ptr); + } + +-static void __init cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) ++static void cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) + { + int j; + +@@ -150,7 +150,7 @@ static void cppi_pool_free(struct cppi_c + c->last_processed = NULL; + } + +-static int __init cppi_controller_start(struct dma_controller *c) ++static int cppi_controller_start(struct dma_controller *c) + { + struct cppi *controller; + void __iomem *tibase; diff --git a/queue-3.7/usb-uhci-fix-irq-race-during-initialization.patch b/queue-3.7/usb-uhci-fix-irq-race-during-initialization.patch new file mode 100644 index 00000000000..c393618d417 --- /dev/null +++ b/queue-3.7/usb-uhci-fix-irq-race-during-initialization.patch @@ -0,0 +1,79 @@ +From 0f815a0a700bc10547449bde6c106051a035a1b9 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 22 Jan 2013 11:37:35 -0500 +Subject: USB: UHCI: fix IRQ race during initialization + +From: Alan Stern + +commit 0f815a0a700bc10547449bde6c106051a035a1b9 upstream. + +This patch (as1644) fixes a race that occurs during startup in +uhci-hcd. If the IRQ line is shared with other devices, it's possible +for the handler routine to be called before the data structures are +fully initialized. + +The problem is fixed by adding a check to the IRQ handler routine. If +the initialization hasn't finished yet, the routine will return +immediately. + +Signed-off-by: Alan Stern +Reported-by: Don Zickus +Tested-by: "Huang, Adrian (ISS Linux TW)" +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/uhci-hcd.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +--- a/drivers/usb/host/uhci-hcd.c ++++ b/drivers/usb/host/uhci-hcd.c +@@ -447,6 +447,10 @@ static irqreturn_t uhci_irq(struct usb_h + return IRQ_NONE; + uhci_writew(uhci, status, USBSTS); /* Clear it */ + ++ spin_lock(&uhci->lock); ++ if (unlikely(!uhci->is_initialized)) /* not yet configured */ ++ goto done; ++ + if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) { + if (status & USBSTS_HSE) + dev_err(uhci_dev(uhci), "host system error, " +@@ -455,7 +459,6 @@ static irqreturn_t uhci_irq(struct usb_h + dev_err(uhci_dev(uhci), "host controller process " + "error, something bad happened!\n"); + if (status & USBSTS_HCH) { +- spin_lock(&uhci->lock); + if (uhci->rh_state >= UHCI_RH_RUNNING) { + dev_err(uhci_dev(uhci), + "host controller halted, " +@@ -473,15 +476,15 @@ static irqreturn_t uhci_irq(struct usb_h + * pending unlinks */ + mod_timer(&hcd->rh_timer, jiffies); + } +- spin_unlock(&uhci->lock); + } + } + +- if (status & USBSTS_RD) ++ if (status & USBSTS_RD) { ++ spin_unlock(&uhci->lock); + usb_hcd_poll_rh_status(hcd); +- else { +- spin_lock(&uhci->lock); ++ } else { + uhci_scan_schedule(uhci); ++ done: + spin_unlock(&uhci->lock); + } + +@@ -662,9 +665,9 @@ static int uhci_start(struct usb_hcd *hc + */ + mb(); + ++ spin_lock_irq(&uhci->lock); + configure_hc(uhci); + uhci->is_initialized = 1; +- spin_lock_irq(&uhci->lock); + start_rh(uhci); + spin_unlock_irq(&uhci->lock); + return 0;