Bug 80840

Summary: Problem with hotplugging usb-devices
Product: [Retired] Red Hat Linux Reporter: Inger Karin Haarbye <inger>
Component: kernelAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: notting, zaitcev
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-28 22:54:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
tarball of some old usb-scripts
none
output from /var/log/messages none

Description Inger Karin Haarbye 2002-12-31 20:40:01 UTC
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 2003-01-01 02:58:52 UTC
This appears to be a kernel issue.

Comment 2 Inger Karin Haarbye 2003-01-01 09:57:42 UTC
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 10:02:39 UTC
Created attachment 89025 [details]
tarball of some old usb-scripts

Comment 4 Bill Nottingham 2003-01-02 01:58:43 UTC
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 10:49:25 UTC
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 10:50:46 UTC
Created attachment 89050 [details]
output from /var/log/messages

Comment 7 Aleksey Nogin 2003-01-06 11:22:31 UTC

*** This bug has been marked as a duplicate of 80622 ***

Comment 8 Aleksey Nogin 2003-01-06 11:30:18 UTC
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 19:05:37 UTC
OK, it was an erroneous aliasing then.


Comment 10 Inger Karin Haarbye 2003-01-08 09:45:37 UTC
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 17:38:42 UTC
The USB hub thread is getting a strange SIGHUP from somewhere and exiting.
Unknown why...

Comment 12 Inger Karin Haarbye 2003-01-19 17:27:00 UTC
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 16:56:45 UTC
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 18:34:35 UTC
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 22:54:03 UTC
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.