linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex,Shi" <alex.shi@intel.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stern@rowland.harvard.edu, Greg KH <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, andiry.xu@amd.com,
	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: Thu, 16 Feb 2012 10:36:41 +0800	[thread overview]
Message-ID: <1329359801.12669.2872.camel@debian> (raw)
In-Reply-To: <20120214002030.GA10364@xanatos>


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


  parent reply	other threads:[~2012-02-16  2:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1328531341-22705-1-git-send-email-alex.shi@intel.com>
     [not found] ` <4F311233.9070404@intel.com>
     [not found]   ` <20120207144204.GA7214@kroah.com>
2012-02-07 17:27     ` [PATCH] usb: enable pci MSI/MSIX in usb core 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                 ` Alex,Shi [this message]
2012-02-17  6:44                   ` [PATCH] usb: enable pci MSI/MSIX in usb core 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
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=1329359801.12669.2872.camel@debian \
    --to=alex.shi@intel.com \
    --cc=MMarek@suse.com \
    --cc=andiry.xu@amd.com \
    --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;
as well as URLs for NNTP newsgroup(s).