lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb/core: skip unnecessary line IRQ request for USB3
On Thu, 15 Mar 2012, Alex Shi wrote:

> USB3 requests line IRQ here but will disable it
> in later driver->start function and try MSI first.
>
> xhci_hcd 0000:02:00.0: irq 18, io mem 0xfe500000
> xhci_hcd 0000:02:00.0: irq 45 for MSI/MSI-X
> xhci_hcd 0000:02:00.0: irq 46 for MSI/MSI-X
>
> So it is better to remove the redundant request here. And
> save a little time in booting.
>
> Signed-off-by: Alex Shi <alex.shi@intel.com>
> ---
> drivers/usb/core/hcd.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index e128232..5b09825 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2450,7 +2450,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
> /* enable irqs just before we start the controller,
> * if the BIOS provides legacy PCI irqs.
> */
> - if (usb_hcd_is_primary_hcd(hcd) && irqnum) {
> + if (usb_hcd_is_primary_hcd(hcd) && irqnum
> + && (hcd->driver->flags & HCD_MASK) != HCD_USB3) {
> retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);
> if (retval)
> goto err_request_irq;

This is not a good idea. What happens if some USB-3 controller
(perhaps a non-xHCI USB-3 controller) doesn't use MSI?

The right way to avoid registering a legacy interrupt handler is to
call usb_add_hcd() with irqnum equal to 0.

Alan Stern



\
 
 \ /
  Last update: 2012-03-15 15:31    [W:0.082 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site