On Fri, 25 Nov 2005, Franck wrote:

> Hi,
> 
> I'm looking at suspend/resume code and I run into
> "isp116x_bus_suspend" function. It seems buggy because if the hcd is
> transfering URB the function wait for it to finish. But it waits with
> IT disabled...is that correct ?

I assume by IT you mean INT.

I think there's nothing wrong. Processing the fifo ram 
loaded with finished transfer data does not interfere with 
the suspended bus.

Suppose isp116x_bus_suspend() is called and let's consider 
the two possible cases: (a) at that moment there are 
transfers scheduled for or happening on the bus (i.e., the 
chip's fifo ram is loaded) and (b) there are no transfers 
scheduled (fifo ram is empty).

(a) the following events will occur:

- at the beginning of isp116x_bus_suspend(), interrupts are 
disabled.

- mdelay(2) guarantees that the scheduled transfers get 
finished on the bus and the fifo becomes ready to be 
processed by the driver. Then an interrupt comes in, 
waiting to be serviced.

- the bus gets suspended.

- interrupts are re-enabled, end of isp116x_bus_suspend().

- interrupt handler will be called. In it, 
finish_atl_transfers() will be called, which processes the 
fifo and if urbs happen to be finished, gives them back. 
Within call to usb_hcd_giveback_urb(), isp116x_enqueue() may 
be called in an attempt to resubmit urbs, but 
isp116x_enqueue() refuses to enqueue, because 
HC_IS_RUNNING() fails. That's basically all for 
finish_atl_transfers().

- in interrupt handler, start_atl_transfers() is called. But 
as in it HC_IS_RUNNING() fails, it does not reload fifo. irq 
is handled.

(b) this means that there were no urbs enqueued.

Thanks,
Olav


-------------------------------------------------------
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
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to