From patchwork Sat May 20 13:21:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9738591 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 E4AFA6020A for ; Sat, 20 May 2017 13:21:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5EA22858F for ; Sat, 20 May 2017 13:21:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CACEF285C9; Sat, 20 May 2017 13:21:45 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 23D872859A for ; Sat, 20 May 2017 13:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932150AbdETNVk (ORCPT ); Sat, 20 May 2017 09:21:40 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:57663 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbdETNVg (ORCPT ); Sat, 20 May 2017 09:21:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eSMnioPI4jFeAbhySt/jzdNTuEuCWU8GW0KkZnggUjY=; b=pBbsVra0ja/BKsskASHgPEvu+ hjhl5zXuWOA4KszpercwyTIZEDcesj8j5Ij0TKzuiBCi2ggvPOI04HBgZCgcj3oJ/FsXDSKvIzOck E8bs1tZirAmqL3/dLZQe7xHb9fMKoCrXdi1qm/+vt0/wwVyOjxXZLT1O+5Hj8V6ONK5AGXuuSr+E9 jwIQ8t5zR5hQI1+/JQFCDxjPJRp/zBJIi+T+0Wu+5tTR+IybkfSCVZN9MyqMa15feQUbAgbSOMczu DGVD9wq8McNg9X4ONAEm1JdH8ULwkLdpUgjE2anuJtbS8UjLCo+bAZlCZhhEDF2+nTZtRfXggFU0p DqR5D6GCw==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dC4K7-00057d-Jv; Sat, 20 May 2017 13:21:35 +0000 From: Christoph Hellwig To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI/msi: fix the pci_alloc_irq_vectors_affinity stub Date: Sat, 20 May 2017 15:21:29 +0200 Message-Id: <20170520132129.16430-2-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170520132129.16430-1-hch@lst.de> References: <20170520132129.16430-1-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 We need to return an error for any call that asks for MSI / MSI-X vectors only, so that non-trivial fallback logic can work properly. Signed-off-by: Christoph Hellwig Reported-by: Steven Rostedt Fixes: aff17164 ("PCI: Provide sensible IRQ vector alloc/free routines") --- include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index 33c2b0b77429..5a7fd3b6a7b9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1342,7 +1342,7 @@ pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, unsigned int max_vecs, unsigned int flags, const struct irq_affinity *aff_desc) { - if (min_vecs > 1) + if (min_vecs > 1 || !(flags & PCI_IRQ_LEGACY)) return -EINVAL; return 1; }