public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* USB interrupt handler routine
@ 2008-12-12  4:35 Keith Packard
  2008-12-14  4:41 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Packard @ 2008-12-12  4:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel; +Cc: keithp

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

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.
	
-- 
keith.packard@intel.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: USB interrupt handler routine
  2008-12-12  4:35 USB interrupt handler routine Keith Packard
@ 2008-12-14  4:41 ` Greg KH
  2008-12-14 15:50   ` Alan Stern
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2008-12-14  4:41 UTC (permalink / raw)
  To: Keith Packard; +Cc: linux-kernel, linux-usb

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

On Thu, Dec 11, 2008 at 08:35:37PM -0800, Keith Packard wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: USB interrupt handler routine
  2008-12-14  4:41 ` Greg KH
@ 2008-12-14 15:50   ` Alan Stern
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2008-12-14 15:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Keith Packard, linux-kernel, linux-usb

On Sat, 13 Dec 2008, Greg KH wrote:

> <added linux-usb list, that's the proper place for it...)
> 
> On Thu, Dec 11, 2008 at 08:35:37PM -0800, Keith Packard wrote:
> > 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?

> > 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.

> > Eric noted that the USB driver

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

> > 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-14 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-12  4:35 USB interrupt handler routine Keith Packard
2008-12-14  4:41 ` Greg KH
2008-12-14 15:50   ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox