From: Seth Forshee <seth.forshee@canonical.com>
To: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
linux-kernel@vger.kernel.org
Subject: [PATCH] usb_storage: make usb-stor-scan task non-freezable
Date: Mon, 18 Jul 2011 11:28:18 -0500 [thread overview]
Message-ID: <20110718162818.GC19552@thinkpad-t410> (raw)
The following patch is in response to a consistently reproducible
failure to freeze tasks prior to restoring a hibernation image on a
Toshiba NB505 netbook. This machine has a built-in USB card reader.
Since the usb-stor-scan task is freezable but the code in
quiesce_and_remove_host() that waits for scanning to complete is not,
khubd can fail to freeze when processing the disconnect for the card
reader.
It seems that both should either be freezable or not freezable. Since
there doesn't currently seem to be any freezable way to wait on a
completion, I started with the simpler approach of making usb-stor-scan
non-freezable. If it would be preferable to make both freezable I can
take that approach instead.
Thanks,
Seth
>From 27e456c0d6512ba599f7560139555374a45342be Mon Sep 17 00:00:00 2001
From: Seth Forshee <seth.forshee@canonical.com>
Date: Wed, 13 Jul 2011 23:02:48 -0500
Subject: [PATCH] usb_storage: make usb-stor-scan task non-freezable
The usb-stor-scan task is freezable, but the code in
quiesce_and_remove_host() that waits for scanning to complete is
not. This can cause task freezing to fail, which is happening
consistently on at least one model of netbook with a built-in USB
card reader when freezing tasks prior to restoring a hibernation
image.
This patch makes the usb-stor-scan task non-freezable to prevent
this from happening. Tested across 200 S4 cycles without a single
failure to freeze tasks.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
drivers/usb/storage/usb.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 0ca0958..f59fc90 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -831,12 +831,11 @@ static int usb_stor_scan_thread(void * __us)
dev_dbg(dev, "device found\n");
- set_freezable();
/* Wait for the timeout to expire or for a disconnect */
if (delay_use > 0) {
dev_dbg(dev, "waiting for device to settle "
"before scanning\n");
- wait_event_freezable_timeout(us->delay_wait,
+ wait_event_interruptible_timeout(us->delay_wait,
test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
delay_use * HZ);
}
--
1.7.4.1
next reply other threads:[~2011-07-18 16:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 16:28 Seth Forshee [this message]
2011-07-18 21:12 ` Alan Stern
2011-07-18 22:44 ` Seth Forshee
2011-07-19 14:26 ` Alan Stern
2011-07-19 17:21 ` Seth Forshee
2011-07-23 21:08 ` Seth Forshee
2011-07-24 1:56 ` Alan Stern
2011-07-26 13:33 ` Seth Forshee
2011-07-26 14:21 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110718162818.GC19552@thinkpad-t410 \
--to=seth.forshee@canonical.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome