From: Greg Kroah-Hartman Date: Mon, 18 Nov 2013 18:32:15 +0000 (-0800) Subject: 3.12-stable patches X-Git-Tag: v3.4.70~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93dbdf2f3942d914cf351fed1395bd599d215a89;p=thirdparty%2Fkernel%2Fstable-queue.git 3.12-stable patches added patches: backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch misc-atmel_pwm-add-deferred-probing-support.patch usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch --- diff --git a/queue-3.12/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch b/queue-3.12/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch new file mode 100644 index 00000000000..8e305914064 --- /dev/null +++ b/queue-3.12/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.12/misc-atmel_pwm-add-deferred-probing-support.patch b/queue-3.12/misc-atmel_pwm-add-deferred-probing-support.patch new file mode 100644 index 00000000000..f5184480248 --- /dev/null +++ b/queue-3.12/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.12/series b/queue-3.12/series index b8c9dd282c3..fe779db3855 100644 --- a/queue-3.12/series +++ b/queue-3.12/series @@ -14,3 +14,6 @@ hyperv-fb-add-pci-stub.patch usb-add-new-zte-3g-dongle-s-pid-to-option.c.patch alsa-hda-hdmi-fix-reported-channel-map-on-common-default-layouts.patch tracing-fix-potential-out-of-bounds-in-trace_get_user.patch +misc-atmel_pwm-add-deferred-probing-support.patch +backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch +usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch diff --git a/queue-3.12/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch b/queue-3.12/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch new file mode 100644 index 00000000000..ca1278bc3a7 --- /dev/null +++ b/queue-3.12/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 +@@ -1033,6 +1033,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);