From: Greg Kroah-Hartman Date: Mon, 18 Nov 2013 18:32:12 +0000 (-0800) Subject: 3.11-stable patches X-Git-Tag: v3.4.70~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5db7ee1b29ee4c78c3d6d68901b01cb485ca0ba;p=thirdparty%2Fkernel%2Fstable-queue.git 3.11-stable patches added patches: backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch misc-atmel_pwm-add-deferred-probing-support.patch usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch usb-fail-on-usb_hub_create_port_device-errors.patch usb-fix-cleanup-after-failure-in-hub_configure.patch --- diff --git a/queue-3.11/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch b/queue-3.11/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch new file mode 100644 index 00000000000..8e305914064 --- /dev/null +++ b/queue-3.11/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch @@ -0,0 +1,59 @@ +From 9d3fde86b15303decea632c929fbf1f3ae4501f2 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Mon, 23 Sep 2013 16:27:32 +0200 +Subject: backlight: atmel-pwm-bl: fix deferred probe from __init + +From: Johan Hovold + +commit 9d3fde86b15303decea632c929fbf1f3ae4501f2 upstream. + +Move probe out of __init section and don't use platform_driver_probe +which cannot be used with deferred probing. + +Since commit e9354576 ("gpiolib: Defer failed gpio requests by default") +this driver might return -EPROBE_DEFER if a gpio_request fails. + +Cc: Richard Purdie +Cc: Jingoo Han +Cc: Jean-Christophe Plagniol-Villard +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/backlight/atmel-pwm-bl.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/video/backlight/atmel-pwm-bl.c ++++ b/drivers/video/backlight/atmel-pwm-bl.c +@@ -118,7 +118,7 @@ static const struct backlight_ops atmel_ + .update_status = atmel_pwm_bl_set_intensity, + }; + +-static int __init atmel_pwm_bl_probe(struct platform_device *pdev) ++static int atmel_pwm_bl_probe(struct platform_device *pdev) + { + struct backlight_properties props; + const struct atmel_pwm_bl_platform_data *pdata; +@@ -202,7 +202,7 @@ err_free_mem: + return retval; + } + +-static int __exit atmel_pwm_bl_remove(struct platform_device *pdev) ++static int atmel_pwm_bl_remove(struct platform_device *pdev) + { + struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); + +@@ -220,10 +220,11 @@ static struct platform_driver atmel_pwm_ + .name = "atmel-pwm-bl", + }, + /* REVISIT add suspend() and resume() */ +- .remove = __exit_p(atmel_pwm_bl_remove), ++ .probe = atmel_pwm_bl_probe, ++ .remove = atmel_pwm_bl_remove, + }; + +-module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe); ++module_platform_driver(atmel_pwm_bl_driver); + + MODULE_AUTHOR("Hans-Christian egtvedt "); + MODULE_DESCRIPTION("Atmel PWM backlight driver"); diff --git a/queue-3.11/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch b/queue-3.11/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch new file mode 100644 index 00000000000..063a4099e62 --- /dev/null +++ b/queue-3.11/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch @@ -0,0 +1,32 @@ +From 47c32ec9392a1fc7dec9d7cfde084e1432fcee82 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 23 Aug 2013 06:54:44 -0300 +Subject: media: sh_vou: almost forever loop in sh_vou_try_fmt_vid_out() + +From: Dan Carpenter + +commit 47c32ec9392a1fc7dec9d7cfde084e1432fcee82 upstream. + +The "i < " part of the "i < ARRAY_SIZE()" condition was missing. + +Signed-off-by: Dan Carpenter +[g.liakhovetski@gmx.de: remove unrelated superfluous braces] +Signed-off-by: Guennadi Liakhovetski +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/platform/sh_vou.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/platform/sh_vou.c ++++ b/drivers/media/platform/sh_vou.c +@@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct + v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1, + &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0); + +- for (i = 0; ARRAY_SIZE(vou_fmt); i++) ++ for (i = 0; i < ARRAY_SIZE(vou_fmt); i++) + if (vou_fmt[i].pfmt == pix->pixelformat) + return 0; + diff --git a/queue-3.11/misc-atmel_pwm-add-deferred-probing-support.patch b/queue-3.11/misc-atmel_pwm-add-deferred-probing-support.patch new file mode 100644 index 00000000000..f5184480248 --- /dev/null +++ b/queue-3.11/misc-atmel_pwm-add-deferred-probing-support.patch @@ -0,0 +1,39 @@ +From 5c6d6fd1564138ad048564e48639f842714a90c6 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 22 Oct 2013 18:32:39 +0200 +Subject: misc: atmel_pwm: add deferred-probing support + +From: Johan Hovold + +commit 5c6d6fd1564138ad048564e48639f842714a90c6 upstream. + +Two drivers (atmel-pwm-bl and leds-atmel-pwm) currently depend on the +atmel_pwm driver to have bound to any pwm-device before their devices +are probed. + +Support deferred probing of such devices by making sure to return +-EPROBE_DEFER from pwm_channel_alloc when no pwm-device has yet been +bound. + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/atmel_pwm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/misc/atmel_pwm.c ++++ b/drivers/misc/atmel_pwm.c +@@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct + unsigned long flags; + int status = 0; + +- /* insist on PWM init, with this signal pinned out */ +- if (!pwm || !(pwm->mask & 1 << index)) ++ if (!pwm) ++ return -EPROBE_DEFER; ++ ++ if (!(pwm->mask & 1 << index)) + return -ENODEV; + + if (index < 0 || index >= PWM_NCHAN || !ch) diff --git a/queue-3.11/series b/queue-3.11/series index 4f069598cd9..8ed81ce1c4c 100644 --- a/queue-3.11/series +++ b/queue-3.11/series @@ -17,3 +17,9 @@ tracing-fix-potential-out-of-bounds-in-trace_get_user.patch drm-i915-dp-workaround-bios-edp-bpp-clamping-issue.patch perf-fix-perf-ring-buffer-memory-ordering.patch iwlwifi-pcie-add-new-skus-for-7000-3160-nic-series.patch +misc-atmel_pwm-add-deferred-probing-support.patch +backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch +usb-fix-cleanup-after-failure-in-hub_configure.patch +usb-fail-on-usb_hub_create_port_device-errors.patch +usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch +media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch diff --git a/queue-3.11/usb-fail-on-usb_hub_create_port_device-errors.patch b/queue-3.11/usb-fail-on-usb_hub_create_port_device-errors.patch new file mode 100644 index 00000000000..3db18735529 --- /dev/null +++ b/queue-3.11/usb-fail-on-usb_hub_create_port_device-errors.patch @@ -0,0 +1,49 @@ +From e58547eb9561a8a72d46e2d411090a614d33ac0e Mon Sep 17 00:00:00 2001 +From: Krzysztof Mazur +Date: Thu, 22 Aug 2013 14:49:39 +0200 +Subject: usb: fail on usb_hub_create_port_device() errors + +From: Krzysztof Mazur + +commit e58547eb9561a8a72d46e2d411090a614d33ac0e upstream. + +Ignoring usb_hub_create_port_device() errors cause later NULL pointer +deference when uninitialized hub->ports[i] entries are dereferenced +after port memory allocation error. + +Signed-off-by: Krzysztof Mazur +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1557,10 +1557,15 @@ static int hub_configure(struct usb_hub + if (hub->has_indicators && blinkenlights) + hub->indicator [0] = INDICATOR_CYCLE; + +- for (i = 0; i < hdev->maxchild; i++) +- if (usb_hub_create_port_device(hub, i + 1) < 0) ++ for (i = 0; i < hdev->maxchild; i++) { ++ ret = usb_hub_create_port_device(hub, i + 1); ++ if (ret < 0) { + dev_err(hub->intfdev, + "couldn't create port%d device.\n", i + 1); ++ hdev->maxchild = i; ++ goto fail_keep_maxchild; ++ } ++ } + + usb_hub_adjust_deviceremovable(hdev, hub->descriptor); + +@@ -1569,6 +1574,7 @@ static int hub_configure(struct usb_hub + + fail: + hdev->maxchild = 0; ++fail_keep_maxchild: + dev_err (hub_dev, "config failed, %s (err %d)\n", + message, ret); + /* hub_disconnect() frees urb and descriptor */ diff --git a/queue-3.11/usb-fix-cleanup-after-failure-in-hub_configure.patch b/queue-3.11/usb-fix-cleanup-after-failure-in-hub_configure.patch new file mode 100644 index 00000000000..6064052c5cd --- /dev/null +++ b/queue-3.11/usb-fix-cleanup-after-failure-in-hub_configure.patch @@ -0,0 +1,34 @@ +From d0308d4b6b02597f39fc31a9bddf7bb3faad5622 Mon Sep 17 00:00:00 2001 +From: Krzysztof Mazur +Date: Thu, 22 Aug 2013 14:49:38 +0200 +Subject: usb: fix cleanup after failure in hub_configure() + +From: Krzysztof Mazur + +commit d0308d4b6b02597f39fc31a9bddf7bb3faad5622 upstream. + +If the hub_configure() fails after setting the hdev->maxchild +the hub->ports might be NULL or point to uninitialized kzallocated +memory causing NULL pointer dereference in hub_quiesce() during cleanup. + +Now after such error the hdev->maxchild is set to 0 to avoid cleanup +of uninitialized ports. + +Signed-off-by: Krzysztof Mazur +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1568,6 +1568,7 @@ static int hub_configure(struct usb_hub + return 0; + + fail: ++ hdev->maxchild = 0; + dev_err (hub_dev, "config failed, %s (err %d)\n", + message, ret); + /* hub_disconnect() frees urb and descriptor */ diff --git a/queue-3.11/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch b/queue-3.11/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch new file mode 100644 index 00000000000..6288f4d6e90 --- /dev/null +++ b/queue-3.11/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch @@ -0,0 +1,65 @@ +From 9df89d85b407690afa46ddfbccc80bec6869971d Mon Sep 17 00:00:00 2001 +From: Xenia Ragiadakou +Date: Sat, 31 Aug 2013 18:09:12 +0300 +Subject: usbcore: set lpm_capable field for LPM capable root hubs + +From: Xenia Ragiadakou + +commit 9df89d85b407690afa46ddfbccc80bec6869971d upstream. + +This patch sets the lpm_capable field for root hubs with LPM capabilities. + +Signed-off-by: Xenia Ragiadakou +Reported-by: Martin MOKREJS +Suggested-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hcd.c | 1 + + drivers/usb/core/hub.c | 7 ++++++- + drivers/usb/core/usb.h | 1 + + 3 files changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1035,6 +1035,7 @@ static int register_root_hub(struct usb_ + dev_name(&usb_dev->dev), retval); + return retval; + } ++ usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev); + } + + retval = usb_new_device (usb_dev); +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(st + return usb_get_intfdata(hdev->actconfig->interface[0]); + } + +-static int usb_device_supports_lpm(struct usb_device *udev) ++int usb_device_supports_lpm(struct usb_device *udev) + { + /* USB 2.1 (and greater) devices indicate LPM support through + * their USB 2.0 Extended Capabilities BOS descriptor. +@@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struc + "Power management will be impacted.\n"); + return 0; + } ++ ++ /* udev is root hub */ ++ if (!udev->parent) ++ return 1; ++ + if (udev->parent->lpm_capable) + return 1; + +--- a/drivers/usb/core/usb.h ++++ b/drivers/usb/core/usb.h +@@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(str + unsigned int size); + extern int usb_get_bos_descriptor(struct usb_device *dev); + extern void usb_release_bos_descriptor(struct usb_device *dev); ++extern int usb_device_supports_lpm(struct usb_device *udev); + extern char *usb_cache_string(struct usb_device *udev, int index); + extern int usb_set_configuration(struct usb_device *dev, int configuration); + extern int usb_choose_configuration(struct usb_device *udev);