diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index ed6f89b6efe5..903d5078b5ed 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -324,18 +324,52 @@ static void quirk_s3_64M(struct pci_dev *dev) | |||
324 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M); | 324 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M); |
325 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M); | 325 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M); |
326 | 326 | ||
327 | static void quirk_io(struct pci_dev *dev, int pos, unsigned size, | ||
328 | const char *name) | ||
329 | { | ||
330 | u32 region; | ||
331 | struct pci_bus_region bus_region; | ||
332 | struct resource *res = dev->resource + pos; | ||
333 | |||
334 | pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (pos << 2), ®ion); | ||
335 | |||
336 | if (!region) | ||
337 | return; | ||
338 | |||
339 | res->name = pci_name(dev); | ||
340 | res->flags = region & ~PCI_BASE_ADDRESS_IO_MASK; | ||
341 | res->flags |= | ||
342 | (IORESOURCE_IO | IORESOURCE_PCI_FIXED | IORESOURCE_SIZEALIGN); | ||
343 | region &= ~(size - 1); | ||
344 | |||
345 | /* Convert from PCI bus to resource space */ | ||
346 | bus_region.start = region; | ||
347 | bus_region.end = region + size - 1; | ||
348 | pcibios_bus_to_resource(dev->bus, res, &bus_region); | ||
349 | |||
350 | dev_info(&dev->dev, FW_BUG "%s quirk: reg 0x%x: %pR\n", | ||
351 | name, PCI_BASE_ADDRESS_0 + (pos << 2), res); | ||
352 | } | ||
353 | |||
327 | /* | 354 | /* |
328 | * Some CS5536 BIOSes (for example, the Soekris NET5501 board w/ comBIOS | 355 | * Some CS5536 BIOSes (for example, the Soekris NET5501 board w/ comBIOS |
329 | * ver. 1.33 20070103) don't set the correct ISA PCI region header info. | 356 | * ver. 1.33 20070103) don't set the correct ISA PCI region header info. |
330 | * BAR0 should be 8 bytes; instead, it may be set to something like 8k | 357 | * BAR0 should be 8 bytes; instead, it may be set to something like 8k |
331 | * (which conflicts w/ BAR1's memory range). | 358 | * (which conflicts w/ BAR1's memory range). |
359 | * | ||
360 | * CS553x's ISA PCI BARs may also be read-only (ref: | ||
361 | * https://bugzilla.kernel.org/show_bug.cgi?id=85991 - Comment #4 forward). | ||
332 | */ | 362 | */ |
333 | static void quirk_cs5536_vsa(struct pci_dev *dev) | 363 | static void quirk_cs5536_vsa(struct pci_dev *dev) |
334 | { | 364 | { |
365 | static char *name = "CS5536 ISA bridge"; | ||
366 | |||
335 | if (pci_resource_len(dev, 0) != 8) { | 367 | if (pci_resource_len(dev, 0) != 8) { |
336 | struct resource *res = &dev->resource[0]; | 368 | quirk_io(dev, 0, 8, name); /* SMB */ |
337 | res->end = res->start + 8 - 1; | 369 | quirk_io(dev, 1, 256, name); /* GPIO */ |
338 | dev_info(&dev->dev, "CS5536 ISA bridge bug detected (incorrect header); workaround applied\n"); | 370 | quirk_io(dev, 2, 64, name); /* MFGPT */ |
371 | dev_info(&dev->dev, "%s bug detected (incorrect header); workaround applied\n", | ||
372 | name); | ||
339 | } | 373 | } |
340 | } | 374 | } |
341 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa); | 375 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa); |
@@ -3028,6 +3062,20 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169, | |||
3028 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID, | 3062 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID, |
3029 | quirk_broken_intx_masking); | 3063 | quirk_broken_intx_masking); |
3030 | 3064 | ||
3065 | static void quirk_no_bus_reset(struct pci_dev *dev) | ||
3066 | { | ||
3067 | dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; | ||
3068 | } | ||
3069 | |||
3070 | /* | ||
3071 | * Atheros AR93xx chips do not behave after a bus reset. The device will | ||
3072 | * throw a Link Down error on AER-capable systems and regardless of AER, | ||
3073 | * config space of the device is never accessible again and typically | ||
3074 | * causes the system to hang or reset when access is attempted. | ||
3075 | * http://www.spinics.net/lists/linux-pci/msg34797.html | ||
3076 | */ | ||
3077 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset); | ||
3078 | |||
3031 | #ifdef CONFIG_ACPI | 3079 | #ifdef CONFIG_ACPI |
3032 | /* | 3080 | /* |
3033 | * Apple: Shutdown Cactus Ridge Thunderbolt controller. | 3081 | * Apple: Shutdown Cactus Ridge Thunderbolt controller. |