Skip to contentSkip to conversation

USB interrupt handler routine

DISCUSSION Keith Packard 3 participants 3 messages Dec 12, 2008 – Dec 14, 2008

lore
Share & tools
lore
#0 lore raw

We recently made a patch in the Intel DRM driver:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b60678a75d44fa9d5969f79781bd856ad5858609

This switches from non-MSI to MSI-mode.

It "should" have had no effect, but our concern is that what we're really seeing is interrupt sharing troubles. We've had several people say that they got an interrupt flood when plugging in a USB stick or external disk. Switching the graphics driver to MSI mode "cures" the bug, but that sure seems like a work-around rather than a bug fix to me.

When our driver is active, it can generate a lot of interrupts, potentially thousands per second. Is it possible that the UHCI or EHCI drivers could get confused if checking for interrupt status this often?

Eric noted that the USB driver appears to not check and ACK interrupt status unconditionally, preferring to check the software state beforehand. I'm wondering if this may open up a potential race between hardware state change and ISR bit setting.

Signature · 1 line
[email protected]
#1 lore raw

<added linux-usb list, that's the proper place for it...)

Quoted 12 lines · Keith Packard

We recently made a patch in the Intel DRM driver:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b60678a75d44fa9d5969f79781bd856ad5858609

This switches from non-MSI to MSI-mode.

It "should" have had no effect, but our concern is that what we're really seeing is interrupt sharing troubles. We've had several people say that they got an interrupt flood when plugging in a USB stick or external disk. Switching the graphics driver to MSI mode "cures" the bug, but that sure seems like a work-around rather than a bug fix to me.

Quoted 8 lines

When our driver is active, it can generate a lot of interrupts, potentially thousands per second. Is it possible that the UHCI or EHCI drivers could get confused if checking for interrupt status this often?

Eric noted that the USB driver appears to not check and ACK interrupt status unconditionally, preferring to check the software state beforehand. I'm wondering if this may open up a potential race between hardware state change and ISR bit setting.

Check what software state? It shouldn't cause any race issues, but I'll defer to David and Alan to concur this or not.

thanks,

greg k-h

#2 lore raw
Quoted 13 lines · Greg KH

<added linux-usb list, that's the proper place for it...)

Quoted 10 lines · Keith Packard

We recently made a patch in the Intel DRM driver:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b60678a75d44fa9d5969f79781bd856ad5858609

This switches from non-MSI to MSI-mode.

It "should" have had no effect, but our concern is that what we're really seeing is interrupt sharing troubles. We've had several people say that they got an interrupt flood when plugging in a USB stick or external disk.

Which drivers are using the IRQ that gets flooded? Can we see a dmesg log from a kernel built with CONFIG_USB_DEBUG enabled?

Quoted 6 lines
Quoted 6 lines

Switching the graphics driver to MSI mode "cures" the
bug, but that sure seems like a work-around rather than a bug fix to me.

When our driver is active, it can generate a lot of interrupts, potentially thousands per second. Is it possible that the UHCI or EHCI drivers could get confused if checking for interrupt status this often?

I don't think so.

Quoted 1 line
Quoted 1 line

Eric noted that the USB driver

Which USB driver? Does this refer to usb_hcd_irq()?

Quoted 4 lines
Quoted 4 lines

appears to not check and ACK interrupt
status unconditionally, preferring to check the software state beforehand. I'm wondering if this may open up a potential race between hardware state change and ISR bit setting.

Not if the drivers are written correctly. As far as I know, they are.

Alan Stern