From: Greg Kroah-Hartman Date: Tue, 31 Jan 2012 19:24:00 +0000 (-0800) Subject: 3.0-stable patches X-Git-Tag: v3.0.19~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a171ef9bc709e5de71493cc9a3805ea63d8ebd24;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: hwmon-f71805f-fix-clamping-of-temperature-limits.patch hwmon-sht15-fix-bad-error-code.patch hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch usb-cdc-wdm-avoid-hanging-on-interface-with-no-usb_cdc_dmm_type.patch usb-cdc-wdm-better-allocate-a-buffer-that-is-at-least-as-big-as-we-tell-the-usb-core.patch usb-cdc-wdm-call-wake_up_all-to-allow-driver-to-shutdown-on-device-removal.patch --- diff --git a/queue-3.0/hwmon-f71805f-fix-clamping-of-temperature-limits.patch b/queue-3.0/hwmon-f71805f-fix-clamping-of-temperature-limits.patch new file mode 100644 index 00000000000..f94f5032a59 --- /dev/null +++ b/queue-3.0/hwmon-f71805f-fix-clamping-of-temperature-limits.patch @@ -0,0 +1,41 @@ +From 86b2bbfdbd1fcc4a3aa62ccd3f245c40c5ad5b85 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Fri, 20 Jan 2012 10:09:23 -0500 +Subject: hwmon: (f71805f) Fix clamping of temperature limits + +From: Jean Delvare + +commit 86b2bbfdbd1fcc4a3aa62ccd3f245c40c5ad5b85 upstream. + +Properly clamp temperature limits set by the user. Without this fix, +attempts to write temperature limits above the maximum supported by +the chip (255 degrees Celsius) would arbitrarily and unexpectedly +result in the limit being set to 0 degree Celsius. + +Signed-off-by: Jean Delvare +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/f71805f.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/hwmon/f71805f.c ++++ b/drivers/hwmon/f71805f.c +@@ -283,11 +283,11 @@ static inline long temp_from_reg(u8 reg) + + static inline u8 temp_to_reg(long val) + { +- if (val < 0) +- val = 0; +- else if (val > 1000 * 0xff) +- val = 0xff; +- return ((val + 500) / 1000); ++ if (val <= 0) ++ return 0; ++ if (val >= 1000 * 0xff) ++ return 0xff; ++ return (val + 500) / 1000; + } + + /* diff --git a/queue-3.0/hwmon-sht15-fix-bad-error-code.patch b/queue-3.0/hwmon-sht15-fix-bad-error-code.patch new file mode 100644 index 00000000000..07acd44ea55 --- /dev/null +++ b/queue-3.0/hwmon-sht15-fix-bad-error-code.patch @@ -0,0 +1,38 @@ +From 6edf3c30af01854c416f8654d3d5d2652470afd4 Mon Sep 17 00:00:00 2001 +From: Vivien Didelot +Date: Thu, 26 Jan 2012 15:59:00 -0500 +Subject: hwmon: (sht15) fix bad error code + +From: Vivien Didelot + +commit 6edf3c30af01854c416f8654d3d5d2652470afd4 upstream. + +When no platform data was supplied, returned error code was 0. + +Signed-off-by: Vivien Didelot +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/sht15.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/hwmon/sht15.c ++++ b/drivers/hwmon/sht15.c +@@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(stru + + static int __devinit sht15_probe(struct platform_device *pdev) + { +- int ret = 0; ++ int ret; + struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL); + u8 status = 0; + +@@ -901,6 +901,7 @@ static int __devinit sht15_probe(struct + init_waitqueue_head(&data->wait_queue); + + if (pdev->dev.platform_data == NULL) { ++ ret = -EINVAL; + dev_err(&pdev->dev, "no platform data supplied\n"); + goto err_free_data; + } diff --git a/queue-3.0/hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch b/queue-3.0/hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch new file mode 100644 index 00000000000..deced5eca33 --- /dev/null +++ b/queue-3.0/hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch @@ -0,0 +1,43 @@ +From ad77c3e1808f07fa70f707b1c92a683b7c7d3f85 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Fri, 27 Jan 2012 17:56:06 -0800 +Subject: hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F + +From: Guenter Roeck + +commit ad77c3e1808f07fa70f707b1c92a683b7c7d3f85 upstream. + +NCT6776F only supports pwm mode for pwm2 and pwm3. Return error if an attempt +is made to set those pwm channels to DC mode. + +Signed-off-by: Guenter Roeck +Acked-by: Jean Delvare +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/w83627ehf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/hwmon/w83627ehf.c ++++ b/drivers/hwmon/w83627ehf.c +@@ -1295,6 +1295,7 @@ store_pwm_mode(struct device *dev, struc + { + struct w83627ehf_data *data = dev_get_drvdata(dev); + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ struct w83627ehf_sio_data *sio_data = dev->platform_data; + int nr = sensor_attr->index; + unsigned long val; + int err; +@@ -1306,6 +1307,11 @@ store_pwm_mode(struct device *dev, struc + + if (val > 1) + return -EINVAL; ++ ++ /* On NCT67766F, DC mode is only supported for pwm1 */ ++ if (sio_data->kind == nct6776 && nr && val != 1) ++ return -EINVAL; ++ + mutex_lock(&data->update_lock); + reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]); + data->pwm_mode[nr] = val; diff --git a/queue-3.0/series b/queue-3.0/series index e36c878272c..15c225b457e 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -40,3 +40,9 @@ usb-usbsevseg-fix-max-length.patch drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch xhci-fix-usb-3.0-device-restart-on-resume.patch xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch +hwmon-f71805f-fix-clamping-of-temperature-limits.patch +hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch +hwmon-sht15-fix-bad-error-code.patch +usb-cdc-wdm-call-wake_up_all-to-allow-driver-to-shutdown-on-device-removal.patch +usb-cdc-wdm-better-allocate-a-buffer-that-is-at-least-as-big-as-we-tell-the-usb-core.patch +usb-cdc-wdm-avoid-hanging-on-interface-with-no-usb_cdc_dmm_type.patch diff --git a/queue-3.0/usb-cdc-wdm-avoid-hanging-on-interface-with-no-usb_cdc_dmm_type.patch b/queue-3.0/usb-cdc-wdm-avoid-hanging-on-interface-with-no-usb_cdc_dmm_type.patch new file mode 100644 index 00000000000..03ad29035dd --- /dev/null +++ b/queue-3.0/usb-cdc-wdm-avoid-hanging-on-interface-with-no-usb_cdc_dmm_type.patch @@ -0,0 +1,50 @@ +From 15699e6fafc3a90e5fdc2ef30555a04dee62286f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Fri, 20 Jan 2012 01:49:57 +0100 +Subject: USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 15699e6fafc3a90e5fdc2ef30555a04dee62286f upstream. + +The probe does not strictly require the USB_CDC_DMM_TYPE +descriptor, which is a good thing as it makes the driver +usable on non-conforming interfaces. A user could e.g. +bind to it to a CDC ECM interface by using the new_id and +bind sysfs files. But this would fail with a 0 buffer length +due to the missing descriptor. + +Fix by defining a reasonable fallback size: The minimum +device receive buffer size required by the CDC WMC standard, +revision 1.1 + +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -57,6 +57,8 @@ MODULE_DEVICE_TABLE (usb, wdm_ids); + + #define WDM_MAX 16 + ++/* CDC-WMC r1.1 requires wMaxCommand to be "at least 256 decimal (0x100)" */ ++#define WDM_DEFAULT_BUFSIZE 256 + + static DEFINE_MUTEX(wdm_mutex); + +@@ -636,7 +638,7 @@ static int wdm_probe(struct usb_interfac + struct usb_cdc_dmm_desc *dmhd; + u8 *buffer = intf->altsetting->extra; + int buflen = intf->altsetting->extralen; +- u16 maxcom = 0; ++ u16 maxcom = WDM_DEFAULT_BUFSIZE; + + if (!buffer) + goto out; diff --git a/queue-3.0/usb-cdc-wdm-better-allocate-a-buffer-that-is-at-least-as-big-as-we-tell-the-usb-core.patch b/queue-3.0/usb-cdc-wdm-better-allocate-a-buffer-that-is-at-least-as-big-as-we-tell-the-usb-core.patch new file mode 100644 index 00000000000..7ac6fcaf6b5 --- /dev/null +++ b/queue-3.0/usb-cdc-wdm-better-allocate-a-buffer-that-is-at-least-as-big-as-we-tell-the-usb-core.patch @@ -0,0 +1,35 @@ +From 655e247daf52b202a6c2d0f8a06dd2051e756ce4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 16 Jan 2012 15:11:59 +0100 +Subject: USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 655e247daf52b202a6c2d0f8a06dd2051e756ce4 upstream. + +As it turns out, there was a mismatch between the allocated inbuf size +(desc->bMaxPacketSize0, typically something like 64) and the length we +specified in the URB (desc->wMaxCommand, typically something like 2048) + +Signed-off-by: Bjørn Mork +Cc: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -723,7 +723,7 @@ next_desc: + goto err; + + desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf), +- desc->bMaxPacketSize0, ++ desc->wMaxCommand, + GFP_KERNEL, + &desc->response->transfer_dma); + if (!desc->inbuf) diff --git a/queue-3.0/usb-cdc-wdm-call-wake_up_all-to-allow-driver-to-shutdown-on-device-removal.patch b/queue-3.0/usb-cdc-wdm-call-wake_up_all-to-allow-driver-to-shutdown-on-device-removal.patch new file mode 100644 index 00000000000..a1a1dfe4075 --- /dev/null +++ b/queue-3.0/usb-cdc-wdm-call-wake_up_all-to-allow-driver-to-shutdown-on-device-removal.patch @@ -0,0 +1,42 @@ +From 62aaf24dc125d7c55c93e313d15611f152b030c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 16 Jan 2012 15:11:57 +0100 +Subject: USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 62aaf24dc125d7c55c93e313d15611f152b030c7 upstream. + +wdm_disconnect() waits for the mutex held by wdm_read() before +calling wake_up_all(). This causes a deadlock, preventing device removal +to complete. Do the wake_up_all() before we start waiting for the locks. + +Signed-off-by: Bjørn Mork +Cc: Oliver Neukum +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -786,13 +786,13 @@ static void wdm_disconnect(struct usb_in + /* to terminate pending flushes */ + clear_bit(WDM_IN_USE, &desc->flags); + spin_unlock_irqrestore(&desc->iuspin, flags); ++ wake_up_all(&desc->wait); + mutex_lock(&desc->rlock); + mutex_lock(&desc->wlock); + kill_urbs(desc); + cancel_work_sync(&desc->rxwork); + mutex_unlock(&desc->wlock); + mutex_unlock(&desc->rlock); +- wake_up_all(&desc->wait); + if (!desc->count) + cleanup(desc); + mutex_unlock(&wdm_mutex);