Ok, here's 3 patches that read the strings from the device at insertion
time, and cache them. It makes the sysfs and /proc/bus/usb/devices file
use these string values to prevent bus accesses from happening at
inopportune times.
It's based on a patch that has been in the SuSE kernel for a long time
now, with no reported problems. I think Red Hat also shipped such a
patch for a while, but am not sure.
I've objected to this change for years now, based on the fact that there
used to be some very odd devices that change their strings at different
times during their lifetime. But, due to:
- this change has successfully worked for SuSE for a while,
- I can't remember which devices actually did the string
changing trick,
- the number of drivers in the kernel that already cache the
strings at probe time (input and usb-storage drivers)
successfully,
- adding this change fixes a lot of issues that users have been
reporting for years with bad devices that can hang when
retrieving strings while they are in the middle of doing
something else,
I've changed my mind.
And hey, based on the following diffstat, it makes the kernel smaller,
which is always a good thing :)
I've added these three patches to my trees, but comments are appreciated
if I've missed anything.
thanks,
greg k-h
drivers/usb/core/devices.c | 24 +++++-----------------
drivers/usb/core/hub.c | 42 ++++++++++++++++++++++------------------
drivers/usb/core/sysfs.c | 16 +++++++--------
drivers/usb/core/usb.c | 5 +++-
drivers/usb/input/aiptek.c | 19 +-----------------
drivers/usb/input/ati_remote.c | 19 ++++--------------
drivers/usb/input/hid-core.c | 12 +++++------
drivers/usb/input/mtouchusb.c | 18 +++--------------
drivers/usb/input/touchkitusb.c | 19 +++---------------
drivers/usb/input/usbkbd.c | 20 +++----------------
drivers/usb/input/usbmouse.c | 19 +++---------------
drivers/usb/storage/scsiglue.c | 19 +++++++++++++++---
drivers/usb/storage/usb.c | 31 -----------------------------
drivers/usb/storage/usb.h | 3 --
include/linux/usb.h | 3 ++
15 files changed, 90 insertions(+), 179 deletions(-)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel