lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200703271824.46804.maximlevitsky@gmail.com>
Date:	Tue, 27 Mar 2007 18:24:46 +0200
From:	Maxim Levitsky <maximlevitsky@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	stern@...land.harvard.edu, gregkh@...e.de
Subject: USB: on suspend to ram/disk all usb devices are replugged

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ