public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Bammer <mrbm74@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: usb-storage: Wait less time for settling when a memory device is connected
Date: Fri, 06 Mar 2009 11:34:07 +0100	[thread overview]
Message-ID: <1236335647.16732.12.camel@localhost> (raw)

Hi,

I was wondering why the usb-storage driver waits for my usb-stick and my
sdhc-card 5s before scanning. IMHO this is only needed for HDs. I've
created a patch for the driver which shortens the timeout to 1s when a
memory device is detected.
But I'm not shure if the detection code is right for all devices. This
maybe has to be tested and discussed.
I've tested it with a usb-stick, a sdhc-card and a usb-harddrive.
This patch is created for kernel 2.6.27.18.

Please CC me for answers to this thread.

--- a/drivers/usb/storage/usb.c 2009-03-03 23:33:37.000000000 +0100
+++ b/drivers/usb/storage/usb.c 2009-03-03 23:32:44.000000000 +0100
@@ -913,10 +913,16 @@ static int usb_stor_scan_thread(void * _
 
        set_freezable();
 
+       /* Shorten delay time for memory sticks/cards */
+       if ((1 == us->pusb_dev->descriptor.iManufacturer)
+           && (2 == us->pusb_dev->descriptor.iProduct)
+           && (3 == us->pusb_dev->descriptor.iSerialNumber)
+           && (delay_use > 0)) delay_use = 1;
+
        /* Wait for the timeout to expire or for a disconnect */
        if (delay_use > 0) {
                printk(KERN_DEBUG "usb-storage: waiting for device "
-                               "to settle before scanning\n");
+                               "to settle before scanning for %d
seconds\n", delay_use);
                wait_event_freezable_timeout(us->delay_wait,
                                test_bit(US_FLIDX_DONT_SCAN,
&us->dflags),
                                delay_use * HZ);



             reply	other threads:[~2009-03-06 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 10:34 Martin Bammer [this message]
2009-03-06 17:49 ` usb-storage: Wait less time for settling when a memory device is connected 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=1236335647.16732.12.camel@localhost \
    --to=mrbm74@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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