public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: linux-kernel@vger.kernel.org
Cc: linux-pci@atrey.karlin.mff.cuni.cz, Greg KH <gregkh@suse.de>
Subject: [PATCH] pci: Omit error message for benign allocation failure
Date: Tue, 04 Dec 2007 14:35:48 -0500	[thread overview]
Message-ID: <4755AC14.20605@ce.jp.nec.com> (raw)

Hi,

On a system with PCI-to-PCI bridges, following errors are observed:

PCI: Failed to allocate mem resource #8:100000@d8200000 for 0000:02:00.0
PCI: Failed to allocate mem resource #6:10000@0 for 0000:03:01.0

'#6' is for expansion ROM and '#8' for the bridge where the device
with the expansion ROM is connected.
But I think the failure is benign because the allocation is
not necessary for these resources.

The allocation failure message is informative when the failure
is really a problem and needs a diagnosis.
However, if the resource is expansion ROMs, the message is just
confusing.

This patch omits the error message if the resource is an expansion
ROM or a bridge.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America


Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

--- linux-2.6.24-rc3/drivers/pci/setup-res.c.orig	2007-12-04 00:24:11.000000000 -0500
+++ linux-2.6.24-rc3/drivers/pci/setup-res.c	2007-12-04 00:42:14.000000000 -0500
@@ -158,11 +158,12 @@ int pci_assign_resource(struct pci_dev *
 	}
 
 	if (ret) {
-		printk(KERN_ERR "PCI: Failed to allocate %s resource "
-			"#%d:%llx@%llx for %s\n",
-			res->flags & IORESOURCE_IO ? "I/O" : "mem",
-			resno, (unsigned long long)size,
-			(unsigned long long)res->start, pci_name(dev));
+		if (resno < PCI_ROM_RESOURCE)
+			printk(KERN_ERR "PCI: Failed to allocate %s resource "
+				"#%d:%llx@%llx for %s\n",
+				res->flags & IORESOURCE_IO ? "I/O" : "mem",
+				resno, (unsigned long long)size,
+				(unsigned long long)res->start, pci_name(dev));
 	} else if (resno < PCI_BRIDGE_RESOURCES) {
 		pci_update_resource(dev, res, resno);
 	}

             reply	other threads:[~2007-12-04 19:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 19:35 Jun'ichi Nomura [this message]
2007-12-04 21:49 ` [PATCH] pci: Omit error message for benign allocation failure Gary Hade
2007-12-04 23:23   ` Jun'ichi Nomura
2007-12-05  1:45     ` Gary Hade
2007-12-05 15:18       ` Jun'ichi Nomura
2007-12-05 22:47         ` Gary Hade

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=4755AC14.20605@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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