From patchwork Wed Jul 26 20:17:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9865771 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 F0832601A1 for ; Wed, 26 Jul 2017 20:17:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5102287B0 for ; Wed, 26 Jul 2017 20:17:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7C91287B5; Wed, 26 Jul 2017 20:17:47 +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 476E4287B0 for ; Wed, 26 Jul 2017 20:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750952AbdGZURq (ORCPT ); Wed, 26 Jul 2017 16:17:46 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:43230 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbdGZURq (ORCPT ); Wed, 26 Jul 2017 16:17:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PVOe7e665O/jxTMWjAkF1u3jzXCzKKLYkCrHDM9WdGQ=; b=UGK+holeG09CIpWSCv5HYrHC/ iam7XK/wNocTX0NriIt5DEQlt4csnJUOTwxxzCMZtmfnDCInt+tyyQO9hEgL92+yFxD+fiuOLgxMl Zn+djOaY9FZzWgiFwpY1V1Nnbb/AINATAA0og45o98bTaHSI2q6B57GeIdzBSBXNS2jd4UtGZI7jW X6+cwMnpbnTMNaAdkz1T4DAkXA75ZYylal/4mCcOXLq/GuMSsAlm7bs562af66ETZna+A4wS+ojvm TiDmTgN1OO6Jlume4BlLNlJ2Rgi7WUFjz7gr6PB9p68u3eBU7PEfEwAOq2OIpaD4Gjc/Ymr68LZtp Z8zOfJleg==; 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 1daSkb-0000c2-Bb; Wed, 26 Jul 2017 20:17:45 +0000 From: Christoph Hellwig To: helgaas@kernel.org Cc: linux-pci@vger.kernel.org Subject: [PATCH] PCI/MSI: don't try to apply MSI(-X) affinity for single vectors Date: Wed, 26 Jul 2017 22:17:41 +0200 Message-Id: <20170726201741.4842-1-hch@lst.de> X-Mailer: git-send-email 2.11.0 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'll always get NULL back in that case, so skip the call and the resulting warning. Signed-off-by: Christoph Hellwig --- drivers/pci/msi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 253d92409bb3..19653e5cb68f 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -538,7 +538,7 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd) struct msi_desc *entry; u16 control; - if (affd) { + if (affd && nvec > 1) { masks = irq_create_affinity_masks(nvec, affd); if (!masks) dev_err(&dev->dev, "can't allocate MSI affinity masks for %d vectors\n", @@ -679,7 +679,7 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base, struct msi_desc *entry; int ret, i; - if (affd) { + if (affd && nvec > 1) { masks = irq_create_affinity_masks(nvec, affd); if (!masks) dev_err(&dev->dev, "can't allocate MSI-X affinity masks for %d vectors\n",