On Sun, 1 Jan 2006, Scott D. Davilla wrote:

> More information about this;
> 
> >  GetStatus port 2 status 00180b POWER sig=j PEC CSC CONNECT
> 
> I added some code to do a 10us delayed double read of the port status 
> and it's the same so the status of 00180b is true. The important part 
> of the port status is the lower nibble 0xb, that's bit's 0, 1 and 3 
> for device present on port (CONNECT), connect status change (CSC) and 
> port enable/disable change (PEC). So the usb device is still connect 
> but the connect status change is really (guessing here) due to the 
> bit 3 set. That bit indicates that the controller disabled the port 
> due to some condition existing at the EOF2 point. The default bios 
> VIA vt8253 setting is to disable the port so it's dead from there on. 
> I've read that with a VIA EHCI controllers are a pain in that if you 
> get EOF2 errors, the port is dead until the ehci controller is reset. 
> After much searching I finally found the vt8253 chipset doc and you 
> can set bit 6 at 0x40 ehci pci offset to disable the babble disable 
> option. It's interesting to see that at bit is defaulted set to 1 in 
> the docs but both the bios and WinXP have it at set to 0.

I've heard about this bit before.  In my experience with VIA UHCI
controllers it has always been set to 1 -- but I don't have a motherboard
with a VIA chipset.

It's not clear whether setting this bit will fix your problem.  If it 
prevents CSC from being set as well as preventing the port from being 
disabled, then you should be in good shape.  Otherwise you will still 
appear to have a disconnect event.

> Why khubd hangs is still a mystery to me.

It's waiting in ehci_endpoint_disable, which in turn is waiting for 
qh->qh_state to be set to QH_STATE_IDLE, which happens when ehci_work() 
calls end_unlink_async(), which happens under conditions I don't know 
about.  Presumably those conditions never occur because of some VIA 
hardware-related weirdness.

That's for asynchronous endpoints, which is probably where you're hanging.  
Periodic endpoints work somewhat differently.

>  From my research, I'm not alone in this sporatic USB hang running 
> under a VIA vt8253 chipset. It's not the device, nor cables nor EMI. 
> Sooner or later if you have a VIA vt8253 chipset and leave a usb 2.0 
> device connected for a long time, you will get a hang. We have some 
> boxes that have run for a few months before hanging the usb 
> subsystem. So there's a timing issue involving the VIA frame timer 
> where EOF2 occurs slightly sooner than it should or the usb device 
> signals get to the EOF2 checkpoint slightly later.
> 
> So I have two choices;
> 
> a) set the babble option to not disable the port, trap the EOF2 
> condition, clear it and ignore the error and see if I still live.

That option should be set in any case.  You may not need to ignore the
babble/EOF2 error; the higher-level USB protocols ought to be robust
enough to withstand an occasional babble error.

> b) start playing with FLADJ the frame length adjustment register to 
> see if that solves the problem. The FLADJ register is interesting in 
> that no one ever seems to change it's default setting yet it's 
> important enough to have as a base PCI register for the EHCI 
> controller.

I doubt this will help.  FLADJ is meant for situations where you want to 
synchronize the frame rate of a USB host controller to something else.  If 
you don't need such synchronization there's no need to change the 
register.

> I do have one more test before proceeding, I've disabled the spread 
> spectrum clock in bios. I figure that maybe the spread is wider than 
> VIA thinks and I'm seeing that reflected in the usb frame timing such 
> that the ehci and usb device frames are slighly out of phase.
> 
> I'm in slow motion on this, it takes one to two days to get a 
> sporadic disconnect.

You've done some very good work so far.  Keep it up!

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to