linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Jonathan Derrick <jonathan.derrick@intel.com>,
	Scott Bauer <scott.bauer@intel.com>
Subject: Re: [PATCHv2] PCI: vmd: Use affinity to chain child device interrupts
Date: Tue, 13 Mar 2018 14:18:07 -0600	[thread overview]
Message-ID: <20180313201807.GA28112@localhost.localdomain> (raw)
In-Reply-To: <20180313200840.GA28002@localhost.localdomain>

On Tue, Mar 13, 2018 at 02:08:40PM -0600, Keith Busch wrote:
> On Tue, Mar 13, 2018 at 05:10:39PM +0000, Lorenzo Pieralisi wrote:
> > On Tue, Feb 06, 2018 at 01:22:25PM -0700, Keith Busch wrote:
> > > @@ -233,9 +266,11 @@ static int vmd_msi_prepare(struct irq_domain *domain, struct device *dev,
> > >  	struct pci_dev *pdev = to_pci_dev(dev);
> > >  	struct vmd_dev *vmd = vmd_from_bus(pdev->bus);
> > >  
> > > -	if (nvec > vmd->msix_count)
> > > +	if (nvec > vmd->msix_count) {
> > > +		if (vmd->msix_count > 1)
> > > +			return vmd->msix_count - 1;
> > >  		return vmd->msix_count;
> > 
> > I am about to apply this patch but I do not understand what's this hunk
> > is there for, to me vmd_msi_prepare() should just return an error in
> > this code path unless I am getting this wrong.
> 
> The change above is fixing an off-by-one.

And since you brought my attention to it, I see the 'if' is off by one.
Let me prepare a v3, and I've one other minor optimization to add as
well.

Thanks,
Keith

  reply	other threads:[~2018-03-13 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 20:22 [PATCHv2] PCI: vmd: Use affinity to chain child device interrupts Keith Busch
2018-03-13 17:10 ` Lorenzo Pieralisi
2018-03-13 20:08   ` Keith Busch
2018-03-13 20:18     ` Keith Busch [this message]
2018-03-13 23:24       ` Keith Busch
2018-03-14 11:05         ` Lorenzo Pieralisi

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=20180313201807.GA28112@localhost.localdomain \
    --to=keith.busch@intel.com \
    --cc=bhelgaas@google.com \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=scott.bauer@intel.com \
    /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).