From e96e2f148060330f6178b502574dcb81eb7318bf Mon Sep 17 00:00:00 2001 From: Daniele Gaffuri Date: Fri, 29 Jul 2005 12:15:46 -0700 Subject: [PATCH] PCI: Hidden SMBus bridge on Toshiba Tecra M2 Patch against 2.6.12 to unhide SMBus on Toshiba Centrino laptops using Intel 82855PM chipset. Tested on Toshiba Tecra M2. Signed-off-by: Daniele Gaffuri Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- drivers/pci/quirks.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/pci') diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 1521fd5d95c..8d0968bd527 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -820,6 +820,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) case 0x0001: /* Toshiba Satellite A40 */ asus_hides_smbus = 1; } + if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) + switch(dev->subsystem_device) { + case 0x0001: /* Toshiba Tecra M2 */ + asus_hides_smbus = 1; + } } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch(dev->subsystem_device) { -- cgit v1.2.3 From 761a3ac08c63718dacde12aaf0ec6d6760e8c2b7 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Fri, 29 Jul 2005 12:16:17 -0700 Subject: [PATCH] PCI: Adjust PCI rom code to handle more broken ROMs There are ROMs reporting that their size exceeds their PCI ROM resource window. This patch returns the minimum of the resource window size or the size in the ROM. An example of this breakage is the XGI Volari Z7. Signed-off-by: Jon Smirl Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- drivers/pci/rom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/pci') diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 838575e3fac..713c78f3a65 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c @@ -125,7 +125,9 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) image += readw(pds + 16) * 512; } while (!last_image); - *size = image - rom; + /* never return a size larger than the PCI resource window */ + /* there are known ROMs that get the size wrong */ + *size = min((size_t)(image - rom), *size); return rom; } -- cgit v1.2.3 From 10f4338ca8534823bc6c843edbbe42fd4e73d258 Mon Sep 17 00:00:00 2001 From: Ivan Kokshaysky Date: Fri, 29 Jul 2005 12:16:22 -0700 Subject: [PATCH] PCI: remove PCI_BRIDGE_CTL_VGA handling from setup-bus.c The setup-bus code doesn't work correctly for configurations with more than one display adapter in the same PCI domain. This stuff actually is a leftover of an early 2.4 PCI setup code and apparently it stopped working after some "bridge_ctl" changes. So the best thing we can do is just to remove it and rely on the fact that any firmware *has* to configure VGA port forwarding for the boot display device properly. But then we need to ensure that the bus->bridge_ctl will always contain valid information collected at the probe time, therefore the following change in pci_scan_bridge() is needed. Signed-off-by: Ivan Kokshaysky Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- drivers/pci/probe.c | 2 +- drivers/pci/setup-bus.c | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'drivers/pci') diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index df3bdae2040..93e8a878ea9 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -507,7 +507,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max pci_write_config_dword(dev, PCI_PRIMARY_BUS, buses); if (!is_cardbus) { - child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; + child->bridge_ctl = bctl | PCI_BRIDGE_CTL_NO_ISA; /* * Adjust subordinate busnr in parent buses. * We do this before scanning for children because diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 9fe48f712be..a2eebc6eaac 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -51,8 +51,6 @@ pbus_assign_resources_sorted(struct pci_bus *bus) struct resource_list head, *list, *tmp; int idx; - bus->bridge_ctl &= ~PCI_BRIDGE_CTL_VGA; - head.next = NULL; list_for_each_entry(dev, &bus->devices, bus_list) { u16 class = dev->class >> 8; @@ -62,10 +60,6 @@ pbus_assign_resources_sorted(struct pci_bus *bus) class == PCI_CLASS_BRIDGE_HOST) continue; - if (class == PCI_CLASS_DISPLAY_VGA || - class == PCI_CLASS_NOT_DEFINED_VGA) - bus->bridge_ctl |= PCI_BRIDGE_CTL_VGA; - pdev_sort_resources(dev, &head); } @@ -509,12 +503,6 @@ pci_bus_assign_resources(struct pci_bus *bus) pbus_assign_resources_sorted(bus); - if (bus->bridge_ctl & PCI_BRIDGE_CTL_VGA) { - /* Propagate presence of the VGA to upstream bridges */ - for (b = bus; b->parent; b = b->parent) { - b->bridge_ctl |= PCI_BRIDGE_CTL_VGA; - } - } list_for_each_entry(dev, &bus->devices, bus_list) { b = dev->subordinate; if (!b) -- cgit v1.2.3