Bug 80840 - Problem with hotplugging usb-devices
Problem with hotplugging usb-devices
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Pete Zaitcev
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-31 15:40 EST by Inger Karin Haarbye
Modified: 2007-04-18 12:49 EDT (History)
2 users (show)

See Also:
Fixed In Version: 9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-07-28 18:54:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
tarball of some old usb-scripts (60.00 KB, application/x-tar)
2003-01-01 05:02 EST, Inger Karin Haarbye
no flags Details
output from /var/log/messages (7.31 KB, text/plain)
2003-01-02 05:50 EST, Inger Karin Haarbye
no flags Details

  None (edit)
Description Inger Karin Haarbye 2002-12-31 15:40:01 EST
Description of problem:8.0.92 (Phoebe)  
This has worked in earlier versions of RedHat.  
My usb-devices works if they are attached before boot, but not if they are plugged in later. 
Epson printer and scanner, Kodak camera, usb-hub.  
 
Version-Release number of selected component (if applicable): 
hotplug-2002_04_01-14 
 
How reproducible: 
Seems to happen all the time.  
 
Steps to Reproduce: 
1. Boot without the usb-devices attached 
2. Attach the devices 
 
OR: 
 
1. Boot with the usb-devices attached 
2. The devices now works 
3. unplug the devices 
4. reattach 
     
Actual results: 
The usb-devices don't work 
 
Expected results: 
I expect ex. the usb-camera, scanner, printer etc. to work when I attach to the usb-ports or 
usb-hub.  
 
Additional info: 
After attaching/detaching devices I get lots of theese in /var/log/messages: 
 
Dec 31 21:42:57 opuntia kernel: usb-uhci.c: interrupt, status 3, frame# 1600 
Dec 31 21:43:02 opuntia kernel: usb-uhci.c: interrupt, status 3, frame# 832
Comment 1 Bill Nottingham 2002-12-31 21:58:52 EST
This appears to be a kernel issue.
Comment 2 Inger Karin Haarbye 2003-01-01 04:57:42 EST
Maybe - but I have some old usb-scripts from somewhere which makes it work again, 
somehow. If it was kernel-problem only - it should not work? 
The script gives me an error-message about usb not started, but everything works afterwords - 
I think. File attached. 
Comment 3 Inger Karin Haarbye 2003-01-01 05:02:39 EST
Created attachment 89025 [details]
tarball of some old usb-scripts
Comment 4 Bill Nottingham 2003-01-01 20:58:43 EST
Odd, the only differences there aside from what we do in rc.sysinit are:

a) rc.sysinit explicitly loads usbcore before the host controller, they don't
   (shouldn't make any difference)
b) rc.sysinit is running with a r/o filesystem (which shouldn't make any
   difference)
Comment 5 Inger Karin Haarbye 2003-01-02 05:49:25 EST
First: I don't know anything about the usb-scripts I attached, I only have tried them now and 
then when something else has not worked. I put the scrips in /etc/usb, I have done nothing to 
the redhat-scripts in /etc/hotplug. I have now tried the following: 
 
After restarting the box, I print a textfile - it works. 
11.29 I unplug the printer - and then attach it again. 
11.30 Trying to print a textfile now does not work, lots of error-messages occur in 
/var/log/messages. 
11.30 After this I try the '/etc/usb/rc.usb restart'. Actually, I did it twice, because I had to do it 
twice last time to make the printer work again. 
11.32 I can now print files again. 
 
I attach the messages in /var/log/messages. 
 
What I think is vedy odd, is that after I have run the /etc/usb/rc.usb restart, hotpluging of the 
devices now works. I do not have to run this old script again when plugging/unplugging 
usb-devices until next boot. 
 
Comment 6 Inger Karin Haarbye 2003-01-02 05:50:46 EST
Created attachment 89050 [details]
output from /var/log/messages
Comment 7 Aleksey Nogin 2003-01-06 06:22:31 EST

*** This bug has been marked as a duplicate of 80622 ***
Comment 8 Aleksey Nogin 2003-01-06 06:30:18 EST
I think I found the real difference - the attached scritps use uhci module,
while the rc.sysinit uses the usb-uhci!

The interesting message I see is 

uhci.c: bf80: host controller halted. very bad

I get it after - plug printer; rc.usb restart; unplug printer; and *before*
"usb.c: USB disconnect" message. In other words, it seems that uhci module knows
how to deal with the halted controller while usb-uhci does not!
Comment 9 Pete Zaitcev 2003-01-06 14:05:37 EST
OK, it was an erroneous aliasing then.
Comment 10 Inger Karin Haarbye 2003-01-08 04:45:37 EST
1)  /etc/hotplug/usb.rc line 275, maybe_start_usb is commented out. Is it ment to be so? If I 
remove the '#' in line 275, '/etc/hotplug/usb.rc restart' will work as well - and hotplug works. So 
this seems for me to have nothing to do with uhci og usb-uhci module.  
 
This sequence will work for me as well: 
 
# stop usb: 
rmmod usb-uhci 
rmmod -a 
rmmod scanner printer hid 
umount /proc/bus/usb 
rmmod usbcore 
 
# start usb: 
modprobe usb-uhci 
mount -t usbdevfs usbdevfs /proc/bus/usb 
 
 
2) If I remove the usb-stuff from rc.sysinit and move it to rc.local, hotplug works. If I put it at 
the end of rc.sysinit, hotplug doesn't work. This means something, but I don't know what.... 
Comment 11 Bill Nottingham 2003-01-08 12:38:42 EST
The USB hub thread is getting a strange SIGHUP from somewhere and exiting.
Unknown why...
Comment 12 Inger Karin Haarbye 2003-01-19 12:27:00 EST
USB hotplug seems to work in beta4. 
 
Trying to restart usb with /etc/hotplug/usb.rc restart is not working. Is this 
right? 
Comment 13 Pete Zaitcev 2003-01-20 11:56:45 EST
Inger, I do not understand what an attempt to "restart usb" supposed
to do? Not all modules can be unloaded, for example usbcore refuses
rmmod with a use count, until khubd is stopped, and for a good reason.
Please tell us why you want to "restart usb" if "hotplug seems to work".
Some problem other than hotplug?
Comment 14 Inger Karin Haarbye 2003-01-20 13:34:35 EST
I have an usb-hub, usb-printer, usb-scanner and usb-camera. Now and then in 
the past usb has 'crashed' in some way, most when trying to download from 
camera (possible sort of bad picture-files). That is when I have tried the 
usb-scripts in attachment 89025 [details]. I thought maybe the usb.rc script in 
/etc/hotplug was ment to do the same. 
But, if I ask the other way: is '/etc/hotplug/usb.rc restart' ment to do 
anything at all, or should I never use it? If not - is it a another way I can 
restart all the usb-stuff without my old scripts?   
 
Comment 16 Pete Zaitcev 2003-07-28 18:54:03 EDT
The issue was khubd dying due to early and unfinished NPTL signals processing,
so closing.

Regarding "restart", it should not be needed. It basically requires reboot.
If something bad happens which shouldn't, file bugs for separate problems
and I'll look into it.

Note You need to log in before you can comment on or make changes to this bug.