]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Nov 2013 18:32:07 +0000 (10:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Nov 2013 18:32:07 +0000 (10:32 -0800)
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

queue-3.10/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch [new file with mode: 0644]
queue-3.10/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch [new file with mode: 0644]
queue-3.10/misc-atmel_pwm-add-deferred-probing-support.patch [new file with mode: 0644]
queue-3.10/series
queue-3.10/usb-fail-on-usb_hub_create_port_device-errors.patch [new file with mode: 0644]
queue-3.10/usb-fix-cleanup-after-failure-in-hub_configure.patch [new file with mode: 0644]
queue-3.10/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch [new file with mode: 0644]

diff --git a/queue-3.10/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch b/queue-3.10/backlight-atmel-pwm-bl-fix-deferred-probe-from-__init.patch
new file mode 100644 (file)
index 0000000..3717187
--- /dev/null
@@ -0,0 +1,59 @@
+From 9d3fde86b15303decea632c929fbf1f3ae4501f2 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 23 Sep 2013 16:27:32 +0200
+Subject: backlight: atmel-pwm-bl: fix deferred probe from __init
+
+From: Johan Hovold <jhovold@gmail.com>
+
+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 <rpurdie@rpsys.net>
+Cc: Jingoo Han <jg1.han@samsung.com>
+Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+@@ -203,7 +203,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);
+@@ -222,10 +222,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 <hans-christian.egtvedt@atmel.com>");
+ MODULE_DESCRIPTION("Atmel PWM backlight driver");
diff --git a/queue-3.10/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch b/queue-3.10/media-sh_vou-almost-forever-loop-in-sh_vou_try_fmt_vid_out.patch
new file mode 100644 (file)
index 0000000..063a409
--- /dev/null
@@ -0,0 +1,32 @@
+From 47c32ec9392a1fc7dec9d7cfde084e1432fcee82 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+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 <dan.carpenter@oracle.com>
+
+commit 47c32ec9392a1fc7dec9d7cfde084e1432fcee82 upstream.
+
+The "i < " part of the "i < ARRAY_SIZE()" condition was missing.
+
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+[g.liakhovetski@gmx.de: remove unrelated superfluous braces]
+Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.10/misc-atmel_pwm-add-deferred-probing-support.patch b/queue-3.10/misc-atmel_pwm-add-deferred-probing-support.patch
new file mode 100644 (file)
index 0000000..f518448
--- /dev/null
@@ -0,0 +1,39 @@
+From 5c6d6fd1564138ad048564e48639f842714a90c6 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Tue, 22 Oct 2013 18:32:39 +0200
+Subject: misc: atmel_pwm: add deferred-probing support
+
+From: Johan Hovold <jhovold@gmail.com>
+
+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 <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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)
index 18c3b5fc702be128e90cc915b1545e6aa9d98739..a188d1546463d49f4c13abf869e9a09c891acb92 100644 (file)
@@ -16,3 +16,9 @@ tracing-fix-potential-out-of-bounds-in-trace_get_user.patch
 perf-fix-perf-ring-buffer-memory-ordering.patch
 iwlwifi-add-new-7260-and-3160-series-device-ids.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.10/usb-fail-on-usb_hub_create_port_device-errors.patch b/queue-3.10/usb-fail-on-usb_hub_create_port_device-errors.patch
new file mode 100644 (file)
index 0000000..3db1873
--- /dev/null
@@ -0,0 +1,49 @@
+From e58547eb9561a8a72d46e2d411090a614d33ac0e Mon Sep 17 00:00:00 2001
+From: Krzysztof Mazur <krzysiek@podlesie.net>
+Date: Thu, 22 Aug 2013 14:49:39 +0200
+Subject: usb: fail on usb_hub_create_port_device() errors
+
+From: Krzysztof Mazur <krzysiek@podlesie.net>
+
+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 <krzysiek@podlesie.net>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.10/usb-fix-cleanup-after-failure-in-hub_configure.patch b/queue-3.10/usb-fix-cleanup-after-failure-in-hub_configure.patch
new file mode 100644 (file)
index 0000000..6064052
--- /dev/null
@@ -0,0 +1,34 @@
+From d0308d4b6b02597f39fc31a9bddf7bb3faad5622 Mon Sep 17 00:00:00 2001
+From: Krzysztof Mazur <krzysiek@podlesie.net>
+Date: Thu, 22 Aug 2013 14:49:38 +0200
+Subject: usb: fix cleanup after failure in hub_configure()
+
+From: Krzysztof Mazur <krzysiek@podlesie.net>
+
+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 <krzysiek@podlesie.net>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.10/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch b/queue-3.10/usbcore-set-lpm_capable-field-for-lpm-capable-root-hubs.patch
new file mode 100644 (file)
index 0000000..1f2a8aa
--- /dev/null
@@ -0,0 +1,65 @@
+From 9df89d85b407690afa46ddfbccc80bec6869971d Mon Sep 17 00:00:00 2001
+From: Xenia Ragiadakou <burzalodowa@gmail.com>
+Date: Sat, 31 Aug 2013 18:09:12 +0300
+Subject: usbcore: set lpm_capable field for LPM capable root hubs
+
+From: Xenia Ragiadakou <burzalodowa@gmail.com>
+
+commit 9df89d85b407690afa46ddfbccc80bec6869971d upstream.
+
+This patch sets the lpm_capable field for root hubs with LPM capabilities.
+
+Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
+Reported-by: Martin MOKREJS <mmokrejs@gmail.com>
+Suggested-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1010,6 +1010,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);