[{"id":1755305,"web_url":"http://patchwork.ozlabs.org/comment/1755305/","msgid":"<alpine.LRH.2.20.1708231724340.9040@math.ut.ee>","list_archive_url":null,"date":"2017-08-23T14:24:54","subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","submitter":{"id":555,"url":"http://patchwork.ozlabs.org/api/people/555/","name":"Meelis Roos","email":"mroos@linux.ee"},"content":"> irq_create_affinity_masks can easily return NULL when there are not\n> enough \"free\" vectors available to spread, while the memory allocation\n> failure for the CPU masks not only is unlikely, but also relatively\n> harmless as the system will work just fine except for non-optimally\n> spread vectors.  Thus remove the warnings.\n> \n> Signed-off-by: Christoph Hellwig <hch@lst.de>\n\nYes, this makes the warning go away but driver still loads.\n\n\n> ---\n>  drivers/pci/msi.c | 13 +++----------\n>  1 file changed, 3 insertions(+), 10 deletions(-)\n> \n> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c\n> index 253d92409bb3..2225afc1cbbb 100644\n> --- a/drivers/pci/msi.c\n> +++ b/drivers/pci/msi.c\n> @@ -538,12 +538,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd)\n>  \tstruct msi_desc *entry;\n>  \tu16 control;\n>  \n> -\tif (affd) {\n> +\tif (affd)\n>  \t\tmasks = irq_create_affinity_masks(nvec, affd);\n> -\t\tif (!masks)\n> -\t\t\tdev_err(&dev->dev, \"can't allocate MSI affinity masks for %d vectors\\n\",\n> -\t\t\t\tnvec);\n> -\t}\n> +\n>  \n>  \t/* MSI Entry Initialization */\n>  \tentry = alloc_msi_entry(&dev->dev, nvec, masks);\n> @@ -679,12 +676,8 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,\n>  \tstruct msi_desc *entry;\n>  \tint ret, i;\n>  \n> -\tif (affd) {\n> +\tif (affd)\n>  \t\tmasks = irq_create_affinity_masks(nvec, affd);\n> -\t\tif (!masks)\n> -\t\t\tdev_err(&dev->dev, \"can't allocate MSI-X affinity masks for %d vectors\\n\",\n> -\t\t\t\tnvec);\n> -\t}\n>  \n>  \tfor (i = 0, curmsk = masks; i < nvec; i++) {\n>  \t\tentry = alloc_msi_entry(&dev->dev, 1, curmsk);\n>","headers":{"Return-Path":"<linux-pci-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcqSr6TCvz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 Aug 2017 00:25:00 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754053AbdHWOY7 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 23 Aug 2017 10:24:59 -0400","from smtp1.it.da.ut.ee ([193.40.5.66]:57426 \"EHLO\n\tsmtp1.it.da.ut.ee\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S932127AbdHWOY6 (ORCPT <rfc822;linux-pci@vger.kernel.org>);\n\tWed, 23 Aug 2017 10:24:58 -0400","from math.ut.ee (unknown\n\t[IPv6:2001:bb8:2002:2400:5054:ff:fe3b:8db9])\n\tby smtp1.it.da.ut.ee (Postfix) with ESMTP id 0AEE6900B2;\n\tWed, 23 Aug 2017 17:24:56 +0300 (EEST)","by math.ut.ee (Postfix, from userid 1014)\n\tid F0D19221A5F; Wed, 23 Aug 2017 17:24:54 +0300 (EEST)","from localhost (localhost [127.0.0.1])\n\tby math.ut.ee (Postfix) with ESMTP id 2C4A32217C4;\n\tWed, 23 Aug 2017 17:24:54 +0300 (EEST)"],"Date":"Wed, 23 Aug 2017 17:24:54 +0300 (EEST)","From":"Meelis Roos <mroos@linux.ee>","To":"Christoph Hellwig <hch@lst.de>","cc":"helgaas@kernel.org, davem@davemloft.net, linux-pci@vger.kernel.org","Subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","In-Reply-To":"<20170823115459.2058-1-hch@lst.de>","Message-ID":"<alpine.LRH.2.20.1708231724340.9040@math.ut.ee>","References":"<20170823115459.2058-1-hch@lst.de>","User-Agent":"Alpine 2.20 (LRH 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Sender":"linux-pci-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-pci.vger.kernel.org>","X-Mailing-List":"linux-pci@vger.kernel.org"}},{"id":1755594,"web_url":"http://patchwork.ozlabs.org/comment/1755594/","msgid":"<20170823.114705.2104676201534244497.davem@davemloft.net>","list_archive_url":null,"date":"2017-08-23T18:47:05","subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Christoph Hellwig <hch@lst.de>\nDate: Wed, 23 Aug 2017 13:54:59 +0200\n\n> irq_create_affinity_masks can easily return NULL when there are not\n> enough \"free\" vectors available to spread, while the memory allocation\n> failure for the CPU masks not only is unlikely, but also relatively\n> harmless as the system will work just fine except for non-optimally\n> spread vectors.  Thus remove the warnings.\n> \n> Signed-off-by: Christoph Hellwig <hch@lst.de>\n\nAcked-by: David S. Miller <davem@davemloft.net>","headers":{"Return-Path":"<linux-pci-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcxHP2Ptwz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 Aug 2017 04:47:13 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932458AbdHWSrL (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 23 Aug 2017 14:47:11 -0400","from shards.monkeyblade.net ([184.105.139.130]:46742 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932518AbdHWSrG (ORCPT\n\t<rfc822; linux-pci@vger.kernel.org>); Wed, 23 Aug 2017 14:47:06 -0400","from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net\n\t[74.93.104.98]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id 2AB921342715F;\n\tWed, 23 Aug 2017 11:47:06 -0700 (PDT)"],"Date":"Wed, 23 Aug 2017 11:47:05 -0700 (PDT)","Message-Id":"<20170823.114705.2104676201534244497.davem@davemloft.net>","To":"hch@lst.de","Cc":"helgaas@kernel.org, mroos@linux.ee, linux-pci@vger.kernel.org","Subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<20170823115459.2058-1-hch@lst.de>","References":"<20170823115459.2058-1-hch@lst.de>","X-Mailer":"Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Wed, 23 Aug 2017 11:47:06 -0700 (PDT)","Sender":"linux-pci-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-pci.vger.kernel.org>","X-Mailing-List":"linux-pci@vger.kernel.org"}},{"id":1757868,"web_url":"http://patchwork.ozlabs.org/comment/1757868/","msgid":"<20170826000055.GC8154@bhelgaas-glaptop.roam.corp.google.com>","list_archive_url":null,"date":"2017-08-26T00:00:55","subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","submitter":{"id":67298,"url":"http://patchwork.ozlabs.org/api/people/67298/","name":"Bjorn Helgaas","email":"helgaas@kernel.org"},"content":"On Wed, Aug 23, 2017 at 01:54:59PM +0200, Christoph Hellwig wrote:\n> irq_create_affinity_masks can easily return NULL when there are not\n> enough \"free\" vectors available to spread, while the memory allocation\n> failure for the CPU masks not only is unlikely, but also relatively\n> harmless as the system will work just fine except for non-optimally\n> spread vectors.  Thus remove the warnings.\n> \n> Signed-off-by: Christoph Hellwig <hch@lst.de>\n\nI applied this with David's ack to for-linus for v4.13.  It's not\nstrictly speaking a bug fix, but I think the warnings would cause\nneedless alarm for v4.13 users.\n\n> ---\n>  drivers/pci/msi.c | 13 +++----------\n>  1 file changed, 3 insertions(+), 10 deletions(-)\n> \n> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c\n> index 253d92409bb3..2225afc1cbbb 100644\n> --- a/drivers/pci/msi.c\n> +++ b/drivers/pci/msi.c\n> @@ -538,12 +538,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd)\n>  \tstruct msi_desc *entry;\n>  \tu16 control;\n>  \n> -\tif (affd) {\n> +\tif (affd)\n>  \t\tmasks = irq_create_affinity_masks(nvec, affd);\n> -\t\tif (!masks)\n> -\t\t\tdev_err(&dev->dev, \"can't allocate MSI affinity masks for %d vectors\\n\",\n> -\t\t\t\tnvec);\n> -\t}\n> +\n>  \n>  \t/* MSI Entry Initialization */\n>  \tentry = alloc_msi_entry(&dev->dev, nvec, masks);\n> @@ -679,12 +676,8 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,\n>  \tstruct msi_desc *entry;\n>  \tint ret, i;\n>  \n> -\tif (affd) {\n> +\tif (affd)\n>  \t\tmasks = irq_create_affinity_masks(nvec, affd);\n> -\t\tif (!masks)\n> -\t\t\tdev_err(&dev->dev, \"can't allocate MSI-X affinity masks for %d vectors\\n\",\n> -\t\t\t\tnvec);\n> -\t}\n>  \n>  \tfor (i = 0, curmsk = masks; i < nvec; i++) {\n>  \t\tentry = alloc_msi_entry(&dev->dev, 1, curmsk);\n> -- \n> 2.11.0\n>","headers":{"Return-Path":"<linux-pci-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","mail.kernel.org;\n\tdmarc=none (p=none dis=none) header.from=kernel.org","mail.kernel.org;\n\tspf=none smtp.mailfrom=helgaas@kernel.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xfJ8W2Jd6z9t3w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 26 Aug 2017 10:00:59 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756838AbdHZAA5 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 25 Aug 2017 20:00:57 -0400","from mail.kernel.org ([198.145.29.99]:43592 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1756757AbdHZAA5 (ORCPT <rfc822;linux-pci@vger.kernel.org>);\n\tFri, 25 Aug 2017 20:00:57 -0400","from localhost (unknown [69.71.4.159])\n\t(using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))\n\t(No client certificate requested)\n\tby mail.kernel.org (Postfix) with ESMTPSA id B426121A2F;\n\tSat, 26 Aug 2017 00:00:56 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mail.kernel.org B426121A2F","Date":"Fri, 25 Aug 2017 19:00:55 -0500","From":"Bjorn Helgaas <helgaas@kernel.org>","To":"Christoph Hellwig <hch@lst.de>","Cc":"davem@davemloft.net, mroos@linux.ee, linux-pci@vger.kernel.org","Subject":"Re: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL\n\treturn","Message-ID":"<20170826000055.GC8154@bhelgaas-glaptop.roam.corp.google.com>","References":"<20170823115459.2058-1-hch@lst.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170823115459.2058-1-hch@lst.de>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Sender":"linux-pci-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-pci.vger.kernel.org>","X-Mailing-List":"linux-pci@vger.kernel.org"}}]