public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] More PCI fixes for 2.6.10-rc2
@ 2004-12-01  0:09 Greg KH
  2004-12-01  0:10 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:09 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are some more small PCI and PCI hotplug fixes for 2.6.10-rc2.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/pci-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.


 arch/i386/pci/mmconfig.c         |    7 +++++++
 arch/x86_64/pci/mmconfig.c       |    7 +++++++
 drivers/pci/hotplug/cpqphp_pci.c |    2 +-
 drivers/pci/hotplug/pciehp_hpc.c |    3 +++
 drivers/pci/hotplug/shpchp_hpc.c |    3 +++
 drivers/pci/pci-sysfs.c          |   14 ++++++++++++--
 6 files changed, 33 insertions(+), 3 deletions(-)
-----

Andi Kleen:
  o PCI: Disable mmconfig on AMD CPUs
  o PCI: Add sysfs file to map PCI busses to cpus

Dely Sy:
  o PCI Hotplug: Add pci_enable_device() in hot-plug drivers

Greg Kroah-Hartman:
  o PCI: fix build warning in pci-sysfs.c
  o PCI Hotplug: fix warning compile issue in cpqphp driver


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] More PCI fixes for 2.6.10-rc2
  2004-12-01  0:09 [BK PATCH] More PCI fixes for 2.6.10-rc2 Greg KH
@ 2004-12-01  0:10 ` Greg KH
  2004-12-01  0:10   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:10 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2223.2.1, 2004/11/24 14:43:45-08:00, dlsy@snoqualmie.dp.intel.com

[PATCH] PCI Hotplug: Add pci_enable_device() in hot-plug drivers

Here is the patch to add pci_enable_device() to the two hot-plug
drivers.  In 2.6.10-rc2, the unconditional PCI ACPI IRQ routing
has been removed.  Without this patch, the drivers won't work in
INTx mode with ACPI enabled.


Signed-off-by: Dely Sy <dely.l.sy@intel.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/hotplug/pciehp_hpc.c |    3 +++
 drivers/pci/hotplug/shpchp_hpc.c |    3 +++
 2 files changed, 6 insertions(+)


diff -Nru a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
--- a/drivers/pci/hotplug/pciehp_hpc.c	2004-11-30 15:47:30 -08:00
+++ b/drivers/pci/hotplug/pciehp_hpc.c	2004-11-30 15:47:30 -08:00
@@ -1347,6 +1347,9 @@
 	info("HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", pdev->vendor, pdev->device, 
 		pdev->subsystem_vendor, pdev->subsystem_device);
 
+	if (pci_enable_device(pdev))
+		goto abort_free_ctlr;
+	
 	init_MUTEX(&ctrl->crit_sect);
 	/* setup wait queue */
 	init_waitqueue_head(&ctrl->queue);
diff -Nru a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
--- a/drivers/pci/hotplug/shpchp_hpc.c	2004-11-30 15:47:30 -08:00
+++ b/drivers/pci/hotplug/shpchp_hpc.c	2004-11-30 15:47:30 -08:00
@@ -1487,6 +1487,9 @@
 
 	info("HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", pdev->vendor, pdev->device, pdev->subsystem_vendor, 
 		pdev->subsystem_device);
+	
+	if (pci_enable_device(pdev))
+		goto abort_free_ctlr;
 
 	if (!request_mem_region(pci_resource_start(pdev, 0) + shpc_base_offset, pci_resource_len(pdev, 0), MY_NAME)) {
 		err("%s: cannot reserve MMIO region\n", __FUNCTION__);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] More PCI fixes for 2.6.10-rc2
  2004-12-01  0:10       ` Greg KH
@ 2004-12-01  0:10         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:10 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2223.2.5, 2004/11/30 11:54:13-08:00, greg@kroah.com

PCI: fix build warning in pci-sysfs.c

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/pci-sysfs.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c	2004-11-30 15:47:05 -08:00
+++ b/drivers/pci/pci-sysfs.c	2004-11-30 15:47:05 -08:00
@@ -45,8 +45,7 @@
 
 static ssize_t local_cpus_show(struct device *dev, char *buf)
 {		
-	struct pci_dev *pdev = to_pci_dev(dev);
-	cpumask_t mask = pcibus_to_cpumask(pdev->bus->number);
+	cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus->number);
 	int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
 	strcat(buf,"\n"); 
 	return 1+len;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] More PCI fixes for 2.6.10-rc2
  2004-12-01  0:10   ` Greg KH
@ 2004-12-01  0:10     ` Greg KH
  2004-12-01  0:10       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:10 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2223.2.3, 2004/11/29 11:12:54-08:00, ak@suse.de

[PATCH] PCI: Add sysfs file to map PCI busses to cpus

Add sysfs file to map PCI busses to cpus

Export the information from pcibus_to_cpumask() to sysfs. This
is useful for some user space programs who want to optimize their IO
using O_DIRECT.

There was some indecision on whether it's more useful to report
cpus or nodes here. In the end cpus was chosen because that is
what the existing macros report.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/pci-sysfs.c |   11 +++++++++++
 1 files changed, 11 insertions(+)


diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c	2004-11-30 15:47:18 -08:00
+++ b/drivers/pci/pci-sysfs.c	2004-11-30 15:47:18 -08:00
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/stat.h>
+#include <linux/topology.h>
 
 #include "pci.h"
 
@@ -42,6 +43,15 @@
 pci_config_attr(class, "0x%06x\n");
 pci_config_attr(irq, "%u\n");
 
+static ssize_t local_cpus_show(struct device *dev, char *buf)
+{		
+	struct pci_dev *pdev = to_pci_dev(dev);
+	cpumask_t mask = pcibus_to_cpumask(pdev->bus->number);
+	int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
+	strcat(buf,"\n"); 
+	return 1+len;
+}
+
 /* show resources */
 static ssize_t
 resource_show(struct device * dev, char * buf)
@@ -71,6 +81,7 @@
 	__ATTR_RO(subsystem_device),
 	__ATTR_RO(class),
 	__ATTR_RO(irq),
+	__ATTR_RO(local_cpus),
 	__ATTR_NULL,
 };
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] More PCI fixes for 2.6.10-rc2
  2004-12-01  0:10 ` [PATCH] " Greg KH
@ 2004-12-01  0:10   ` Greg KH
  2004-12-01  0:10     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:10 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2223.2.2, 2004/11/24 14:44:11-08:00, greg@kroah.com

[PATCH] PCI Hotplug: fix warning compile issue in cpqphp driver

As pointed out by "O.Sezer" <sezeroz@ttnet.net.tr> in a patch to 2.4

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/hotplug/cpqphp_pci.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
--- a/drivers/pci/hotplug/cpqphp_pci.c	2004-11-30 15:47:24 -08:00
+++ b/drivers/pci/hotplug/cpqphp_pci.c	2004-11-30 15:47:24 -08:00
@@ -194,7 +194,7 @@
 
 static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev_num)
 {
-	u8 tdevice;
+	u16 tdevice;
 	u32 work;
 	u8 tbus;
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] More PCI fixes for 2.6.10-rc2
  2004-12-01  0:10     ` Greg KH
@ 2004-12-01  0:10       ` Greg KH
  2004-12-01  0:10         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-12-01  0:10 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2223.2.4, 2004/11/29 11:13:49-08:00, ak@suse.de

[PATCH] PCI: Disable mmconfig on AMD CPUs.

Disable mmconfig on AMD CPUs.

This patch fixes various problems on PCI Express boards, like the
Nforce4. They have a MCFG table in ACPI, but not all devices can be
accessed using MMCONFIG.  e.g. the CPU builtin PCI devices in the A64
Northbridge can't.  Linux happily uses mmconfig for all PCI devices and
that cause failures and memory corruption.

Right solution apparently is to get more information from MCFG which is
supposed to tell for which busses mmconfig is legal and for which ones
not. But that would be a much more complicated patch and I don't have
a specification of this enhanced table.

This patch just disable MMCONFIG on all AMD CPUs. This is a kludge,
but works around the problem for now.

Patch for both i386 and x86-64

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 arch/i386/pci/mmconfig.c   |    7 +++++++
 arch/x86_64/pci/mmconfig.c |    7 +++++++
 2 files changed, 14 insertions(+)


diff -Nru a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
--- a/arch/i386/pci/mmconfig.c	2004-11-30 15:47:12 -08:00
+++ b/arch/i386/pci/mmconfig.c	2004-11-30 15:47:12 -08:00
@@ -102,6 +102,13 @@
 	if (!pci_mmcfg_base_addr)
 		goto out;
 
+	/* Kludge for now. Don't use mmconfig on AMD systems because
+	   those have some busses where mmconfig doesn't work,
+	   and we don't parse ACPI MCFG well enough to handle that. 
+	   Remove when proper handling is added. */
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+		goto out; 
+
 	printk(KERN_INFO "PCI: Using MMCONFIG\n");
 	raw_pci_ops = &pci_mmcfg;
 	pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
diff -Nru a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
--- a/arch/x86_64/pci/mmconfig.c	2004-11-30 15:47:12 -08:00
+++ b/arch/x86_64/pci/mmconfig.c	2004-11-30 15:47:12 -08:00
@@ -78,6 +78,13 @@
 	if (!pci_mmcfg_base_addr)
 		return 0;
 
+	/* Kludge for now. Don't use mmconfig on AMD systems because
+	   those have some busses where mmconfig doesn't work,
+	   and we don't parse ACPI MCFG well enough to handle that. 
+	   Remove when proper handling is added. */
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+		return 0; 
+
 	/* RED-PEN i386 doesn't do _nocache right now */
 	pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE);
 	if (!pci_mmcfg_virt) { 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-12-01  0:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01  0:09 [BK PATCH] More PCI fixes for 2.6.10-rc2 Greg KH
2004-12-01  0:10 ` [PATCH] " Greg KH
2004-12-01  0:10   ` Greg KH
2004-12-01  0:10     ` Greg KH
2004-12-01  0:10       ` Greg KH
2004-12-01  0:10         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox