From patchwork Thu Aug 11 14:11:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9275343 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3CC4600CB for ; Thu, 11 Aug 2016 14:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96E4D286A5 for ; Thu, 11 Aug 2016 14:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B89C286AD; Thu, 11 Aug 2016 14:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24463286A9 for ; Thu, 11 Aug 2016 14:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbcHKOLo (ORCPT ); Thu, 11 Aug 2016 10:11:44 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:51764 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbcHKOLn (ORCPT ); Thu, 11 Aug 2016 10:11:43 -0400 Received: from ip-64-134-220-76.public.wayport.net ([64.134.220.76] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXqhR-0005NU-3Q; Thu, 11 Aug 2016 14:11:09 +0000 From: Christoph Hellwig To: linux-pci@vger.kernel.org, helgaas@kernel.org, agordeev@redhat.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] pci: call pci_intx when using legacy interrupts in pci_alloc_irq_vectors Date: Thu, 11 Aug 2016 07:11:05 -0700 Message-Id: <1470924665-25860-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1470924665-25860-1-git-send-email-hch@lst.de> References: <1470924665-25860-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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); return 1; + } + return vecs; } EXPORT_SYMBOL(pci_alloc_irq_vectors);