aboutsummaryrefslogtreecommitdiffstats
path: root/pci
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-11-08 17:31:41 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-11-08 17:31:41 -0800
commit0fceeff70d9b9779637e3d366e69b0d8df79e1f6 (patch)
tree950d750bd15e1a3e194fa1406984a77cc19bcc0e /pci
parent7718c4147f7fe4b80d1855f62ee998ff3e2d0306 (diff)
downloadpatches-0fceeff70d9b9779637e3d366e69b0d8df79e1f6.tar.gz
pci patches
Diffstat (limited to 'pci')
-rw-r--r--pci/pci-changing-msi-to-use-physical-delivery-mode-always.patch173
-rw-r--r--pci/pci-drivers-pci-small-cleanups.patch45
-rw-r--r--pci/pci-fix-namespace-clashes.patch83
-rw-r--r--pci/pci_ids-cleanup-fix-two-additional-ids-in-bt87x.patch36
4 files changed, 337 insertions, 0 deletions
diff --git a/pci/pci-changing-msi-to-use-physical-delivery-mode-always.patch b/pci/pci-changing-msi-to-use-physical-delivery-mode-always.patch
new file mode 100644
index 0000000000000..eca41af3c035c
--- /dev/null
+++ b/pci/pci-changing-msi-to-use-physical-delivery-mode-always.patch
@@ -0,0 +1,173 @@
+From araj@unix-os.sc.intel.com Tue Nov 8 08:09:05 2005
+Date: Tue, 8 Nov 2005 07:00:38 -0800
+From: Ashok Raj <ashok.raj@intel.com>
+Cc: akpm@osdl.org, gregkh@suse.de, ak@muc.de
+Subject: PCI: Changing MSI to use physical delivery mode always.
+Message-ID: <20051108070038.A15318@unix-os.sc.intel.com>
+Content-Disposition: inline
+
+
+MSI hardcoded delivery mode to use logical delivery mode. Recently
+x86_64 moved to use physical mode addressing to support physflat mode.
+With this mode enabled noticed that my eth with MSI werent working.
+
+msi_address_init() was hardcoded to use logical mode for i386 and
+x86_64. So when we switch to use physical mode, things stopped working.
+
+Since anyway we dont use lowest priority delivery with MSI, its always
+directed to just a single CPU. Its safe and simpler to use physical
+mode always, even when we use logical delivery mode for IPI's or other
+ioapic RTE's.
+
+
+Signed-off-by: Ashok Raj <ashok.raj@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/pci/msi.c | 19 +++++++++++--------
+ include/asm-i386/msi.h | 9 +--------
+ include/asm-i386/smp.h | 6 ++++++
+ include/asm-ia64/msi.h | 3 ---
+ include/asm-x86_64/msi.h | 4 +---
+ include/asm-x86_64/smp.h | 6 ++++++
+ 6 files changed, 25 insertions(+), 22 deletions(-)
+
+--- gregkh-2.6.orig/drivers/pci/msi.c
++++ gregkh-2.6/drivers/pci/msi.c
+@@ -23,6 +23,8 @@
+ #include "pci.h"
+ #include "msi.h"
+
++#define TARGET_CPU first_cpu(cpu_online_map)
++
+ static DEFINE_SPINLOCK(msi_lock);
+ static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL };
+ static kmem_cache_t* msi_cachep;
+@@ -92,6 +94,7 @@ static void set_msi_affinity(unsigned in
+ struct msi_desc *entry;
+ struct msg_address address;
+ unsigned int irq = vector;
++ unsigned int dest_cpu = first_cpu(cpu_mask);
+
+ entry = (struct msi_desc *)msi_desc[vector];
+ if (!entry || !entry->dev)
+@@ -108,9 +111,9 @@ static void set_msi_affinity(unsigned in
+ pci_read_config_dword(entry->dev, msi_lower_address_reg(pos),
+ &address.lo_address.value);
+ address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
+- address.lo_address.value |= (cpu_mask_to_apicid(cpu_mask) <<
+- MSI_TARGET_CPU_SHIFT);
+- entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask);
++ address.lo_address.value |= (cpu_physical_id(dest_cpu) <<
++ MSI_TARGET_CPU_SHIFT);
++ entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu);
+ pci_write_config_dword(entry->dev, msi_lower_address_reg(pos),
+ address.lo_address.value);
+ set_native_irq_info(irq, cpu_mask);
+@@ -123,9 +126,8 @@ static void set_msi_affinity(unsigned in
+
+ address.lo_address.value = readl(entry->mask_base + offset);
+ address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
+- address.lo_address.value |= (cpu_mask_to_apicid(cpu_mask) <<
+- MSI_TARGET_CPU_SHIFT);
+- entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask);
++ address.lo_address.value |= (dest_cpu << MSI_TARGET_CPU_SHIFT);
++ entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu);
+ writel(address.lo_address.value, entry->mask_base + offset);
+ set_native_irq_info(irq, cpu_mask);
+ break;
+@@ -259,14 +261,15 @@ static void msi_data_init(struct msg_dat
+ static void msi_address_init(struct msg_address *msi_address)
+ {
+ unsigned int dest_id;
++ unsigned long dest_phys_id = cpu_physical_id(TARGET_CPU);
+
+ memset(msi_address, 0, sizeof(struct msg_address));
+ msi_address->hi_address = (u32)0;
+ dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT);
+- msi_address->lo_address.u.dest_mode = MSI_DEST_MODE;
++ msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE;
+ msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE;
+ msi_address->lo_address.u.dest_id = dest_id;
+- msi_address->lo_address.value |= (MSI_TARGET_CPU << MSI_TARGET_CPU_SHIFT);
++ msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT);
+ }
+
+ static int msi_free_vector(struct pci_dev* dev, int vector, int reassign);
+--- gregkh-2.6.orig/include/asm-i386/msi.h
++++ gregkh-2.6/include/asm-i386/msi.h
+@@ -10,13 +10,6 @@
+ #include <mach_apic.h>
+
+ #define LAST_DEVICE_VECTOR 232
+-#define MSI_DEST_MODE MSI_LOGICAL_MODE
+-#define MSI_TARGET_CPU_SHIFT 12
+-
+-#ifdef CONFIG_SMP
+-#define MSI_TARGET_CPU logical_smp_processor_id()
+-#else
+-#define MSI_TARGET_CPU cpu_to_logical_apicid(first_cpu(cpu_online_map))
+-#endif
++#define MSI_TARGET_CPU_SHIFT 12
+
+ #endif /* ASM_MSI_H */
+--- gregkh-2.6.orig/include/asm-i386/smp.h
++++ gregkh-2.6/include/asm-i386/smp.h
+@@ -45,6 +45,8 @@ extern void unlock_ipi_call_lock(void);
+ #define MAX_APICID 256
+ extern u8 x86_cpu_to_apicid[];
+
++#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
++
+ #ifdef CONFIG_HOTPLUG_CPU
+ extern void cpu_exit_clear(void);
+ extern void cpu_uninit(void);
+@@ -92,6 +94,10 @@ extern int __cpu_disable(void);
+ extern void __cpu_die(unsigned int cpu);
+ #endif /* !__ASSEMBLY__ */
+
++#else /* CONFIG_SMP */
++
++#define cpu_physical_id(cpu) boot_cpu_physical_apicid
++
+ #define NO_PROC_ID 0xFF /* No processor magic marker */
+
+ #endif
+--- gregkh-2.6.orig/include/asm-ia64/msi.h
++++ gregkh-2.6/include/asm-ia64/msi.h
+@@ -12,9 +12,6 @@
+ static inline void set_intr_gate (int nr, void *func) {}
+ #define IO_APIC_VECTOR(irq) (irq)
+ #define ack_APIC_irq ia64_eoi
+-#define cpu_mask_to_apicid(mask) cpu_physical_id(first_cpu(mask))
+-#define MSI_DEST_MODE MSI_PHYSICAL_MODE
+-#define MSI_TARGET_CPU ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
+ #define MSI_TARGET_CPU_SHIFT 4
+
+ #endif /* ASM_MSI_H */
+--- gregkh-2.6.orig/include/asm-x86_64/msi.h
++++ gregkh-2.6/include/asm-x86_64/msi.h
+@@ -11,8 +11,6 @@
+ #include <asm/smp.h>
+
+ #define LAST_DEVICE_VECTOR 232
+-#define MSI_DEST_MODE MSI_LOGICAL_MODE
+-#define MSI_TARGET_CPU_SHIFT 12
+-#define MSI_TARGET_CPU logical_smp_processor_id()
++#define MSI_TARGET_CPU_SHIFT 12
+
+ #endif /* ASM_MSI_H */
+--- gregkh-2.6.orig/include/asm-x86_64/smp.h
++++ gregkh-2.6/include/asm-x86_64/smp.h
+@@ -135,5 +135,11 @@ static __inline int logical_smp_processo
+ }
+ #endif
+
++#ifdef CONFIG_SMP
++#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
++#else
++#define cpu_physical_id(cpu) boot_cpu_id
++#endif
++
+ #endif
+
diff --git a/pci/pci-drivers-pci-small-cleanups.patch b/pci/pci-drivers-pci-small-cleanups.patch
new file mode 100644
index 0000000000000..a889a7c59d834
--- /dev/null
+++ b/pci/pci-drivers-pci-small-cleanups.patch
@@ -0,0 +1,45 @@
+From bunk@stusta.de Sat Nov 5 19:44:15 2005
+Date: Sun, 6 Nov 2005 01:45:08 +0100
+From: Adrian Bunk <bunk@stusta.de>
+To: gregkh@suse.de
+Subject: PCI: drivers/pci/: small cleanups
+Message-ID: <20051106004508.GC3668@stusta.de>
+Content-Disposition: inline
+
+This patch contains the following cleanups:
+- access.c should #include "pci.h" for getting the prototypes of it's
+ global functions
+- hotplug/shpchp_pci.c: make the needlessly global function
+ program_fw_provided_values() static
+
+
+Signed-off-by: Adrian Bunk <bunk@stusta.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/pci/access.c | 2 ++
+ drivers/pci/hotplug/shpchp_pci.c | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/pci/access.c
++++ gregkh-2.6/drivers/pci/access.c
+@@ -2,6 +2,8 @@
+ #include <linux/module.h>
+ #include <linux/ioport.h>
+
++#include "pci.h"
++
+ /*
+ * This interrupt-safe spinlock protects all accesses to PCI
+ * configuration space.
+--- gregkh-2.6.orig/drivers/pci/hotplug/shpchp_pci.c
++++ gregkh-2.6/drivers/pci/hotplug/shpchp_pci.c
+@@ -34,7 +34,7 @@
+ #include "../pci.h"
+ #include "shpchp.h"
+
+-void program_fw_provided_values(struct pci_dev *dev)
++static void program_fw_provided_values(struct pci_dev *dev)
+ {
+ u16 pci_cmd, pci_bctl;
+ struct pci_dev *cdev;
diff --git a/pci/pci-fix-namespace-clashes.patch b/pci/pci-fix-namespace-clashes.patch
new file mode 100644
index 0000000000000..3c87902f3aff0
--- /dev/null
+++ b/pci/pci-fix-namespace-clashes.patch
@@ -0,0 +1,83 @@
+From rshah1@unix-os.sc.intel.com Mon Nov 7 13:41:56 2005
+Date: Mon, 7 Nov 2005 13:37:36 -0800
+From: Rajesh Shah <rajesh.shah@intel.com>
+To: Adrian Bunk <bunk@stusta.de>
+Cc: Rajesh Shah <rajesh.shah@intel.com>, Andrew Morton <akpm@osdl.org>,
+ greg@kroah.com, kristen.c.accardi@intel.com,
+ linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
+Subject: PCI: fix namespace clashes
+Message-ID: <20051107133736.A6037@unix-os.sc.intel.com>
+Content-Disposition: inline
+
+Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/pci/hotplug/pciehp.h | 4 ++--
+ drivers/pci/hotplug/pciehp_hpc.c | 2 +-
+ drivers/pci/hotplug/pciehprm_acpi.c | 4 ++--
+ drivers/pci/hotplug/pciehprm_nonacpi.c | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+--- gregkh-2.6.orig/drivers/pci/hotplug/pciehp.h
++++ gregkh-2.6/drivers/pci/hotplug/pciehp.h
+@@ -191,8 +191,8 @@ extern u8 pciehp_handle_power_fault (u8
+ /* pci functions */
+ extern int pciehp_configure_device (struct slot *p_slot);
+ extern int pciehp_unconfigure_device (struct slot *p_slot);
+-extern int get_hp_hw_control_from_firmware(struct pci_dev *dev);
+-extern void get_hp_params_from_firmware(struct pci_dev *dev,
++extern int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev);
++extern void pciehp_get_hp_params_from_firmware(struct pci_dev *dev,
+ struct hotplug_params *hpp);
+
+
+--- gregkh-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
++++ gregkh-2.6/drivers/pci/hotplug/pciehp_hpc.c
+@@ -1418,7 +1418,7 @@ int pcie_init(struct controller * ctrl,
+ dbg("Bypassing BIOS check for pciehp use on %s\n",
+ pci_name(ctrl->pci_dev));
+ } else {
+- rc = get_hp_hw_control_from_firmware(ctrl->pci_dev);
++ rc = pciehp_get_hp_hw_control_from_firmware(ctrl->pci_dev);
+ if (rc)
+ goto abort_free_ctlr;
+ }
+--- gregkh-2.6.orig/drivers/pci/hotplug/pciehprm_acpi.c
++++ gregkh-2.6/drivers/pci/hotplug/pciehprm_acpi.c
+@@ -169,7 +169,7 @@ static int is_root_bridge(acpi_handle ha
+ return 0;
+ }
+
+-int get_hp_hw_control_from_firmware(struct pci_dev *dev)
++int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev)
+ {
+ acpi_status status;
+ acpi_handle chandle, handle = DEVICE_ACPI_HANDLE(&(dev->dev));
+@@ -228,7 +228,7 @@ int get_hp_hw_control_from_firmware(stru
+ return -1;
+ }
+
+-void get_hp_params_from_firmware(struct pci_dev *dev,
++void pciehp_get_hp_params_from_firmware(struct pci_dev *dev,
+ struct hotplug_params *hpp)
+ {
+ acpi_status status = AE_NOT_FOUND;
+--- gregkh-2.6.orig/drivers/pci/hotplug/pciehprm_nonacpi.c
++++ gregkh-2.6/drivers/pci/hotplug/pciehprm_nonacpi.c
+@@ -35,13 +35,13 @@
+ #include <linux/slab.h>
+ #include "pciehp.h"
+
+-void get_hp_params_from_firmware(struct pci_dev *dev,
++void pciehp_get_hp_params_from_firmware(struct pci_dev *dev,
+ struct hotplug_params *hpp)
+ {
+ return;
+ }
+
+-int get_hp_hw_control_from_firmware(struct pci_dev *dev)
++int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev)
+ {
+ return 0;
+ }
diff --git a/pci/pci_ids-cleanup-fix-two-additional-ids-in-bt87x.patch b/pci/pci_ids-cleanup-fix-two-additional-ids-in-bt87x.patch
new file mode 100644
index 0000000000000..50a4ba33e283c
--- /dev/null
+++ b/pci/pci_ids-cleanup-fix-two-additional-ids-in-bt87x.patch
@@ -0,0 +1,36 @@
+From gcoady@gmail.com Sat Nov 5 19:44:12 2005
+Message-ID: <436D45D3.4060807@gmail.com>
+Date: Sun, 06 Nov 2005 10:52:51 +1100
+From: Grant Coady <gcoady@gmail.com>
+To: Greg KH <gregkh@suse.de>
+Cc: Chun-Chung Chen <cjj@u.washington.edu>
+Subject: [PATCH] pci_ids cleanup: fix two additional IDs in bt87x
+
+From: Grant Coady <gcoady@gmail.com>
+
+pci_ids cleanup: fixup bt87x.c: two macro defined IDs missed in prior cleanup.
+
+Caught by Chun-Chung Chen <cjj@u.washington.edu>: "In the patch for bt87x.c,
+you seemed have missed the two occurrences of BT_DEVICE on line 897 and
+line 898."
+
+Signed-off-by: Grant Coady <gcoady@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/bt87x.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- gregkh-2.6.orig/sound/pci/bt87x.c
++++ gregkh-2.6/sound/pci/bt87x.c
+@@ -897,8 +897,8 @@ static void __devexit snd_bt87x_remove(s
+ /* default entries for all Bt87x cards - it's not exported */
+ /* driver_data is set to 0 to call detection */
+ static struct pci_device_id snd_bt87x_default_ids[] = {
+- BT_DEVICE(878, PCI_ANY_ID, PCI_ANY_ID, 0),
+- BT_DEVICE(879, PCI_ANY_ID, PCI_ANY_ID, 0),
++ BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0),
++ BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0),
+ { }
+ };
+