lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 16 Feb 2012 10:36:41 +0800
From:	"Alex,Shi" <alex.shi@...el.com>
To:	Sarah Sharp <sarah.a.sharp@...ux.intel.com>
Cc:	stern@...land.harvard.edu, Greg KH <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, andiry.xu@....com,
	linux-kernel@...r.kernel.org, Oliver Neukum <oneukum@...e.de>,
	Takashi Iwai <tiwai@...e.de>, trenn@...e.de,
	linux-pci@...r.kernel.org, Michal Marek <MMarek@...e.com>
Subject: Re: [PATCH] usb: enable pci MSI/MSIX in usb core


> Ugh, this is a giant patch.  It's too big for stable, and it adds new
> host controller driver APIs.  We can't do that for stable.

Yes, agree!
> > +		return 1;
> > +	} else if (!(hcd->driver->flags & HCD_MSI_FIRST))
> > +		return 1;
> 
> You don't need the else statement here, since you always return in the
> previous if block.

Correct! remove 'else' here make code more clear. 
> > +/* msi irq handler should be here, if driver has */
> > +irqreturn_t hcd_msi_irq(int irq, struct usb_hcd *hcd)
> > +{
> > +	return hcd->driver->irq(hcd);
> > +}
> 
> This works for now, but it isn't going to work in the future.  We need
> the USB core to provide us with the irq number so we can map the MSI-X
> interrupt to the event ring that generated the interrupt, whenever we
> get around to adding multiple event rings.
> 
> I think you need to add a new USB hcd callback for MSI/MSI-X vectors.  The
> xHCI usb_hcd can provide both pointers.
> 

Do you mean to add 2 new vectors for MSI/MSIX in hc_driver?
---
@@ -205,11 +212,14 @@ struct hc_driver {
 
        /* irq handler */
        irqreturn_t     (*irq) (struct usb_hcd *hcd);
+       irqreturn_t     (*msi_irq) (struct usb_hcd *hcd);
+       irqreturn_t     (*msix_irq) (struct usb_hcd *hcd);
 
        int     flags;
---
It is reasonable. When I written the code, I thought it may need
different MSI/MSIX irq handlers later for different driver. :) 

Actually, There is 2 ways to implement this vectors for detail. 
a, let driver's self code to do request_irq() for each of vectors for
MSI/MSIX, and hc_driver just has a simple hook for them.
b, do detailed request_irq() work in usb-core(in hcd-pci.c). 

Consider all pci MSI/MSIX interface is similar, we may prefer the second
way to save some code. 

What's opinions for above 2 ways? 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ