aboutsummaryrefslogtreecommitdiffstats
path: root/pci
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-12-14 11:08:28 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-12-14 11:08:28 -0800
commite62d1a68ce38e18af8fac4d09916eebc4fb9d1cd (patch)
tree48ca2295fc13e2d91e37d04c0128d8fc0d357784 /pci
parentcb800587b993a7c4b8c30a42b1304c148a49e8a9 (diff)
downloadpatches-e62d1a68ce38e18af8fac4d09916eebc4fb9d1cd.tar.gz
refresh for 2.6.15-rc5-git4
Diffstat (limited to 'pci')
-rw-r--r--pci/drivers-block-replace-pci_module_init-with-pci_register_driver.patch4
-rw-r--r--pci/drivers-net-replace-pci_module_init-with-pci_register_driver.patch6
-rw-r--r--pci/drivers-scsi-replace-pci_module_init-with-pci_register_driver.patch4
-rw-r--r--pci/i386-x86-64-implement-fallback-for-pci-mmconfig-to-type1.patch201
-rw-r--r--pci/shot-accross-the-bow.patch2
-rw-r--r--pci/x86_64-i386-correct-for-broken-mcfg-tables-on-k8-systems.patch193
6 files changed, 8 insertions, 402 deletions
diff --git a/pci/drivers-block-replace-pci_module_init-with-pci_register_driver.patch b/pci/drivers-block-replace-pci_module_init-with-pci_register_driver.patch
index 9ed124e26d38b..b3b035b10cc49 100644
--- a/pci/drivers-block-replace-pci_module_init-with-pci_register_driver.patch
+++ b/pci/drivers-block-replace-pci_module_init-with-pci_register_driver.patch
@@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- gregkh-2.6.orig/drivers/block/cciss.c
+++ gregkh-2.6/drivers/block/cciss.c
-@@ -3275,7 +3275,7 @@ static int __init cciss_init(void)
+@@ -3274,7 +3274,7 @@ static int __init cciss_init(void)
printk(KERN_INFO DRIVER_NAME "\n");
/* Register for our PCI devices */
@@ -102,7 +102,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static void bttv_cleanup_module(void)
--- gregkh-2.6.orig/drivers/media/video/saa7134/saa7134-core.c
+++ gregkh-2.6/drivers/media/video/saa7134/saa7134-core.c
-@@ -1155,7 +1155,7 @@ static int saa7134_init(void)
+@@ -1156,7 +1156,7 @@ static int saa7134_init(void)
printk(KERN_INFO "saa7130/34: snapshot date %04d-%02d-%02d\n",
SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
#endif
diff --git a/pci/drivers-net-replace-pci_module_init-with-pci_register_driver.patch b/pci/drivers-net-replace-pci_module_init-with-pci_register_driver.patch
index 83418ce09101a..664043e9f51bc 100644
--- a/pci/drivers-net-replace-pci_module_init-with-pci_register_driver.patch
+++ b/pci/drivers-net-replace-pci_module_init-with-pci_register_driver.patch
@@ -371,7 +371,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- gregkh-2.6.orig/drivers/net/pcnet32.c
+++ gregkh-2.6/drivers/net/pcnet32.c
-@@ -2513,7 +2513,7 @@ static int __init pcnet32_init_module(vo
+@@ -2508,7 +2508,7 @@ static int __init pcnet32_init_module(vo
tx_start = tx_start_pt;
/* find the PCI devices */
@@ -459,7 +459,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static void __exit skfd_exit(void)
--- gregkh-2.6.orig/drivers/net/skge.c
+++ gregkh-2.6/drivers/net/skge.c
-@@ -3417,7 +3417,7 @@ static struct pci_driver skge_driver = {
+@@ -3419,7 +3419,7 @@ static struct pci_driver skge_driver = {
static int __init skge_init_module(void)
{
@@ -514,7 +514,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static void __exit tc35815_cleanup_module(void)
--- gregkh-2.6.orig/drivers/net/tg3.c
+++ gregkh-2.6/drivers/net/tg3.c
-@@ -10879,7 +10879,7 @@ static struct pci_driver tg3_driver = {
+@@ -10930,7 +10930,7 @@ static struct pci_driver tg3_driver = {
static int __init tg3_init(void)
{
diff --git a/pci/drivers-scsi-replace-pci_module_init-with-pci_register_driver.patch b/pci/drivers-scsi-replace-pci_module_init-with-pci_register_driver.patch
index 60854422c4a5b..a14399fe9b987 100644
--- a/pci/drivers-scsi-replace-pci_module_init-with-pci_register_driver.patch
+++ b/pci/drivers-scsi-replace-pci_module_init-with-pci_register_driver.patch
@@ -296,7 +296,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fc_release_transport(qla2xxx_transport_template);
--- gregkh-2.6.orig/drivers/scsi/sata_mv.c
+++ gregkh-2.6/drivers/scsi/sata_mv.c
-@@ -2229,7 +2229,7 @@ err_out:
+@@ -2230,7 +2230,7 @@ err_out:
static int __init mv_init(void)
{
@@ -384,7 +384,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- gregkh-2.6.orig/drivers/scsi/sata_sx4.c
+++ gregkh-2.6/drivers/scsi/sata_sx4.c
-@@ -1495,7 +1495,7 @@ err_out:
+@@ -1496,7 +1496,7 @@ err_out:
static int __init pdc_sata_init(void)
{
diff --git a/pci/i386-x86-64-implement-fallback-for-pci-mmconfig-to-type1.patch b/pci/i386-x86-64-implement-fallback-for-pci-mmconfig-to-type1.patch
deleted file mode 100644
index 8267a9382c7c5..0000000000000
--- a/pci/i386-x86-64-implement-fallback-for-pci-mmconfig-to-type1.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From ak@muc.de Sun Dec 4 15:36:28 2005
-Date: 4 Dec 2005 19:23:59 +0100
-Date: Sun, 4 Dec 2005 19:23:59 +0100
-From: Andi Kleen <ak@muc.de>
-To: <torvalds@osdl.org>, <akpm@osdl.org>
-Cc: gregkh@suse.de
-Subject: i386/x86-64: Implement fallback for PCI mmconfig to type1
-Message-ID: <20051204182359.GA84932@muc.de>
-Content-Disposition: inline
-
-
-When there is no entry for a bus in MCFG fall back to type1. This is
-especially important on K8 systems where always some devices can't be
-accessed using mmconfig (in particular the builtin northbridge doesn't
-support it for its own devices)
-
-To be complete needs also Jeff's _SEG fixes, but that is something for
-after 2.6.15
-
-Signed-off-by: Andi Kleen <ak@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- arch/i386/pci/direct.c | 4 ++--
- arch/i386/pci/mmconfig.c | 24 ++++++++++++++++--------
- arch/i386/pci/pci.h | 7 +++++++
- arch/x86_64/pci/mmconfig.c | 29 ++++++++++++++++++++---------
- 4 files changed, 45 insertions(+), 19 deletions(-)
-
---- gregkh-2.6.orig/arch/i386/pci/direct.c
-+++ gregkh-2.6/arch/i386/pci/direct.c
-@@ -13,7 +13,7 @@
- #define PCI_CONF1_ADDRESS(bus, devfn, reg) \
- (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
-
--static int pci_conf1_read(unsigned int seg, unsigned int bus,
-+int pci_conf1_read(unsigned int seg, unsigned int bus,
- unsigned int devfn, int reg, int len, u32 *value)
- {
- unsigned long flags;
-@@ -42,7 +42,7 @@ static int pci_conf1_read(unsigned int s
- return 0;
- }
-
--static int pci_conf1_write(unsigned int seg, unsigned int bus,
-+int pci_conf1_write(unsigned int seg, unsigned int bus,
- unsigned int devfn, int reg, int len, u32 value)
- {
- unsigned long flags;
---- gregkh-2.6.orig/arch/i386/pci/pci.h
-+++ gregkh-2.6/arch/i386/pci/pci.h
-@@ -74,3 +74,10 @@ extern spinlock_t pci_config_lock;
-
- extern int (*pcibios_enable_irq)(struct pci_dev *dev);
- extern void (*pcibios_disable_irq)(struct pci_dev *dev);
-+
-+extern int pci_conf1_write(unsigned int seg, unsigned int bus,
-+ unsigned int devfn, int reg, int len, u32 value);
-+extern int pci_conf1_read(unsigned int seg, unsigned int bus,
-+ unsigned int devfn, int reg, int len, u32 *value);
-+
-+
---- gregkh-2.6.orig/arch/i386/pci/mmconfig.c
-+++ gregkh-2.6/arch/i386/pci/mmconfig.c
-@@ -30,10 +30,8 @@ static u32 get_base_addr(unsigned int se
- while (1) {
- ++cfg_num;
- if (cfg_num >= pci_mmcfg_config_num) {
-- /* something bad is going on, no cfg table is found. */
-- /* so we fall back to the old way we used to do this */
-- /* and just rely on the first entry to be correct. */
-- return pci_mmcfg_config[0].base_address;
-+ /* Not found - fallback to type 1 */
-+ return 0;
- }
- cfg = &pci_mmcfg_config[cfg_num];
- if (cfg->pci_segment_group_number != seg)
-@@ -44,9 +42,9 @@ static u32 get_base_addr(unsigned int se
- }
- }
-
--static inline void pci_exp_set_dev_base(unsigned int seg, int bus, int devfn)
-+static inline void pci_exp_set_dev_base(unsigned int base, int bus, int devfn)
- {
-- u32 dev_base = get_base_addr(seg, bus) | (bus << 20) | (devfn << 12);
-+ u32 dev_base = base | (bus << 20) | (devfn << 12);
- if (dev_base != mmcfg_last_accessed_device) {
- mmcfg_last_accessed_device = dev_base;
- set_fixmap_nocache(FIX_PCIE_MCFG, dev_base);
-@@ -57,13 +55,18 @@ static int pci_mmcfg_read(unsigned int s
- unsigned int devfn, int reg, int len, u32 *value)
- {
- unsigned long flags;
-+ u32 base;
-
- if (!value || (bus > 255) || (devfn > 255) || (reg > 4095))
- return -EINVAL;
-
-+ base = get_base_addr(seg, bus);
-+ if (!base)
-+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
-+
- spin_lock_irqsave(&pci_config_lock, flags);
-
-- pci_exp_set_dev_base(seg, bus, devfn);
-+ pci_exp_set_dev_base(base, bus, devfn);
-
- switch (len) {
- case 1:
-@@ -86,13 +89,18 @@ static int pci_mmcfg_write(unsigned int
- unsigned int devfn, int reg, int len, u32 value)
- {
- unsigned long flags;
-+ u32 base;
-
- if ((bus > 255) || (devfn > 255) || (reg > 4095))
- return -EINVAL;
-
-+ base = get_base_addr(seg, bus);
-+ if (!base)
-+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
-+
- spin_lock_irqsave(&pci_config_lock, flags);
-
-- pci_exp_set_dev_base(seg, bus, devfn);
-+ pci_exp_set_dev_base(base, bus, devfn);
-
- switch (len) {
- case 1:
---- gregkh-2.6.orig/arch/x86_64/pci/mmconfig.c
-+++ gregkh-2.6/arch/x86_64/pci/mmconfig.c
-@@ -19,7 +19,7 @@ struct mmcfg_virt {
- };
- static struct mmcfg_virt *pci_mmcfg_virt;
-
--static char *get_virt(unsigned int seg, int bus)
-+static char *get_virt(unsigned int seg, unsigned bus)
- {
- int cfg_num = -1;
- struct acpi_table_mcfg_config *cfg;
-@@ -27,10 +27,9 @@ static char *get_virt(unsigned int seg,
- while (1) {
- ++cfg_num;
- if (cfg_num >= pci_mmcfg_config_num) {
-- /* something bad is going on, no cfg table is found. */
-- /* so we fall back to the old way we used to do this */
-- /* and just rely on the first entry to be correct. */
-- return pci_mmcfg_virt[0].virt;
-+ /* Not found - fall back to type 1. This happens
-+ e.g. on the internal devices of a K8 northbridge. */
-+ return NULL;
- }
- cfg = pci_mmcfg_virt[cfg_num].cfg;
- if (cfg->pci_segment_group_number != seg)
-@@ -43,18 +42,25 @@ static char *get_virt(unsigned int seg,
-
- static inline char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
- {
--
-- return get_virt(seg, bus) + ((bus << 20) | (devfn << 12));
-+ char *addr = get_virt(seg, bus);
-+ if (!addr)
-+ return NULL;
-+ return addr + ((bus << 20) | (devfn << 12));
- }
-
- static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
- unsigned int devfn, int reg, int len, u32 *value)
- {
-- char *addr = pci_dev_base(seg, bus, devfn);
-+ char *addr;
-
-+ /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
- if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))
- return -EINVAL;
-
-+ addr = pci_dev_base(seg, bus, devfn);
-+ if (!addr)
-+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
-+
- switch (len) {
- case 1:
- *value = readb(addr + reg);
-@@ -73,11 +79,16 @@ static int pci_mmcfg_read(unsigned int s
- static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
- unsigned int devfn, int reg, int len, u32 value)
- {
-- char *addr = pci_dev_base(seg, bus, devfn);
-+ char *addr;
-
-+ /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
- if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
- return -EINVAL;
-
-+ addr = pci_dev_base(seg, bus, devfn);
-+ if (!addr)
-+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
-+
- switch (len) {
- case 1:
- writeb(value, addr + reg);
diff --git a/pci/shot-accross-the-bow.patch b/pci/shot-accross-the-bow.patch
index 2934781001502..a9943e5bb0885 100644
--- a/pci/shot-accross-the-bow.patch
+++ b/pci/shot-accross-the-bow.patch
@@ -225,7 +225,7 @@ Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
LIST_HEAD(pci_devices);
-@@ -996,13 +996,13 @@ struct pci_bus * __devinit pci_scan_bus_
+@@ -1031,13 +1031,13 @@ struct pci_bus * __devinit pci_scan_bus_
b->subordinate = pci_scan_child_bus(b);
return b;
}
diff --git a/pci/x86_64-i386-correct-for-broken-mcfg-tables-on-k8-systems.patch b/pci/x86_64-i386-correct-for-broken-mcfg-tables-on-k8-systems.patch
deleted file mode 100644
index a6de90923a87c..0000000000000
--- a/pci/x86_64-i386-correct-for-broken-mcfg-tables-on-k8-systems.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-From ak@muc.de Sun Dec 4 15:36:28 2005
-Date: 4 Dec 2005 19:26:18 +0100
-Date: Sun, 4 Dec 2005 19:26:18 +0100
-From: Andi Kleen <ak@muc.de>
-To: <torvalds@osdl.org>, <akpm@osdl.org>, <gregkh@suse.de>
-Subject: x86_64/i386: Correct for broken MCFG tables on K8 systems
-Message-ID: <20051204182618.GB84932@muc.de>
-Content-Disposition: inline
-
-They report all busses as MMCONFIG capable, but it never works for the
-internal devices in the CPU's builtin northbridge.
-
-This causes problems - some devices are not visible and on x86-64 the
-IOMMU is not detected, causing boot failures on systems with >3GB of
-RAM. It also breaks AGP.
-
-Workaround just probes all func 0 devices on bus 0 (the internal
-northbridge is currently always on bus 0) and if they are not accessible
-using MCFG they are put into a special fallback bitmap.
-
-On systems where it isn't we assume the BIOS vendor supplied correct
-MCFG.
-
-Requires the earlier patch for mmconfig type1 fallback
-
-Signed-off-by: Andi Kleen <ak@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- arch/i386/pci/mmconfig.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
- arch/x86_64/pci/mmconfig.c | 36 ++++++++++++++++++++++++++++++++++--
- 2 files changed, 76 insertions(+), 5 deletions(-)
-
---- gregkh-2.6.orig/arch/x86_64/pci/mmconfig.c
-+++ gregkh-2.6/arch/x86_64/pci/mmconfig.c
-@@ -8,10 +8,13 @@
- #include <linux/pci.h>
- #include <linux/init.h>
- #include <linux/acpi.h>
-+#include <linux/bitmap.h>
- #include "pci.h"
-
- #define MMCONFIG_APER_SIZE (256*1024*1024)
-
-+static DECLARE_BITMAP(fallback_slots, 32);
-+
- /* Static virtual mapping of the MMCONFIG aperture */
- struct mmcfg_virt {
- struct acpi_table_mcfg_config *cfg;
-@@ -40,9 +43,12 @@ static char *get_virt(unsigned int seg,
- }
- }
-
--static inline char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
-+static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
- {
-- char *addr = get_virt(seg, bus);
-+ char *addr;
-+ if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots))
-+ return NULL;
-+ addr = get_virt(seg, bus);
- if (!addr)
- return NULL;
- return addr + ((bus << 20) | (devfn << 12));
-@@ -109,6 +115,30 @@ static struct pci_raw_ops pci_mmcfg = {
- .write = pci_mmcfg_write,
- };
-
-+/* K8 systems have some devices (typically in the builtin northbridge)
-+ that are only accessible using type1
-+ Normally this can be expressed in the MCFG by not listing them
-+ and assigning suitable _SEGs, but this isn't implemented in some BIOS.
-+ Instead try to discover all devices on bus 0 that are unreachable using MM
-+ and fallback for them.
-+ We only do this for bus 0/seg 0 */
-+static __init void unreachable_devices(void)
-+{
-+ int i;
-+ for (i = 0; i < 32; i++) {
-+ u32 val1;
-+ char *addr;
-+
-+ pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);
-+ if (val1 == 0xffffffff)
-+ continue;
-+ addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0));
-+ if (addr == NULL|| readl(addr) != val1) {
-+ set_bit(i, &fallback_slots);
-+ }
-+ }
-+}
-+
- static int __init pci_mmcfg_init(void)
- {
- int i;
-@@ -139,6 +169,8 @@ static int __init pci_mmcfg_init(void)
- printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address);
- }
-
-+ unreachable_devices();
-+
- raw_pci_ops = &pci_mmcfg;
- pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
-
---- gregkh-2.6.orig/arch/i386/pci/mmconfig.c
-+++ gregkh-2.6/arch/i386/pci/mmconfig.c
-@@ -19,14 +19,20 @@
- /* The base address of the last MMCONFIG device accessed */
- static u32 mmcfg_last_accessed_device;
-
-+static DECLARE_BITMAP(fallback_slots, 32);
-+
- /*
- * Functions for accessing PCI configuration space with MMCONFIG accesses
- */
--static u32 get_base_addr(unsigned int seg, int bus)
-+static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
- {
- int cfg_num = -1;
- struct acpi_table_mcfg_config *cfg;
-
-+ if (seg == 0 && bus == 0 &&
-+ test_bit(PCI_SLOT(devfn), fallback_slots))
-+ return 0;
-+
- while (1) {
- ++cfg_num;
- if (cfg_num >= pci_mmcfg_config_num) {
-@@ -60,7 +66,7 @@ static int pci_mmcfg_read(unsigned int s
- if (!value || (bus > 255) || (devfn > 255) || (reg > 4095))
- return -EINVAL;
-
-- base = get_base_addr(seg, bus);
-+ base = get_base_addr(seg, bus, devfn);
- if (!base)
- return pci_conf1_read(seg,bus,devfn,reg,len,value);
-
-@@ -94,7 +100,7 @@ static int pci_mmcfg_write(unsigned int
- if ((bus > 255) || (devfn > 255) || (reg > 4095))
- return -EINVAL;
-
-- base = get_base_addr(seg, bus);
-+ base = get_base_addr(seg, bus, devfn);
- if (!base)
- return pci_conf1_write(seg,bus,devfn,reg,len,value);
-
-@@ -124,6 +130,37 @@ static struct pci_raw_ops pci_mmcfg = {
- .write = pci_mmcfg_write,
- };
-
-+/* K8 systems have some devices (typically in the builtin northbridge)
-+ that are only accessible using type1
-+ Normally this can be expressed in the MCFG by not listing them
-+ and assigning suitable _SEGs, but this isn't implemented in some BIOS.
-+ Instead try to discover all devices on bus 0 that are unreachable using MM
-+ and fallback for them.
-+ We only do this for bus 0/seg 0 */
-+static __init void unreachable_devices(void)
-+{
-+ int i;
-+ unsigned long flags;
-+
-+ for (i = 0; i < 32; i++) {
-+ u32 val1;
-+ u32 addr;
-+
-+ pci_conf1_read(0, 0, PCI_DEVFN(i, 0), 0, 4, &val1);
-+ if (val1 == 0xffffffff)
-+ continue;
-+
-+ /* Locking probably not needed, but safer */
-+ spin_lock_irqsave(&pci_config_lock, flags);
-+ addr = get_base_addr(0, 0, PCI_DEVFN(i, 0));
-+ if (addr != 0)
-+ pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0));
-+ if (addr == 0 || readl((u32 *)addr) != val1)
-+ set_bit(i, fallback_slots);
-+ spin_unlock_irqrestore(&pci_config_lock, flags);
-+ }
-+}
-+
- static int __init pci_mmcfg_init(void)
- {
- if ((pci_probe & PCI_PROBE_MMCONF) == 0)
-@@ -139,6 +176,8 @@ static int __init pci_mmcfg_init(void)
- raw_pci_ops = &pci_mmcfg;
- pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
-
-+ unreachable_devices();
-+
- out:
- return 0;
- }