From: Maxim Levitsky <maximlevitsky@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: stern@rowland.harvard.edu, gregkh@suse.de
Subject: USB: on suspend to ram/disk all usb devices are replugged
Date: Tue, 27 Mar 2007 18:24:46 +0200 [thread overview]
Message-ID: <200703271824.46804.maximlevitsky@gmail.com> (raw)
Hi,
I noticed that after suspend/resume cycle all my usb devices are unplugged/replugged by uhci driver.
While it is not that big problem to me, that can be a real problem if a device is a flash card with mounted
file-system, because disappeared device will cause file-system corruption.
I found why this happens.
drivers/usb/host/pci-quirks.c:uhci_check_and_reset_hc checks that the BIOS didn't play with USB controller, and on my system
with or without a USB Legacy support turned on in the BIOS, the BIOS does meddle with USB controller,
But I suggest adding a option that will allow the user to bypass that check, because for example on my system USB works perfectly
if I disable the checks that this function does (but I agree that those checks are very valuable, since I almost sure that on many systems USB
won't work without resetting the USB controller.)
Secondary, this function checks for UHCI_USBCMD_CONFIGURE, that is not set on resume,
According to both UHCI and ICH8 documentation this is software only bit, but I didn't find any place in kernel where it is set,
(But such place exist, because reading from usb IO ports confirm that it is set during normal work, I will try to find it)
Disabling both check for UHCI_USBLEGSUP and UHCI_USBCMD_CONFIGURE makes all usb devices (I have mouse,keyborad, and joystick)
work fine on resume from ram without this "virtual" replugging.
Suspend to disk still causes "virtual replugging" and I think that controller is reset and will unplug/replug devices anyway
Resolving this problem is very difficult. Maybe it possible to check on unplugging event that this caused by suspend if the same device is
replugged then don't remove/reinstall driver, but this is very difficult to implement properly,
Maybe just refuse to suspend if some valuable device is connected (sorry if it is done this way already)
Also I want to note that I didn't yet checked any EHCI devices, because I don't have any (I am going to buy a usb stick soon)
But I feel that the above will be true for ehci too....
Looking for comments,
Best regards,
Maxim Levitsky
next reply other threads:[~2007-03-27 16:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 16:24 Maxim Levitsky [this message]
2007-03-27 17:15 ` USB: on suspend to ram/disk all usb devices are replugged Alan Stern
2007-03-27 17:54 ` Maxim
2007-03-27 18:05 ` Pete Zaitcev
2007-03-27 23:29 ` Maxim
2007-04-01 15:29 ` Pavel Machek
2007-04-01 17:42 ` David Zeuthen
2007-04-01 17:50 ` Pavel Machek
2007-04-01 18:01 ` David Zeuthen
2007-04-01 18:29 ` Pavel Machek
2007-04-01 18:26 ` Alan Stern
2007-04-01 18:34 ` Pavel Machek
2007-04-01 20:53 ` Rafael J. Wysocki
2007-04-02 2:54 ` Alan Stern
2007-04-02 20:37 ` Rafael J. Wysocki
2007-04-02 18:38 ` Chuck Ebbert
2007-04-02 19:36 ` Pavel Machek
2007-04-06 22:23 ` Nigel Cunningham
2007-04-02 14:49 ` Mark Lord
2007-04-02 18:28 ` Pavel Machek
2007-03-29 13:19 ` Mark Lord
2007-03-29 15:56 ` Alan Stern
2007-03-29 16:03 ` Mark Lord
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=200703271824.46804.maximlevitsky@gmail.com \
--to=maximlevitsky@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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