From: Christoph Hellwig <hch@lst.de>
To: helgaas@kernel.org
Cc: davem@davemloft.net, mroos@linux.ee, linux-pci@vger.kernel.org
Subject: [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL return
Date: Wed, 23 Aug 2017 13:54:59 +0200 [thread overview]
Message-ID: <20170823115459.2058-1-hch@lst.de> (raw)
irq_create_affinity_masks can easily return NULL when there are not
enough "free" vectors available to spread, while the memory allocation
failure for the CPU masks not only is unlikely, but also relatively
harmless as the system will work just fine except for non-optimally
spread vectors. Thus remove the warnings.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/pci/msi.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 253d92409bb3..2225afc1cbbb 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -538,12 +538,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd)
struct msi_desc *entry;
u16 control;
- if (affd) {
+ if (affd)
masks = irq_create_affinity_masks(nvec, affd);
- if (!masks)
- dev_err(&dev->dev, "can't allocate MSI affinity masks for %d vectors\n",
- nvec);
- }
+
/* MSI Entry Initialization */
entry = alloc_msi_entry(&dev->dev, nvec, masks);
@@ -679,12 +676,8 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
struct msi_desc *entry;
int ret, i;
- if (affd) {
+ if (affd)
masks = irq_create_affinity_masks(nvec, affd);
- if (!masks)
- dev_err(&dev->dev, "can't allocate MSI-X affinity masks for %d vectors\n",
- nvec);
- }
for (i = 0, curmsk = masks; i < nvec; i++) {
entry = alloc_msi_entry(&dev->dev, 1, curmsk);
--
2.11.0
next reply other threads:[~2017-08-23 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 11:54 Christoph Hellwig [this message]
2017-08-23 14:24 ` [PATCH] PCI/msi: don't warn on irq_create_affinity_masks NULL return Meelis Roos
2017-08-23 18:47 ` David Miller
2017-08-26 0:00 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170823115459.2058-1-hch@lst.de \
--to=hch@lst.de \
--cc=davem@davemloft.net \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mroos@linux.ee \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).