Re: [PATCH 03/10] usb/amd5536udc: move disconnect code into ISR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07.02.2012 21:51, Sebastian Andrzej Siewior wrote:
On Tue, Feb 07, 2012 at 03:46:53PM +0100, Thomas Dahlmann wrote:
On 04.02.2012 18:55, Sebastian Andrzej Siewior wrote:
The disconnect code is scheduled in a tasklet. I don't see the point in
doing this and the comment says that we may want do this in the irq. This
patch is doing so.


The disconnect code should stay in a tasklet as a controller soft
reset is done there. I remember issues when doing a controller soft
reset inside interrupt context because the whole controller is wiped
by reset.

Interresting. The disconnect is the last thing you do i.e. you are not doing
anything after you triggered that tasklet. So it should not make that much of
a difference.


On disconnect the controller is reset (all buffers and registers are cleared) and device interrupts are enabled after that to be able to react on upcoming connects. At first I implemented the disconnect/reset in the ISR and as mentioned I got system hangs due to some kind of PCI core hang inside the CS5536 controller. I worked together with the chip designers of CS5536 to find the root cause but if I remember right we could not find it. Doing the reset out of ISR solved the problem. This development happened around 2006 so I cannot remember all circumstances.

Soft reset on disconnect was needed for disconnects in the middle of
a transfer. Then controller buffers and registers may remain in a
kind of stuck state which can be resolved by a soft reset only.

Nice.

I have to build up a system to play with the driver a little bit
(haven't done that for a while).

Okay. I was going rid of the tasklet because it did not look perfomance
critical or anything _and_ I was going to get rid of global variables.
You mask interrupts before disconnect and then you enable them later after the
reset. Do you think a workqueue would do the work?

I'm not familiar with work queues. I have read that they allow to run in process context and can sleep. But as they function as bottom halfs too it should work.

Is there any benefit from replacing the tasklet by a work queue?


Sebastian, thank you very much for your work.
You are welcome. Do you want me to repost the code with tasklet/workqueue or
do you want to look at it by yourself?

It would be great if you could do. Within the next days it is not possible for me to build up a development environment.

Do you have a CS5536 hardware running for testing?

Thanks,
Thomas

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux