From: Greg Kroah-Hartman Date: Thu, 29 Nov 2012 21:37:30 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.6.9~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c274b5d496c4110438f464f65593afd381ddfb32;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: bas_gigaset-fix-pre_reset-handling.patch scsi-silence-unnecessary-warnings-about-ioctl-to-partition.patch --- diff --git a/queue-3.4/bas_gigaset-fix-pre_reset-handling.patch b/queue-3.4/bas_gigaset-fix-pre_reset-handling.patch new file mode 100644 index 00000000000..ff3a670d1ec --- /dev/null +++ b/queue-3.4/bas_gigaset-fix-pre_reset-handling.patch @@ -0,0 +1,68 @@ +From c6fdd8e5d0c65bb8821dc6da26ee1a2ddd58b3cc Mon Sep 17 00:00:00 2001 +From: Tilman Schmidt +Date: Wed, 24 Oct 2012 08:44:32 +0000 +Subject: bas_gigaset: fix pre_reset handling + +From: Tilman Schmidt + +commit c6fdd8e5d0c65bb8821dc6da26ee1a2ddd58b3cc upstream. + +The delayed work function int_in_work() may call usb_reset_device() +and thus, indirectly, the driver's pre_reset method. Trying to +cancel the work synchronously in that situation would deadlock. +Fix by avoiding cancel_work_sync() in the pre_reset method. + +If the reset was NOT initiated by int_in_work() this might cause +int_in_work() to run after the post_reset method, with urb_int_in +already resubmitted, so handle that case gracefully. + +Signed-off-by: Tilman Schmidt +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/isdn/gigaset/bas-gigaset.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +--- a/drivers/isdn/gigaset/bas-gigaset.c ++++ b/drivers/isdn/gigaset/bas-gigaset.c +@@ -616,7 +616,13 @@ static void int_in_work(struct work_stru + if (rc == 0) + /* success, resubmit interrupt read URB */ + rc = usb_submit_urb(urb, GFP_ATOMIC); +- if (rc != 0 && rc != -ENODEV) { ++ ++ switch (rc) { ++ case 0: /* success */ ++ case -ENODEV: /* device gone */ ++ case -EINVAL: /* URB already resubmitted, or terminal badness */ ++ break; ++ default: /* failure: try to recover by resetting the device */ + dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc)); + rc = usb_lock_device_for_reset(ucs->udev, ucs->interface); + if (rc == 0) { +@@ -2437,7 +2443,9 @@ static void gigaset_disconnect(struct us + } + + /* gigaset_suspend +- * This function is called before the USB connection is suspended. ++ * This function is called before the USB connection is suspended ++ * or before the USB device is reset. ++ * In the latter case, message == PMSG_ON. + */ + static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) + { +@@ -2493,7 +2501,12 @@ static int gigaset_suspend(struct usb_in + del_timer_sync(&ucs->timer_atrdy); + del_timer_sync(&ucs->timer_cmd_in); + del_timer_sync(&ucs->timer_int_in); +- cancel_work_sync(&ucs->int_in_wq); ++ ++ /* don't try to cancel int_in_wq from within reset as it ++ * might be the one requesting the reset ++ */ ++ if (message.event != PM_EVENT_ON) ++ cancel_work_sync(&ucs->int_in_wq); + + gig_dbg(DEBUG_SUSPEND, "suspend complete"); + return 0; diff --git a/queue-3.4/scsi-silence-unnecessary-warnings-about-ioctl-to-partition.patch b/queue-3.4/scsi-silence-unnecessary-warnings-about-ioctl-to-partition.patch new file mode 100644 index 00000000000..32b4bb33dc0 --- /dev/null +++ b/queue-3.4/scsi-silence-unnecessary-warnings-about-ioctl-to-partition.patch @@ -0,0 +1,50 @@ +From 6d9359280753d2955f86d6411047516a9431eb51 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 15 Jun 2012 12:52:46 +0200 +Subject: scsi: Silence unnecessary warnings about ioctl to partition + +From: Jan Kara + +commit 6d9359280753d2955f86d6411047516a9431eb51 upstream. + +Sometimes, warnings about ioctls to partition happen often enough that they +form majority of the warnings in the kernel log and users complain. In some +cases warnings are about ioctls such as SG_IO so it's not good to get rid of +the warnings completely as they can ease debugging of userspace problems +when ioctl is refused. + +Since I have seen warnings from lots of commands, including some proprietary +userspace applications, I don't think disallowing the ioctls for processes +with CAP_SYS_RAWIO will happen in the near future if ever. So lets just +stop warning for processes with CAP_SYS_RAWIO for which ioctl is allowed. + +Acked-by: Paolo Bonzini +CC: Paolo Bonzini +CC: James Bottomley +Signed-off-by: Jan Kara +Signed-off-by: Jens Axboe +Cc: satoru takeuchi +Signed-off-by: Greg Kroah-Hartman + +--- + block/scsi_ioctl.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/block/scsi_ioctl.c ++++ b/block/scsi_ioctl.c +@@ -721,11 +721,14 @@ int scsi_verify_blk_ioctl(struct block_d + break; + } + ++ if (capable(CAP_SYS_RAWIO)) ++ return 0; ++ + /* In particular, rule out all resets and host-specific ioctls. */ + printk_ratelimited(KERN_WARNING + "%s: sending ioctl %x to a partition!\n", current->comm, cmd); + +- return capable(CAP_SYS_RAWIO) ? 0 : -ENOIOCTLCMD; ++ return -ENOIOCTLCMD; + } + EXPORT_SYMBOL(scsi_verify_blk_ioctl); + diff --git a/queue-3.4/series b/queue-3.4/series index f60b5f472ec..f8399b3daa0 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -36,3 +36,5 @@ pm-qos-fix-wrong-error-checking-condition.patch alsa-hda-add-new-codec-alc283-alc290-support.patch alsa-hda-fix-missing-beep-on-asus-x43u-notebook.patch alsa-hda-add-support-for-realtek-alc292.patch +bas_gigaset-fix-pre_reset-handling.patch +scsi-silence-unnecessary-warnings-about-ioctl-to-partition.patch