From: Greg Kroah-Hartman Date: Wed, 14 Jan 2015 01:34:16 +0000 (-0800) Subject: 3.18-stable patches X-Git-Tag: v3.10.65~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=878e5d0430859e1342240990033f64482e4419ea;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: add-usb_ehci_exynos-to-multi_v7_defconfig.patch md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch usb-cdc-acm-check-for-valid-interfaces.patch usb-gadget-at91_udc-move-prepare-clk-into-process-context.patch usb-qcserial-add-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch usb-renesas_usbhs-gadget-fix-null-pointer-dereference-in-ep_disable.patch --- diff --git a/queue-3.18/add-usb_ehci_exynos-to-multi_v7_defconfig.patch b/queue-3.18/add-usb_ehci_exynos-to-multi_v7_defconfig.patch new file mode 100644 index 00000000000..18fe339d771 --- /dev/null +++ b/queue-3.18/add-usb_ehci_exynos-to-multi_v7_defconfig.patch @@ -0,0 +1,35 @@ +From 007487f1fd43d84f26cda926081ca219a24ecbc4 Mon Sep 17 00:00:00 2001 +From: Steev Klimaszewski +Date: Tue, 30 Dec 2014 00:55:48 -0600 +Subject: Add USB_EHCI_EXYNOS to multi_v7_defconfig + +From: Steev Klimaszewski + +commit 007487f1fd43d84f26cda926081ca219a24ecbc4 upstream. + +Currently we enable Exynos devices in the multi v7 defconfig, however, when +testing on my ODROID-U3, I noticed that USB was not working. Enabling this +option causes USB to work, which enables networking support as well since the +ODROID-U3 has networking on the USB bus. + +[arnd] Support for odroid-u3 was added in 3.10, so it would be nice to +backport this fix at least that far. + +Signed-off-by: Steev Klimaszewski +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/configs/multi_v7_defconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/configs/multi_v7_defconfig ++++ b/arch/arm/configs/multi_v7_defconfig +@@ -320,6 +320,7 @@ CONFIG_USB=y + CONFIG_USB_XHCI_HCD=y + CONFIG_USB_XHCI_MVEBU=y + CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_EXYNOS=y + CONFIG_USB_EHCI_TEGRA=y + CONFIG_USB_EHCI_HCD_PLATFORM=y + CONFIG_USB_ISP1760_HCD=y diff --git a/queue-3.18/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch b/queue-3.18/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch new file mode 100644 index 00000000000..1bd2094c373 --- /dev/null +++ b/queue-3.18/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch @@ -0,0 +1,50 @@ +From 108cef3aa41669610e1836fe638812dd067d72de Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 3 Dec 2014 16:07:58 +1100 +Subject: md/raid5: fetch_block must fetch all the blocks handle_stripe_dirtying wants. + +From: NeilBrown + +commit 108cef3aa41669610e1836fe638812dd067d72de upstream. + +It is critical that fetch_block() and handle_stripe_dirtying() +are consistent in their analysis of what needs to be loaded. +Otherwise raid5 can wait forever for a block that won't be loaded. + +Currently when writing to a RAID5 that is resyncing, to a location +beyond the resync offset, handle_stripe_dirtying chooses a +reconstruct-write cycle, but fetch_block() assumes a +read-modify-write, and a lockup can happen. + +So treat that case just like RAID6, just as we do in +handle_stripe_dirtying. RAID6 always does reconstruct-write. + +This bug was introduced when the behaviour of handle_stripe_dirtying +was changed in 3.7, so the patch is suitable for any kernel since, +though it will need careful merging for some versions. + +Fixes: a7854487cd7128a30a7f4f5259de9f67d5efb95f +Reported-by: Henry Cai +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -2917,8 +2917,11 @@ static int fetch_block(struct stripe_hea + (sh->raid_conf->level <= 5 && s->failed && fdev[0]->towrite && + (!test_bit(R5_Insync, &dev->flags) || test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) && + !test_bit(R5_OVERWRITE, &fdev[0]->flags)) || +- (sh->raid_conf->level == 6 && s->failed && s->to_write && +- s->to_write - s->non_overwrite < sh->raid_conf->raid_disks - 2 && ++ ((sh->raid_conf->level == 6 || ++ sh->sector >= sh->raid_conf->mddev->recovery_cp) ++ && s->failed && s->to_write && ++ (s->to_write - s->non_overwrite < ++ sh->raid_conf->raid_disks - sh->raid_conf->max_degraded) && + (!test_bit(R5_Insync, &dev->flags) || test_bit(STRIPE_PREREAD_ACTIVE, &sh->state))))) { + /* we would like to get this block, possibly by computing it, + * otherwise read it if the backing disk is insync diff --git a/queue-3.18/series b/queue-3.18/series index 95f8f3eb49b..85361132039 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -80,3 +80,9 @@ alsa-fireworks-fix-an-endianness-bug-for-transaction-length.patch alsa-snd-usb-caiaq-fix-stream-count-check.patch alsa-hda-fix-wrong-gpio_dir-gpio_mask-hint-setups-for-idt-stac-codecs.patch alsa-hda-add-new-gpu-codec-id-0x10de0072-to-snd-hda.patch +md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch +usb-cdc-acm-check-for-valid-interfaces.patch +usb-renesas_usbhs-gadget-fix-null-pointer-dereference-in-ep_disable.patch +usb-gadget-at91_udc-move-prepare-clk-into-process-context.patch +usb-qcserial-add-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch +add-usb_ehci_exynos-to-multi_v7_defconfig.patch diff --git a/queue-3.18/usb-cdc-acm-check-for-valid-interfaces.patch b/queue-3.18/usb-cdc-acm-check-for-valid-interfaces.patch new file mode 100644 index 00000000000..b1ade8c14a7 --- /dev/null +++ b/queue-3.18/usb-cdc-acm-check-for-valid-interfaces.patch @@ -0,0 +1,38 @@ +From 403dff4e2c94f275e24fd85f40b2732ffec268a1 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Fri, 7 Nov 2014 08:48:15 -0800 +Subject: USB: cdc-acm: check for valid interfaces + +From: Greg Kroah-Hartman + +commit 403dff4e2c94f275e24fd85f40b2732ffec268a1 upstream. + +We need to check that we have both a valid data and control inteface for both +types of headers (union and not union.) + +References: https://bugzilla.kernel.org/show_bug.cgi?id=83551 +Reported-by: Simon Schubert <2+kernel@0x2c.org> +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1197,10 +1197,11 @@ next_desc: + } else { + control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0); + data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0)); +- if (!control_interface || !data_interface) { +- dev_dbg(&intf->dev, "no interfaces\n"); +- return -ENODEV; +- } ++ } ++ ++ if (!control_interface || !data_interface) { ++ dev_dbg(&intf->dev, "no interfaces\n"); ++ return -ENODEV; + } + + if (data_interface_num != call_interface_num) diff --git a/queue-3.18/usb-gadget-at91_udc-move-prepare-clk-into-process-context.patch b/queue-3.18/usb-gadget-at91_udc-move-prepare-clk-into-process-context.patch new file mode 100644 index 00000000000..2b0160b69ed --- /dev/null +++ b/queue-3.18/usb-gadget-at91_udc-move-prepare-clk-into-process-context.patch @@ -0,0 +1,122 @@ +From b2ba27a5c56ff7204d8a8684893d64d4afe2cee5 Mon Sep 17 00:00:00 2001 +From: Ronald Wahl +Date: Wed, 19 Nov 2014 16:37:27 +0100 +Subject: usb: gadget: at91_udc: move prepare clk into process context + +From: Ronald Wahl + +commit b2ba27a5c56ff7204d8a8684893d64d4afe2cee5 upstream. + +Commit 7628083227b6bc4a7e33d7c381d7a4e558424b6b (usb: gadget: at91_udc: +prepare clk before calling enable) added clock preparation in interrupt +context. This is not allowed as it might sleep. Also setting the clock +rate is unsafe to call from there for the same reason. Move clock +preparation and setting clock rate into process context (at91udc_probe). + +Signed-off-by: Ronald Wahl +Acked-by: Alexandre Belloni +Acked-by: Boris Brezillon +Acked-by: Nicolas Ferre +Cc: Felipe Balbi +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/udc/at91_udc.c | 44 +++++++++++++++++++++++++++----------- + 1 file changed, 32 insertions(+), 12 deletions(-) + +--- a/drivers/usb/gadget/udc/at91_udc.c ++++ b/drivers/usb/gadget/udc/at91_udc.c +@@ -870,12 +870,10 @@ static void clk_on(struct at91_udc *udc) + return; + udc->clocked = 1; + +- if (IS_ENABLED(CONFIG_COMMON_CLK)) { +- clk_set_rate(udc->uclk, 48000000); +- clk_prepare_enable(udc->uclk); +- } +- clk_prepare_enable(udc->iclk); +- clk_prepare_enable(udc->fclk); ++ if (IS_ENABLED(CONFIG_COMMON_CLK)) ++ clk_enable(udc->uclk); ++ clk_enable(udc->iclk); ++ clk_enable(udc->fclk); + } + + static void clk_off(struct at91_udc *udc) +@@ -884,10 +882,10 @@ static void clk_off(struct at91_udc *udc + return; + udc->clocked = 0; + udc->gadget.speed = USB_SPEED_UNKNOWN; +- clk_disable_unprepare(udc->fclk); +- clk_disable_unprepare(udc->iclk); ++ clk_disable(udc->fclk); ++ clk_disable(udc->iclk); + if (IS_ENABLED(CONFIG_COMMON_CLK)) +- clk_disable_unprepare(udc->uclk); ++ clk_disable(udc->uclk); + } + + /* +@@ -1780,14 +1778,24 @@ static int at91udc_probe(struct platform + } + + /* don't do anything until we have both gadget driver and VBUS */ ++ if (IS_ENABLED(CONFIG_COMMON_CLK)) { ++ clk_set_rate(udc->uclk, 48000000); ++ retval = clk_prepare(udc->uclk); ++ if (retval) ++ goto fail1; ++ } ++ retval = clk_prepare(udc->fclk); ++ if (retval) ++ goto fail1a; ++ + retval = clk_prepare_enable(udc->iclk); + if (retval) +- goto fail1; ++ goto fail1b; + at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); + at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff); + /* Clear all pending interrupts - UDP may be used by bootloader. */ + at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff); +- clk_disable_unprepare(udc->iclk); ++ clk_disable(udc->iclk); + + /* request UDC and maybe VBUS irqs */ + udc->udp_irq = platform_get_irq(pdev, 0); +@@ -1795,7 +1803,7 @@ static int at91udc_probe(struct platform + 0, driver_name, udc); + if (retval < 0) { + DBG("request irq %d failed\n", udc->udp_irq); +- goto fail1; ++ goto fail1c; + } + if (gpio_is_valid(udc->board.vbus_pin)) { + retval = gpio_request(udc->board.vbus_pin, "udc_vbus"); +@@ -1848,6 +1856,13 @@ fail3: + gpio_free(udc->board.vbus_pin); + fail2: + free_irq(udc->udp_irq, udc); ++fail1c: ++ clk_unprepare(udc->iclk); ++fail1b: ++ clk_unprepare(udc->fclk); ++fail1a: ++ if (IS_ENABLED(CONFIG_COMMON_CLK)) ++ clk_unprepare(udc->uclk); + fail1: + if (IS_ENABLED(CONFIG_COMMON_CLK) && !IS_ERR(udc->uclk)) + clk_put(udc->uclk); +@@ -1896,6 +1911,11 @@ static int __exit at91udc_remove(struct + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(res->start, resource_size(res)); + ++ if (IS_ENABLED(CONFIG_COMMON_CLK)) ++ clk_unprepare(udc->uclk); ++ clk_unprepare(udc->fclk); ++ clk_unprepare(udc->iclk); ++ + clk_put(udc->iclk); + clk_put(udc->fclk); + if (IS_ENABLED(CONFIG_COMMON_CLK)) diff --git a/queue-3.18/usb-qcserial-add-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch b/queue-3.18/usb-qcserial-add-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch new file mode 100644 index 00000000000..a721e3ae2b2 --- /dev/null +++ b/queue-3.18/usb-qcserial-add-support-for-hp-lt4112-lte-hspa-gobi-4g-modem.patch @@ -0,0 +1,82 @@ +From e7181d005e84b15fe3121a8d22840adc3395d496 Mon Sep 17 00:00:00 2001 +From: Martin Hauke +Date: Sun, 16 Nov 2014 21:17:30 +0100 +Subject: USB: qcserial: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem + +From: Martin Hauke + +commit e7181d005e84b15fe3121a8d22840adc3395d496 upstream. + +Added new device layout "DEVICE_HWI" and also added the USB VID/PID for the +HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) + +Signed-off-by: Martin Hauke +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/qcserial.c | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -27,12 +27,15 @@ enum qcserial_layouts { + QCSERIAL_G2K = 0, /* Gobi 2000 */ + QCSERIAL_G1K = 1, /* Gobi 1000 */ + QCSERIAL_SWI = 2, /* Sierra Wireless */ ++ QCSERIAL_HWI = 3, /* Huawei */ + }; + + #define DEVICE_G1K(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_G1K + #define DEVICE_SWI(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI ++#define DEVICE_HWI(v, p) \ ++ USB_DEVICE(v, p), .driver_info = QCSERIAL_HWI + + static const struct usb_device_id id_table[] = { + /* Gobi 1000 devices */ +@@ -157,6 +160,9 @@ static const struct usb_device_id id_tab + {DEVICE_SWI(0x413c, 0x81a8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */ + {DEVICE_SWI(0x413c, 0x81a9)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ + ++ /* Huawei devices */ ++ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ ++ + { } /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(usb, id_table); +@@ -283,6 +289,33 @@ static int qcprobe(struct usb_serial *se + break; + default: + /* don't claim any unsupported interface */ ++ altsetting = -1; ++ break; ++ } ++ break; ++ case QCSERIAL_HWI: ++ /* ++ * Huawei layout: ++ * 0: AT-capable modem port ++ * 1: DM/DIAG ++ * 2: AT-capable modem port ++ * 3: CCID-compatible PCSC interface ++ * 4: QMI/net ++ * 5: NMEA ++ */ ++ switch (ifnum) { ++ case 0: ++ case 2: ++ dev_dbg(dev, "Modem port found\n"); ++ break; ++ case 1: ++ dev_dbg(dev, "DM/DIAG interface found\n"); ++ break; ++ case 5: ++ dev_dbg(dev, "NMEA GPS interface found\n"); ++ break; ++ default: ++ /* don't claim any unsupported interface */ + altsetting = -1; + break; + } diff --git a/queue-3.18/usb-renesas_usbhs-gadget-fix-null-pointer-dereference-in-ep_disable.patch b/queue-3.18/usb-renesas_usbhs-gadget-fix-null-pointer-dereference-in-ep_disable.patch new file mode 100644 index 00000000000..a6b6118b7ff --- /dev/null +++ b/queue-3.18/usb-renesas_usbhs-gadget-fix-null-pointer-dereference-in-ep_disable.patch @@ -0,0 +1,38 @@ +From 11432050f070810ba139d0226344eef120c3a559 Mon Sep 17 00:00:00 2001 +From: Kazuya Mizuguchi +Date: Tue, 4 Nov 2014 10:05:42 +0900 +Subject: usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable() + +From: Kazuya Mizuguchi + +commit 11432050f070810ba139d0226344eef120c3a559 upstream. + +This patch fixes an issue that the NULL pointer dereference happens +when we uses g_audio driver. Since the g_audio driver will call +usb_ep_disable() in afunc_set_alt() before it calls usb_ep_enable(), +the uep->pipe of renesas usbhs driver will be NULL. So, this patch +adds a condition to avoid the oops. + +Signed-off-by: Kazuya Mizuguchi +Signed-off-by: Takeshi Kihara +Signed-off-by: Yoshihiro Shimoda +Fixes: 2f98382dc (usb: renesas_usbhs: Add Renesas USBHS Gadget) +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/renesas_usbhs/mod_gadget.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/renesas_usbhs/mod_gadget.c ++++ b/drivers/usb/renesas_usbhs/mod_gadget.c +@@ -602,6 +602,9 @@ static int usbhsg_ep_disable(struct usb_ + struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); + struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); + ++ if (!pipe) ++ return -EINVAL; ++ + usbhsg_pipe_disable(uep); + usbhs_pipe_free(pipe); +