diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-20 03:02:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-20 03:02:39 -0500 |
commit | fbc2a06056c9aa3cb8c44bf1cfeb1d260e229e5c (patch) | |
tree | feb2a1c13ad3dff5a8c7ab3c0265e8eca7a0c5a3 /drivers/pci | |
parent | a3d732f93785da17e0137210deadb4616f5536fc (diff) | |
parent | ee2f6cc7f9ea2542ad46070ed62ba7aa04d08871 (diff) |
Merge branch 'linus' into x86/uv
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-acpi.c | 18 | ||||
-rw-r--r-- | drivers/pci/pci-sysfs.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci.c | 4 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 50 | ||||
-rw-r--r-- | drivers/pci/rom.c | 6 |
5 files changed, 36 insertions, 44 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index dfe7c8e1b185..ae5ec76dca77 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -63,7 +63,7 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
63 | union acpi_object in_params[4]; | 63 | union acpi_object in_params[4]; |
64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; | 64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
65 | union acpi_object *out_obj; | 65 | union acpi_object *out_obj; |
66 | u32 osc_dw0, flags = osc_args->capbuf[OSC_QUERY_TYPE]; | 66 | u32 errors, flags = osc_args->capbuf[OSC_QUERY_TYPE]; |
67 | 67 | ||
68 | /* Setting up input parameters */ | 68 | /* Setting up input parameters */ |
69 | input.count = 4; | 69 | input.count = 4; |
@@ -83,21 +83,25 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
83 | if (ACPI_FAILURE(status)) | 83 | if (ACPI_FAILURE(status)) |
84 | return status; | 84 | return status; |
85 | 85 | ||
86 | if (!output.length) | ||
87 | return AE_NULL_OBJECT; | ||
88 | |||
86 | out_obj = output.pointer; | 89 | out_obj = output.pointer; |
87 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 90 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
88 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); | 91 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); |
89 | status = AE_TYPE; | 92 | status = AE_TYPE; |
90 | goto out_kfree; | 93 | goto out_kfree; |
91 | } | 94 | } |
92 | osc_dw0 = *((u32 *)out_obj->buffer.pointer); | 95 | /* Need to ignore the bit0 in result code */ |
93 | if (osc_dw0) { | 96 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
94 | if (osc_dw0 & OSC_REQUEST_ERROR) | 97 | if (errors) { |
98 | if (errors & OSC_REQUEST_ERROR) | ||
95 | printk(KERN_DEBUG "_OSC request fails\n"); | 99 | printk(KERN_DEBUG "_OSC request fails\n"); |
96 | if (osc_dw0 & OSC_INVALID_UUID_ERROR) | 100 | if (errors & OSC_INVALID_UUID_ERROR) |
97 | printk(KERN_DEBUG "_OSC invalid UUID\n"); | 101 | printk(KERN_DEBUG "_OSC invalid UUID\n"); |
98 | if (osc_dw0 & OSC_INVALID_REVISION_ERROR) | 102 | if (errors & OSC_INVALID_REVISION_ERROR) |
99 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 103 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
100 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 104 | if (errors & OSC_CAPABILITIES_MASK_ERROR) { |
101 | if (flags & OSC_QUERY_ENABLE) | 105 | if (flags & OSC_QUERY_ENABLE) |
102 | goto out_success; | 106 | goto out_success; |
103 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); | 107 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 110022d78689..5d72866897a8 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -575,7 +575,7 @@ static int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct | |||
575 | 575 | ||
576 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 576 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
577 | start = vma->vm_pgoff; | 577 | start = vma->vm_pgoff; |
578 | size = pci_resource_len(pdev, resno) >> PAGE_SHIFT; | 578 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; |
579 | if (start < size && size - start >= nr) | 579 | if (start < size && size - start >= nr) |
580 | return 1; | 580 | return 1; |
581 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", | 581 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 21f2ac639cab..28af496b441e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1832,7 +1832,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) | 1832 | if (!(cap & PCI_EXP_DEVCAP_FLR)) |
1833 | return -ENOTTY; | 1833 | return -ENOTTY; |
1834 | 1834 | ||
1835 | if (!dev->msi_enabled && !dev->msix_enabled) | 1835 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1836 | disable_irq(dev->irq); | 1836 | disable_irq(dev->irq); |
1837 | pci_save_state(dev); | 1837 | pci_save_state(dev); |
1838 | 1838 | ||
@@ -1841,7 +1841,7 @@ int pci_reset_function(struct pci_dev *dev) | |||
1841 | r = pci_execute_reset_function(dev); | 1841 | r = pci_execute_reset_function(dev); |
1842 | 1842 | ||
1843 | pci_restore_state(dev); | 1843 | pci_restore_state(dev); |
1844 | if (!dev->msi_enabled && !dev->msix_enabled) | 1844 | if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0) |
1845 | enable_irq(dev->irq); | 1845 | enable_irq(dev->irq); |
1846 | 1846 | ||
1847 | return r; | 1847 | return r; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 96cf8ecd04ce..5049a47030ac 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -43,20 +43,6 @@ static void __devinit quirk_mellanox_tavor(struct pci_dev *dev) | |||
43 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); | 43 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); |
44 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); | 44 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); |
45 | 45 | ||
46 | /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | ||
47 | int forbid_dac __read_mostly; | ||
48 | EXPORT_SYMBOL(forbid_dac); | ||
49 | |||
50 | static __devinit void via_no_dac(struct pci_dev *dev) | ||
51 | { | ||
52 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | ||
53 | dev_info(&dev->dev, | ||
54 | "VIA PCI bridge detected. Disabling DAC.\n"); | ||
55 | forbid_dac = 1; | ||
56 | } | ||
57 | } | ||
58 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | ||
59 | |||
60 | /* Deal with broken BIOS'es that neglect to enable passive release, | 46 | /* Deal with broken BIOS'es that neglect to enable passive release, |
61 | which can cause problems in combination with the 82441FX/PPro MTRRs */ | 47 | which can cause problems in combination with the 82441FX/PPro MTRRs */ |
62 | static void quirk_passive_release(struct pci_dev *dev) | 48 | static void quirk_passive_release(struct pci_dev *dev) |
@@ -1706,24 +1692,24 @@ static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev) | |||
1706 | } | 1692 | } |
1707 | } | 1693 | } |
1708 | 1694 | ||
1709 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1695 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1710 | PCI_DEVICE_ID_NX2_5706, | 1696 | PCI_DEVICE_ID_NX2_5706, |
1711 | quirk_brcm_570x_limit_vpd); | 1697 | quirk_brcm_570x_limit_vpd); |
1712 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1698 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1713 | PCI_DEVICE_ID_NX2_5706S, | 1699 | PCI_DEVICE_ID_NX2_5706S, |
1714 | quirk_brcm_570x_limit_vpd); | 1700 | quirk_brcm_570x_limit_vpd); |
1715 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1701 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1716 | PCI_DEVICE_ID_NX2_5708, | 1702 | PCI_DEVICE_ID_NX2_5708, |
1717 | quirk_brcm_570x_limit_vpd); | 1703 | quirk_brcm_570x_limit_vpd); |
1718 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1704 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1719 | PCI_DEVICE_ID_NX2_5708S, | 1705 | PCI_DEVICE_ID_NX2_5708S, |
1720 | quirk_brcm_570x_limit_vpd); | 1706 | quirk_brcm_570x_limit_vpd); |
1721 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1707 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1722 | PCI_DEVICE_ID_NX2_5709, | 1708 | PCI_DEVICE_ID_NX2_5709, |
1723 | quirk_brcm_570x_limit_vpd); | 1709 | quirk_brcm_570x_limit_vpd); |
1724 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1710 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
1725 | PCI_DEVICE_ID_NX2_5709S, | 1711 | PCI_DEVICE_ID_NX2_5709S, |
1726 | quirk_brcm_570x_limit_vpd); | 1712 | quirk_brcm_570x_limit_vpd); |
1727 | 1713 | ||
1728 | #ifdef CONFIG_PCI_MSI | 1714 | #ifdef CONFIG_PCI_MSI |
1729 | /* Some chipsets do not support MSI. We cannot easily rely on setting | 1715 | /* Some chipsets do not support MSI. We cannot easily rely on setting |
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 1f5f6143f35c..132a78159b60 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
@@ -100,7 +100,8 @@ size_t pci_get_rom_size(void __iomem *rom, size_t size) | |||
100 | * pci_map_rom - map a PCI ROM to kernel space | 100 | * pci_map_rom - map a PCI ROM to kernel space |
101 | * @pdev: pointer to pci device struct | 101 | * @pdev: pointer to pci device struct |
102 | * @size: pointer to receive size of pci window over ROM | 102 | * @size: pointer to receive size of pci window over ROM |
103 | * @return: kernel virtual pointer to image of ROM | 103 | * |
104 | * Return: kernel virtual pointer to image of ROM | ||
104 | * | 105 | * |
105 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, | 106 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, |
106 | * the shadow BIOS copy will be returned instead of the | 107 | * the shadow BIOS copy will be returned instead of the |
@@ -167,7 +168,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
167 | * pci_map_rom_copy - map a PCI ROM to kernel space, create a copy | 168 | * pci_map_rom_copy - map a PCI ROM to kernel space, create a copy |
168 | * @pdev: pointer to pci device struct | 169 | * @pdev: pointer to pci device struct |
169 | * @size: pointer to receive size of pci window over ROM | 170 | * @size: pointer to receive size of pci window over ROM |
170 | * @return: kernel virtual pointer to image of ROM | 171 | * |
172 | * Return: kernel virtual pointer to image of ROM | ||
171 | * | 173 | * |
172 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, | 174 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, |
173 | * the shadow BIOS copy will be returned instead of the | 175 | * the shadow BIOS copy will be returned instead of the |