From patchwork Sun Sep 11 07:09:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9325141 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 58C9F6048B for ; Sun, 11 Sep 2016 07:09:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3970128B30 for ; Sun, 11 Sep 2016 07:09:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C82528FB8; Sun, 11 Sep 2016 07:09:42 +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 7F34028B30 for ; Sun, 11 Sep 2016 07:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752650AbcIKHJd (ORCPT ); Sun, 11 Sep 2016 03:09:33 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:55577 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbcIKHJd (ORCPT ); Sun, 11 Sep 2016 03:09:33 -0400 Received: from [91.114.64.3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1biytO-0004sS-E1; Sun, 11 Sep 2016 07:09:30 +0000 From: Christoph Hellwig To: agordeev@redhat.com, linux-pci@vger.kernel.org Cc: davem@davemloft.net, shane.huang@amd.com Subject: [PATCH, RFC] PCI: use pci_intx_for_msi in pci_alloc_irq_vectors Date: Sun, 11 Sep 2016 09:09:27 +0200 Message-Id: <1473577767-9888-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 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 Alex pointed out that we might want to use pci_intx_for_msi in pci_alloc_irq_vectors for the case where allocating MSI or MSI-X vectors fails completely. I tried to read up the history behind pci_intx_for_msi, but the changelogs seem a bit confusing, e.g. the comment in the tg3 around that code that was replaced by this quirk only talk about _disabling_ INT-X. Maybe someone can help me to shed some light about this workaround, and help answering the question wether we need it in this case. Signed-off-by: Christoph Hellwig Cc: David Miller Cc: Shane Huang --- 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 9da5ecb..a4b443f 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -1215,7 +1215,7 @@ 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) { - pci_intx(dev, 1); + pci_intx_for_msi(dev, 1); return 1; }