From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbcHRK3q (ORCPT ); Thu, 18 Aug 2016 06:29:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbcHRK3p (ORCPT ); Thu, 18 Aug 2016 06:29:45 -0400 Date: Thu, 18 Aug 2016 12:33:57 +0200 From: Alexander Gordeev To: Christoph Hellwig Cc: linux-pci@vger.kernel.org, helgaas@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] pci: call pci_intx when using legacy interrupts in pci_alloc_irq_vectors Message-ID: <20160818103357.GF27949@agordeev.lab.eng.brq.redhat.com> References: <1470924665-25860-1-git-send-email-hch@lst.de> <1470924665-25860-3-git-send-email-hch@lst.de> <20160818092007.GD27949@agordeev.lab.eng.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160818092007.GD27949@agordeev.lab.eng.brq.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 18 Aug 2016 10:29:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 11:20:07AM +0200, Alexander Gordeev wrote: > On Thu, Aug 11, 2016 at 07:11:05AM -0700, Christoph Hellwig wrote: > > ahci currently insists on an explicit call to pci_intx before falling back > > from MSI or MSI-X to legacy irqs. As pci_intx is a no-op if the command > > register already contains the right value is seems safe and useful to add > > this call to pci_alloc_irq_vectors so that ahci can just use > > pci_alloc_irq_vectors. > > Looking at ahci_init_interrupts() (and probably at commit d684a90d > ("ahci: per-port msix support")) it looks like pci_alloc_irq_vectors() > is able to preserve the current AHCI logic? ^^^^ is *not* able (sorry) > > Signed-off-by: Christoph Hellwig > > --- > > drivers/pci/msi.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > > index 9233e7f..593698e 100644 > > --- a/drivers/pci/msi.c > > +++ b/drivers/pci/msi.c > > @@ -1200,8 +1200,11 @@ int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, > > } > > > > /* use legacy irq if allowed */ > > - if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1) > > + if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1) { > > + pci_intx(dev, 1); > > It would rather called pci_intx_for_msi() here. But because it is > a generic code I am not sure what implications it has for all > drivers out there. > > > return 1; > > + } > > + > > return vecs; > > } > > EXPORT_SYMBOL(pci_alloc_irq_vectors); > > -- > > 2.1.4 > >