From: Al Cho <acho@novell.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
yiyingc@ene.com.tw, Al Cho <acho@novell.com>
Subject: [PATCH] staging/keucr: fix keucr lost disconnect
Date: Thu, 16 Sep 2010 11:51:48 +0800 [thread overview]
Message-ID: <1284609108-11103-1-git-send-email-acho@novell.com> (raw)
keucr lost the disconnect,
so keucr crash when plug-in and then plug-out SD-card quickly.
unmark the part of usb disconnect
Signed-off-by: Al Cho <acho@novell.com>
---
drivers/staging/keucr/usb.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
index d7dab72..9d74722 100644
--- a/drivers/staging/keucr/usb.c
+++ b/drivers/staging/keucr/usb.c
@@ -21,6 +21,8 @@ MODULE_AUTHOR("Domao");
MODULE_DESCRIPTION("ENE USB Mass Storage driver for Linux");
MODULE_LICENSE("GPL");
+static unsigned int delay_use = 1;
+
static struct usb_device_id eucr_usb_ids [] = {
{ USB_DEVICE(0x058f, 0x6366) },
{ USB_DEVICE(0x0cf2, 0x6230) },
@@ -172,11 +174,10 @@ static int usb_stor_control_thread(void * __us)
mutex_lock(&(us->dev_mutex));
/* if the device has disconnected, we are free to exit */
-/* if (test_bit(US_FLIDX_DISCONNECTING, &us->flags))
- {
+ if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
mutex_unlock(&us->dev_mutex);
break;
- }*/
+ }
/* lock access to the state */
scsi_lock(host);
@@ -542,15 +543,13 @@ static int usb_stor_scan_thread(void * __us)
printk("usb --- usb_stor_scan_thread\n");
printk("EUCR : device found at %d\n", us->pusb_dev->devnum);
-// Have we to add this code ?
-// set_freezable();
-// /* Wait for the timeout to expire or for a disconnect */
-// if (delay_use > 0)
-// {
-// wait_event_freezable_timeout(us->delay_wait,
-// test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
-// delay_use * HZ);
-// }
+ set_freezable();
+ /* Wait for the timeout to expire or for a disconnect */
+ if (delay_use > 0) {
+ wait_event_freezable_timeout(us->delay_wait,
+ test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
+ delay_use * HZ);
+ }
/* If the device is still connected, perform the scanning */
if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags))
--
1.7.1
next reply other threads:[~2010-09-16 3:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 3:51 Al Cho [this message]
2010-09-16 19:33 ` Greg KH
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=1284609108-11103-1-git-send-email-acho@novell.com \
--to=acho@novell.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=yiyingc@ene.com.tw \
/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
all inboxes | Powered by JetHome®