On Thu, Dec 01, 2016 at 10:15:04AM +0800, Dennis Chen wrote: > The __pci_enable_msi_range() should return -ENOSPC instead of -EINVAL > when the device doesn't have enough vectors as required, just as the > MSI-X vector allocator does in __pci_enable_msix_range(). Otherwise, > some drivers depending on that return value will probably fallback to > the legacy interrupt directly, for example, in commit 17a51f12cfbd2814 > ("ahci: only try to use multi-MSI mode if there is more than 1 port"), the > ahci driver will fallback to single MSI mode only when the return value > is -ENOSPC in case of required vectors is not enough, else the driver will > use legacy interrupt which has been observed on a x86 box with 6-port SATA > controller. Unless Christoph objects, I'll apply this, but I don't understand the situation with 17a51f12cfbd. That commit doesn't check for EINVAL or ENOSPC so I don't know what the connection with this patch is. I know Christoph said he changed something in ahci to treat all errors the same, but I don't know where that is, either. If there's a revision of Linus' tree that is broken, please give the details so I can at least describe which versions are broken, when it got fixed by Christoph, and figure out whether we need stable backports or anything. Bjorn > With this patch, when a MSI-capable device doesn't have enough MSI > vectors as requested, it will fallback to single MSI mode while not > legacy interrupt. > > Signed-off-by: Dennis Chen <dennis.chen@xxxxxxx> > Cc: Tejun Heo <tj@xxxxxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Tom Long Nguyen <tom.l.nguyen@xxxxxxxxx> > Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> > Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> > Cc: Marc Zyngier <marc.zyngier@xxxxxxx> > Cc: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx> > Cc: Steve Capper <steve.capper@xxxxxxx> > Cc: linux-ide@xxxxxxxxxxxxxxx > Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx > --- > drivers/pci/msi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > index ad70507..da37113 100644 > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -1084,7 +1084,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec, > if (nvec < 0) > return nvec; > if (nvec < minvec) > - return -EINVAL; > + return -ENOSPC; > > if (nvec > maxvec) > nvec = maxvec; > -- > 2.7.4 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@xxxxxxxxxxxxxxxxxxx > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html