Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2059

kernel-2.6.18-238.el5.src.rpm

From: Jun'ichi \"Nick\" Nomura <jnomura@redhat.com>
Date: Fri, 14 Dec 2007 17:51:33 -0500
Subject: [misc] pci rom: reduce number of failure messages
Message-id: 476308F5.8040605@redhat.com
O-Subject: Re: [RHEL5.2 PATCH] Do not print "PCI: Failed to allocate mem resource" for expansion ROMs and bridges
Bugzilla: 217698

This patch solves BZ#217698:
"PCI: Failed to allocate mem resource." on systems with expansion ROMs
https://bugzilla.redhat.com/show_bug.cgi?id=217698

The patch is not yet accepted in upstream as the upstream discussion
has not yet been concluded by now. Alternative to this patch is not
to allocate resource for expansion ROMs at all.
It's possible that the alternative will be in upstream eventually.
http://lkml.org/lkml/2007/12/4/284
http://lkml.org/lkml/2007/12/11/359
http://lkml.org/lkml/2007/12/11/361

The patch has no effect on the machines on which the message has not
appeared.

The bug is not critical but fixing this would save possible
support calls as the "Failed to allocate" message looks alarming.

Thanks,
--
Jun'ichi "Nick" Nomura / On-site engineer from NEC

Acked-by: Pete Zaitcev <zaitcev@redhat.com>

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index ab78e4b..c8b4aef 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -148,11 +148,18 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
 	}
 
 	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
+			printk("PCI: %s resource #%d:%llx@%llx for %s "
+				"was not allocated.\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);
 	}