From: Yinghai Lu Date: Sun, 28 Feb 2010 23:49:39 +0000 (-0800) Subject: pci: don't reassign to ROM res if it is not going to be enabled X-Git-Tag: v2.6.34-rc1~247 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=9a928660c9dcaff568c9d379655c5aa16fb981f8 pci: don't reassign to ROM res if it is not going to be enabled A ROM resource that doesn't fit should not cause us to try to re-assign all the bus resources. Nobody generally cares, and re-assigning is going to just cause way more troubles than it tries to solve. Signed-off-by: Yinghai Lu Signed-off-by: Linus Torvalds --- diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index bf32f07..4fe36d2 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -101,9 +101,17 @@ static void __assign_resources_sorted(struct resource_list *head, for (list = head->next; list;) { res = list->res; idx = res - &list->dev->resource[0]; + if (pci_assign_resource(list->dev, idx)) { - if (fail_head && !pci_is_root_bus(list->dev->bus)) - add_to_failed_list(fail_head, list->dev, res); + if (fail_head && !pci_is_root_bus(list->dev->bus)) { + /* + * if the failed res is for ROM BAR, and it will + * be enabled later, don't add it to the list + */ + if (!((idx == PCI_ROM_RESOURCE) && + (!(res->flags & IORESOURCE_ROM_ENABLE)))) + add_to_failed_list(fail_head, list->dev, res); + } res->start = 0; res->end = 0; res->flags = 0;