From: "Alex,Shi" <alex.shi@intel.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>,
gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
linux-usb@vger.kernel.org, andiry.xu@amd.com, clemens@ladisch.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] usb: enable pci MSI/MSIX in usb core
Date: Thu, 23 Feb 2012 16:39:44 +0800 [thread overview]
Message-ID: <1329986384.21053.165.camel@debian> (raw)
In-Reply-To: <20120223034147.GD27250@xanatos>
> This PCI device and vendor ID is now used in two drivers (xhci and USB
> core). Please create a separate patch to add this ID to the pci_ids.h
> file, and remove the reference here and in the xHCI driver.
Yes, should be.
> Why don't you rename hcd_no_msi() to hcd_supports_msi() and remove the
> negation of the return value?
OK.
>
> >
> > + /* register hc_driver's msix_irq handler */
> > + for (i = 0; i < hcd->msix_count; i++) {
> > + retval = request_irq(hcd->msix_entries[i].vector,
> > + (irq_handler_t)hcd->driver->msix_irq,
> > + 0, hcd->driver->description, hcd);
>
> I really think you need to allow the host controller driver to set
> different pointers for the msix data pointer. It's something that we
> need to figure out, so that we can have the infrastructure in place for
> multiple event rings.
>
> I'm not sure whether the new get MSIX count needs to allow the xHCI
> driver to return an array of pointers, or if the driver can modify the
> irq pointer later? I don't think you can modify the irq data pointer
> after it's been requested (that would lead to all kinds of race
> conditions, I think).
>
> It's probably better to allow the xHCI driver to pass this function the
> pointers it needs for each MSI-X vector. You'll always call
> usb_hcd_request_msi_msix_irqs() after you call xhci_init(), correct? At
> that point, we should have allocated the multiple event rings, so it
> should be easy to pass the pointers to this function.
What do you mean: there is a relation between event rings
msix_entries.vectors. and we need to presents this relationships in the
msix interrupt handler?
So does the following mode you like?
request_irq(hcd->msix_entries[i].vector, msix_irq_handler, 0, "",
hcd->ring_handler[i]);
Or another way to do it if we know which ring will handle the irq, like:
irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd)
switch (irq2ring(irq))
case ring0: driver_handle_ring(ring0);
case ring1: driver_handle_ring(ring1);
In fact, since there is no actual usage of multiple rings now, I have no
much idea of the relationships.
BTW, if it is possible do this change to another patch?
>
> > @@ -888,7 +696,11 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
> > if (retval)
> > return retval;
> > xhci_dbg(xhci, "Start the primary HCD\n");
> > - retval = xhci_run(hcd->primary_hcd);
> > + if (dev_is_pci(hcd->self.controller))
> > + retval = usb_hcd_register_msi_msix_irqs(
> > + hcd->primary_hcd);
>
> Why not change this function to take a count of msix vectors and
> pointers for data? Then you don't need the new usb_hcd driver method
> for getting the msix count.
>
Uh, the key is msix vector numbers maybe changed after be freed in
suspend and re-get here. Are there examples to keep the vector number in
suspending?
next prev parent reply other threads:[~2012-02-23 8:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 9:05 [PATCH v2 0/3] enable pci MSI/MSIX in usb core Alex Shi
2012-02-20 9:05 ` [PATCH 1/3] USB: Try MSI first before line IRQ for Intel PCIe USB3 HCD Alex Shi
2012-02-20 9:05 ` [PATCH 2/3] usb: enable pci MSI/MSIX in usb core Alex Shi
2012-02-20 9:05 ` [PATCH 3/3] usb: export usb_hcd_request_irqs Alex Shi
2012-02-23 3:41 ` [PATCH 2/3] usb: enable pci MSI/MSIX in usb core Sarah Sharp
2012-02-23 8:39 ` Alex,Shi [this message]
2012-02-23 9:11 ` Alex,Shi
2012-02-23 12:41 ` Felipe Balbi
2012-02-24 1:47 ` Alex,Shi
2012-02-24 10:00 ` Felipe Balbi
2012-02-24 15:59 ` Alan Stern
2012-02-28 1:43 ` Alex,Shi
2012-02-26 10:16 ` Alex Shi
2012-03-06 17:55 ` [PATCH 1/3] USB: Try MSI first before line IRQ for Intel PCIe USB3 HCD Tom Goetz
[not found] <1329728040-28664-1-git-send-email-alex.shi@intel.com>
2012-02-20 8:53 ` [PATCH 2/3] usb: enable pci MSI/MSIX in usb core Alex Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329986384.21053.165.camel@debian \
--to=alex.shi@intel.com \
--cc=andiry.xu@amd.com \
--cc=balbi@ti.com \
--cc=clemens@ladisch.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).