mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andiry Xu <andiry.xu@amd.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: "Alex,Shi" <alex.shi@intel.com>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	<stern@rowland.harvard.edu>, Greg KH <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Oliver Neukum <oneukum@suse.de>, Takashi Iwai <tiwai@suse.de>,
	<trenn@suse.de>, <linux-pci@vger.kernel.org>,
	Michal Marek <MMarek@suse.com>
Subject: Re: [PATCH] usb: enable pci MSI/MSIX in usb core
Date: Sat, 18 Feb 2012 14:28:25 +0800	[thread overview]
Message-ID: <4F3F4509.4070003@amd.com> (raw)
In-Reply-To: <4F3E28D1.1030509@ladisch.de>

On 02/17/2012 06:15 PM, Clemens Ladisch wrote:
> Alex,Shi wrote:
>>> The controller driver will need to know which of the multiple MSI-X
>>> interrupts has been raised:
>>>
>>> irqreturn_t (*msix_irq)(struct usb_hcd *hcd, unsigned int nr_or_index);
>>
>> Actually, hcd has 2 object for msix, msix_count and msix_entries.
>>
>> Do you mean msix_count maybe smaller than we decide in hcd_setup_msix()?
> 
> No.  But when msic_count > 1, we have multiple interrupts.
> 
>> Which situation will make this?
> 
> Assume that an XHCI controller has two rings, and that each one gets its
> own MSI-X interrupt.  How should the driver decide which of the rings
> needs to be handled?
> 
> irqreturn_t xhci_msix_irq(struct usb_hcd *hcd)
> {
> 	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
> 
> 	if (...)
> 		handle(xhci->ring[0]);
> 	else
> 		handle(xhci->ring[1]);
> }
> 
> I.e., what should go into the if()?
> 
> 

Currently xHCI driver only support one ERST event ring. If we need to
support multiple event rings in the future, it's simple: in
usb_hcd_request_msi_msix_irqs, change the last parameter of
request_irq() to xhci->erst[i], and we can get the corresponding erst[i]
in xhci_msi_irq() like this:

irqreturn_t xhci_msi_irq(int irq, void *dev_id)
{
	struct xhci_erst *erst = dev_id;
	...
	/* Handle corresponding event ring pointed by erst */
}

See Matthew Wilcox's patchset below for reference:

www.spinics.net/lists/linux-usb/msg47353.html

Thanks,
Andiry
Andiry






  reply	other threads:[~2012-02-18  6:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 12:29 Alex Shi
2012-02-07 11:59 ` Alex Shi
2012-02-07 14:42   ` Greg KH
2012-02-07 17:27     ` Sarah Sharp
2012-02-07 22:13       ` Sarah Sharp
2012-02-08  1:26         ` Alex,Shi
2012-02-08  6:27           ` Alex,Shi
2012-02-08  9:11             ` Alex,Shi
2012-02-14  0:20               ` Sarah Sharp
2012-02-14  0:25                 ` [RFT] USB: Try MSI first before line IRQ for Intel PCIe USB3 HCD Sarah Sharp
2012-02-14  4:43                   ` Alex,Shi
2012-02-16  2:36                 ` [PATCH] usb: enable pci MSI/MSIX in usb core Alex,Shi
2012-02-17  6:44                   ` Alex,Shi
2012-02-17  8:13                     ` Clemens Ladisch
2012-02-17  8:46                       ` Alex,Shi
2012-02-17 10:15                         ` Clemens Ladisch
2012-02-18  6:28                           ` Andiry Xu [this message]
2012-02-20  0:57                             ` Alex,Shi
2012-02-20  3:52                     ` Alex,Shi
2012-02-08 15:07         ` Alan Stern

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=4F3F4509.4070003@amd.com \
    --to=andiry.xu@amd.com \
    --cc=MMarek@suse.com \
    --cc=alex.shi@intel.com \
    --cc=clemens@ladisch.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tiwai@suse.de \
    --cc=trenn@suse.de \
    /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

Powered by JetHome