Skip to contentSkip to conversation

PCI update for 2.6.11

PATCH New Greg KH 2 participants 20 messages Mar 4, 2005 – Mar 5, 2005

Subsystems (13)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 PCI update for 2.6.11

Hi,

Here are some PCI and PCI Hotplug patches for 2.6.11. All of these have been in the past few -mm releases.

It includes a big pci.ids update. Hm, I need to mark that thing as "will be deleted in the future" soon, as we are tired of keeping that around. Will do that in the next round of pci patches.

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.

 Documentation/pci.txt                |    8 
 arch/frv/mb93090-mb00/pci-frv.c      |    4 
 arch/frv/mb93090-mb00/pci-vdk.c      |    6 
 arch/i386/pci/acpi.c                 |   17 
 arch/i386/pci/direct.c               |   12 
 arch/i386/pci/irq.c                  |   73 +-
 arch/i386/pci/mmconfig.c             |    6 
 arch/i386/pci/numa.c                 |   10 
 arch/i386/pci/pcbios.c               |    6 
 arch/ia64/pci/pci.c                  |   69 --
 arch/mips/pmc-sierra/yosemite/ht.c   |    6 
 arch/ppc/kernel/pci.c                |    2 
 arch/ppc64/kernel/pci.c              |   16 
 arch/sh/drivers/pci/fixups-sh03.c    |    4 
 arch/sh/drivers/pci/pci-sh7751.c     |    8 
 arch/sh/drivers/pci/pci-st40.c       |    2 
 arch/sh64/kernel/pci_sh5.c           |    2 
 arch/sh64/kernel/pcibios.c           |    4 
 arch/sparc64/kernel/pci.c            |    6 
 arch/x86_64/pci/mmconfig.c           |    8 
 drivers/char/agp/generic.c           |    2 
 drivers/char/agp/sis-agp.c           |    2 
 drivers/ide/pci/sgiioc4.c            |    6 
 drivers/isdn/hisax/hisax_fcpcipnp.c  |    2 
 drivers/media/common/saa7146_video.c |    2 
 drivers/media/video/meye.c           |    2 
 drivers/media/video/zoran_driver.c   |    2 
 drivers/net/defxx.c                  |    2 
 drivers/net/r8169.c                  |    8 
 drivers/net/s2io.c                   |    4 
 drivers/net/sk98lin/skethtool.c      |    2 
 drivers/net/sk98lin/skge.c           |    2 
 drivers/net/tulip/tulip.h            |    2 
 drivers/net/typhoon.c                |    2 
 drivers/net/via-velocity.c           |    2 
 drivers/net/wan/wanxl.c              |   38 -
 drivers/parisc/dino.c                |    5 
 drivers/pci/hotplug/ibmphp_pci.c     |    3 
 drivers/pci/hotplug/pciehp_ctrl.c    |    3 
 drivers/pci/hotplug/pciehprm_acpi.c  |    3 
 drivers/pci/hotplug/shpchprm_acpi.c  |    3 
 drivers/pci/msi.c                    |   13 
 drivers/pci/pci-driver.c             |    1 
 drivers/pci/pci-sysfs.c              |    2 
 drivers/pci/pci.c                    |    4 
 drivers/pci/pci.ids                  | 1137 +++++++++++++++++++++++++++++++----
 drivers/pci/pcie/Kconfig             |    1 
 drivers/pci/pcie/portdrv_pci.c       |    2 
 drivers/pci/probe.c                  |    9 
 drivers/pci/proc.c                   |   20 
 drivers/pci/quirks.c                 |   13 
 drivers/pci/setup-res.c              |    4 
 drivers/pcmcia/yenta_socket.c        |    2 
 drivers/scsi/qla2xxx/qla_os.c        |   28 
 include/asm-alpha/pci.h              |   11 
 include/asm-ia64/pci.h               |    9 
 include/asm-mips/pci.h               |   11 
 include/asm-ppc/pci.h                |    3 
 include/asm-ppc64/pci.h              |    4 
 include/asm-sparc64/pci.h            |    5 
 include/linux/pci.h                  |   11 
 include/linux/pci_ids.h              |    8 
 62 files changed, 1255 insertions(+), 409 deletions(-)

-----

<c-d.hailfinger.devel.2005:gmx.net>:
o PCI: pci.ids update
o pci/quirks.c: unhide SMBus device on Samsung P35 laptop

<muneda.takahiro:jp.fujitsu.com>:
o PCI: fix pci_remove_legacy_files() crash

Alexander Nyberg:
o PCI: fix hotplug double free

Andi Kleen:
o PCI: allow x86_64 to do pci express

Benjamin Herrenschmidt:
o PCI: Apple PCI IDs update

Bjorn Helgaas:
o PCI: tone down pci=routeirq message
o PCI: pci_raw_ops should use unsigned args
o PCI: NUMA-Q PCI config access arg validation

Brian King:
o PCI: Dynids - passing driver data

Christophe Lucas:
o drivers/pci/*: convert to pci_register_driver

Dave Jones:
o Remove pci_dev->slot_name
o convert pci_dev->slot_name usage to pci_name()

Dely Sy:
o PCI Hotplug: Fix OSHP calls in shpchp and pciehp drivers

Greg Kroah-Hartman:
o PCI: remove pci_find_device usage from pci sysfs code

Jean Delvare:
o PCI: One more Asus SMBus quirk
o PCI: Add PCI quirk for SMBus on the Toshiba Satellite A40

Mark F. Haigh:
o arch/i386/kernel/pci/irq.c: Wrong message output

Matthew Wilcox:
o PCI: Make pci_claim_resource __devinit
o PCI: pci_proc_domain

Roland Dreier:
o PCI: clean up the msi api

Rolf Eike Beer:
o PCI Hotplug: Remove unneeded instructions from ibmphp_pci.c

author
#1 lore raw

PATCH 1/1 convert pci_dev->slot_name usage to pci_name()

ChangeSet 1.1998.11.6, 2005/02/07 14:36:14-08:00, [email protected]

[PATCH] convert pci_dev->slot_name usage to pci_name()

Prepare for removal of pci_dev->slot_name

 arch/frv/mb93090-mb00/pci-frv.c      |    4 +--
 arch/frv/mb93090-mb00/pci-vdk.c      |    6 ++---
 arch/mips/pmc-sierra/yosemite/ht.c   |    6 ++---
 arch/ppc/kernel/pci.c                |    2 -
 arch/sh/drivers/pci/fixups-sh03.c    |    4 +--
 arch/sh/drivers/pci/pci-sh7751.c     |    8 +++----
 arch/sh/drivers/pci/pci-st40.c       |    2 -
 arch/sh64/kernel/pci_sh5.c           |    2 -
 arch/sh64/kernel/pcibios.c           |    4 +--
 drivers/char/agp/generic.c           |    2 -
 drivers/char/agp/sis-agp.c           |    2 -
 drivers/ide/pci/sgiioc4.c            |    6 ++---
 drivers/isdn/hisax/hisax_fcpcipnp.c  |    2 -
 drivers/media/common/saa7146_video.c |    2 -
 drivers/media/video/meye.c           |    2 -
 drivers/media/video/zoran_driver.c   |    2 -
 drivers/net/defxx.c                  |    2 -
 drivers/net/r8169.c                  |    4 +--
 drivers/net/s2io.c                   |    2 -
 drivers/net/sk98lin/skethtool.c      |    2 -
 drivers/net/sk98lin/skge.c           |    2 -
 drivers/net/tulip/tulip.h            |    2 -
 drivers/net/typhoon.c                |    2 -
 drivers/net/via-velocity.c           |    2 -
 drivers/net/wan/wanxl.c              |   38 ++++++++++++++---------------------
 drivers/parisc/dino.c                |    5 +---
 drivers/pci/pci.c                    |    2 -
 drivers/pci/probe.c                  |    1 
 drivers/pci/setup-res.c              |    2 -
 drivers/pcmcia/yenta_socket.c        |    2 -
 drivers/scsi/qla2xxx/qla_os.c        |   14 ++++++------
 31 files changed, 65 insertions(+), 73 deletions(-)
arch/frv/mb93090-mb00/pci-frv.c +2 -2
diff -Nru a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
@@ -43,7 +43,7 @@
 	pci_read_config_dword(dev, reg, &check);
 	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
 		printk(KERN_ERR "PCI: Error while updating region "
-		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
 		       new, check);
 	}
 }
@@ -128,7 +128,7 @@
 					continue;
 				pr = pci_find_parent_resource(dev, r);
 				if (!pr || request_resource(pr, r) < 0)
-					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, dev->slot_name);
+					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
 			}
 		}
 		pcibios_allocate_bus_resources(&bus->children);
arch/frv/mb93090-mb00/pci-vdk.c +3 -3
diff -Nru a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -294,7 +294,7 @@
 	 */
 	int i;
 
-	printk("PCI: Fixing base address flags for device %s\n", d->slot_name);
+	printk("PCI: Fixing base address flags for device %s\n", pci_name(d));
 	for(i=0; i<4; i++)
 		d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
 }
@@ -308,7 +308,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
@@ -326,7 +326,7 @@
 	 * There exist PCI IDE controllers which have utter garbage
 	 * in first four base registers. Ignore that.
 	 */
-	printk("PCI: IDE base address trash cleared for %s\n", d->slot_name);
+	printk("PCI: IDE base address trash cleared for %s\n", pci_name(d));
 	for(i=0; i<4; i++)
 		d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;
 }
arch/mips/pmc-sierra/yosemite/ht.c +3 -3
diff -Nru a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
@@ -303,7 +303,7 @@
                 if (!r->start && r->end) {
                         printk(KERN_ERR
                                "PCI: Device %s not available because of "
-                               "resource collisions\n", dev->slot_name);
+                               "resource collisions\n", pci_name(dev));
                         return -EINVAL;
                 }
                 if (r->flags & IORESOURCE_IO)
@@ -377,7 +377,7 @@
             ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK :
              PCI_BASE_ADDRESS_MEM_MASK)) {
                 printk(KERN_ERR "PCI: Error while updating region "
-                       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+                       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
                        new, check);
         }
 }
@@ -396,7 +396,7 @@
                    addresses kilobyte aligned.  */
                 if (size > 0x100) {
                         printk(KERN_ERR "PCI: I/O Region %s/%d too large"
-                               " (%ld bytes)\n", dev->slot_name,
+                               " (%ld bytes)\n", pci_name(dev),
                                 dev->resource - res, size);
                 }
 
arch/ppc/kernel/pci.c +1 -1
diff -Nru a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
@@ -1058,7 +1058,7 @@
 		return;
  	res = *(bus->resource[0]);
 
-	DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->slot_name);
+	DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
 	res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	DBG("  IO window: %08lx-%08lx\n", res.start, res.end);
arch/sh/drivers/pci/fixups-sh03.c +2 -2
diff -Nru a/arch/sh/drivers/pci/fixups-sh03.c b/arch/sh/drivers/pci/fixups-sh03.c
@@ -46,11 +46,11 @@
 	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
 	irq = pcibios_map_platform_irq(slot, pin, dev);
 	if( irq < 0 ) {
-		pr_debug("PCI: Error mapping IRQ on device %s\n", dev->slot_name);
+		pr_debug("PCI: Error mapping IRQ on device %s\n", pci_name(dev));
 		return irq;
 	}
 
-	pr_debug("Setting IRQ for slot %s to %d\n", dev->slot_name, irq);
+	pr_debug("Setting IRQ for slot %s to %d\n", pci_name(dev), irq);
 
 	return irq;
 }
arch/sh/drivers/pci/pci-sh7751.c +4 -4
diff -Nru a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
@@ -169,7 +169,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	pr_debug("PCI: IDE base address fixup for %s\n", d->slot_name);
+	pr_debug("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
@@ -401,11 +401,11 @@
 	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
 	irq = pcibios_map_platform_irq(slot,pin);
 	if( irq < 0 ) {
-		pr_debug("PCI: Error mapping IRQ on device %s\n", dev->slot_name);
+		pr_debug("PCI: Error mapping IRQ on device %s\n", pci_name(dev));
 		return irq;
 	}
-	
-	pr_debug("Setting IRQ for slot %s to %d\n", dev->slot_name, irq);
+
+	pr_debug("Setting IRQ for slot %s to %d\n", pci_name(dev), irq);
 
 	return irq;
 }
arch/sh/drivers/pci/pci-st40.c +1 -1
diff -Nru a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c
@@ -246,7 +246,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
arch/sh64/kernel/pci_sh5.c +1 -1
diff -Nru a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
@@ -39,7 +39,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
arch/sh64/kernel/pcibios.c +2 -2
diff -Nru a/arch/sh64/kernel/pcibios.c b/arch/sh64/kernel/pcibios.c
@@ -57,7 +57,7 @@
 	pci_read_config_dword(dev, reg, &check);
 	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
 		printk(KERN_ERR "PCI: Error while updating region "
-		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
 		       new, check);
 	}
 }
@@ -125,7 +125,7 @@
 			continue;
 		r = &dev->resource[idx];
 		if (!r->start && r->end) {
-			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
+			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
 			return -EINVAL;
 		}
 		if (r->flags & IORESOURCE_IO)
drivers/char/agp/generic.c +1 -1
diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
@@ -611,7 +611,7 @@
 	printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
 				agp_bridge->major_version,
 				agp_bridge->minor_version,
-				agp_bridge->dev->slot_name);
+				pci_name(agp_bridge->dev));
 
 	pci_read_config_dword(agp_bridge->dev,
 		      agp_bridge->capndx + PCI_AGP_STATUS, &command);
drivers/char/agp/sis-agp.c +1 -1
diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
@@ -79,7 +79,7 @@
 	printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
 		agp_bridge->major_version,
 		agp_bridge->minor_version,
-		agp_bridge->dev->slot_name);
+		pci_name(agp_bridge->dev));
 
 	pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command);
 	command = agp_collect_device_status(mode, command);
drivers/ide/pci/sgiioc4.c +3 -3
diff -Nru a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
@@ -688,7 +688,7 @@
 	if (ret < 0) {
 		printk(KERN_ERR
 		       "Failed to enable device %s at slot %s\n",
-		       d->name, dev->slot_name);
+		       d->name, pci_name(dev));
 		goto out;
 	}
 	pci_set_master(dev);
@@ -696,11 +696,11 @@
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
 	class_rev &= 0xff;
 	printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n",
-			d->name, dev->slot_name, class_rev);
+			d->name, pci_name(dev), class_rev);
 	if (class_rev < IOC4_SUPPORTED_FIRMWARE_REV) {
 		printk(KERN_ERR "Skipping %s IDE controller in slot %s: "
 			"firmware is obsolete - please upgrade to revision"
-			"46 or higher\n", d->name, dev->slot_name);
+			"46 or higher\n", d->name, pci_name(dev));
 		ret = -EAGAIN;
 		goto out;
 	}
drivers/isdn/hisax/hisax_fcpcipnp.c +1 -1
diff -Nru a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -902,7 +902,7 @@
 	adapter->irq = pdev->irq;
 
 	printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
-	       (char *) ent->driver_data, pdev->slot_name);
+	       (char *) ent->driver_data, pci_name(pdev));
 
 	retval = fcpcipnp_setup(adapter);
 	if (retval)
drivers/media/common/saa7146_video.c +1 -1
diff -Nru a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
@@ -889,7 +889,7 @@
 		
                 strcpy(cap->driver, "saa7146 v4l2");
 		strlcpy(cap->card, dev->ext->name, sizeof(cap->card));
-		sprintf(cap->bus_info,"PCI:%s",dev->pci->slot_name);
+		sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
 		cap->version = SAA7146_VERSION_CODE;
 		cap->capabilities =
 			V4L2_CAP_VIDEO_CAPTURE |
drivers/media/video/meye.c +1 -1
diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c
@@ -1154,7 +1154,7 @@
 		memset(cap, 0, sizeof(*cap));
 		strcpy(cap->driver, "meye");
 		strcpy(cap->card, "meye");
-		sprintf(cap->bus_info, "PCI:%s", meye.mchip_dev->slot_name);
+		sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev));
 		cap->version = (MEYE_DRIVER_MAJORVERSION << 8) +
 			       MEYE_DRIVER_MINORVERSION;
 		cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
drivers/media/video/zoran_driver.c +1 -1
diff -Nru a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
@@ -2694,7 +2694,7 @@
 		strncpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
 		strncpy(cap->driver, "zoran", sizeof(cap->driver));
 		snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
-			 zr->pci_dev->slot_name);
+			 pci_name(zr->pci_dev));
 		cap->version =
 		    KERNEL_VERSION(MAJOR_VERSION, MINOR_VERSION,
 				   RELEASE_VERSION);
drivers/net/defxx.c +1 -1
diff -Nru a/drivers/net/defxx.c b/drivers/net/defxx.c
@@ -420,7 +420,7 @@
 	}
 
 	if (pdev != NULL)
-		print_name = pdev->slot_name;
+		print_name = pci_name(pdev);
 
 	dev = alloc_fddidev(sizeof(*bp));
 	if (!dev) {
drivers/net/r8169.c +2 -2
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
@@ -1146,7 +1146,7 @@
 	// enable device (incl. PCI PM wakeup and hotplug setup)
 	rc = pci_enable_device(pdev);
 	if (rc) {
-		printk(KERN_ERR PFX "%s: enable failure\n", pdev->slot_name);
+		printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev));
 		goto err_out_free_dev;
 	}
 
@@ -1184,7 +1184,7 @@
 	rc = pci_request_regions(pdev, MODULENAME);
 	if (rc) {
 		printk(KERN_ERR PFX "%s: could not request regions.\n",
-		       pdev->slot_name);
+		       pci_name(pdev));
 		goto err_out_mwi;
 	}
 
drivers/net/s2io.c +1 -1
diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c
@@ -3192,7 +3192,7 @@
 	strncpy(info->version, s2io_driver_version,
 		sizeof(s2io_driver_version));
 	strncpy(info->fw_version, "", 32);
-	strncpy(info->bus_info, sp->pdev->slot_name, 32);
+	strncpy(info->bus_info, pci_name(sp->pdev), 32);
 	info->regdump_len = XENA_REG_SPACE;
 	info->eedump_len = XENA_EEPROM_SPACE;
 	info->testinfo_len = S2IO_TEST_LEN;
drivers/net/sk98lin/skethtool.c +1 -1
diff -Nru a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
@@ -257,7 +257,7 @@
 	strlcpy(info->driver, DRIVER_FILE_NAME, sizeof(info->driver));
 	strcpy(info->version, vers);
 	strcpy(info->fw_version, "N/A");
-	strlcpy(info->bus_info, pAC->PciDev->slot_name, ETHTOOL_BUSINFO_LEN);
+	strlcpy(info->bus_info, pci_name(pAC->PciDev), ETHTOOL_BUSINFO_LEN);
 }
 
 /*
drivers/net/sk98lin/skge.c +1 -1
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
@@ -3058,7 +3058,7 @@
 		*/
 		* ((SK_U32 *)pMemBuf) = 0;
 		* ((SK_U32 *)pMemBuf + 1) = pdev->bus->number;
-		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pdev->slot_name);
+		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pci_name(pdev));
 		if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
 			Err = -EFAULT;
 			goto fault_diag;
drivers/net/tulip/tulip.h +1 -1
diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
@@ -476,7 +476,7 @@
 
 		if (!i)
 			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
-					tp->pdev->slot_name);
+					pci_name(tp->pdev));
 	}
 }
 
drivers/net/typhoon.c +1 -1
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
@@ -2438,7 +2438,7 @@
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
 	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
 		printk(ERR_PFX "%s: Could not get Sleep Image version\n",
-			pdev->slot_name);
+			pci_name(pdev));
 		goto error_out_reset;
 	}
 
drivers/net/via-velocity.c +1 -1
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
@@ -2898,7 +2898,7 @@
 	struct velocity_info *vptr = dev->priv;
 	strcpy(info->driver, VELOCITY_NAME);
 	strcpy(info->version, VELOCITY_VERSION);
-	strcpy(info->bus_info, vptr->pdev->slot_name);
+	strcpy(info->bus_info, pci_name(vptr->pdev));
 }
 
 static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
drivers/net/wan/wanxl.c +16 -22
diff -Nru a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
@@ -72,7 +72,7 @@
 	u8 irq;
 
 	u8 __iomem *plx;	/* PLX PCI9060 virtual base address */
-	struct pci_dev *pdev;	/* for pdev->slot_name */
+	struct pci_dev *pdev;	/* for pci_name(pdev) */
 	int rx_in;
 	struct sk_buff *rx_skbs[RX_QUEUE_LENGTH];
 	card_status_t *status;	/* shared between host and card */
@@ -88,12 +88,6 @@
 }
 
 
-static inline const char* card_name(struct pci_dev *pdev)
-{
-	return pdev->slot_name;
-}
-
-
 static inline port_status_t* get_status(port_t *port)
 {
 	return &port->card->status->port_status[port->node];
@@ -107,7 +101,7 @@
 	dma_addr_t addr = pci_map_single(pdev, ptr, size, direction);
 	if (addr + size > 0x100000000LL)
 		printk(KERN_CRIT "wanXL %s: pci_map_single() returned memory"
-		       " at 0x%LX!\n", card_name(pdev),
+		       " at 0x%LX!\n", pci_name(pdev),
 		       (unsigned long long)addr);
 	return addr;
 }
@@ -201,7 +195,7 @@
 	       desc->stat != PACKET_EMPTY) {
 		if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
 			printk(KERN_CRIT "wanXL %s: received packet for"
-			       " nonexistent port\n", card_name(card->pdev));
+			       " nonexistent port\n", pci_name(card->pdev));
 		else {
 			struct sk_buff *skb = card->rx_skbs[card->rx_in];
 			port_t *port = &card->ports[desc->stat &
@@ -604,7 +598,7 @@
 	card = kmalloc(alloc_size, GFP_KERNEL);
 	if (card == NULL) {
 		printk(KERN_ERR "wanXL %s: unable to allocate memory\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
 		return -ENOBUFS;
@@ -623,7 +617,7 @@
 
 #ifdef DEBUG_PCI
 	printk(KERN_DEBUG "wanXL %s: pci_alloc_consistent() returned memory"
-	       " at 0x%LX\n", card_name(pdev),
+	       " at 0x%LX\n", pci_name(pdev),
 	       (unsigned long long)card->status_address);
 #endif
 
@@ -649,7 +643,7 @@
 	while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) {
 		if (time_before(timeout, jiffies)) {
 			printk(KERN_WARNING "wanXL %s: timeout waiting for"
-			       " PUTS to complete\n", card_name(pdev));
+			       " PUTS to complete\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -661,7 +655,7 @@
 
 		default:
 			printk(KERN_WARNING "wanXL %s: PUTS test 0x%X"
-			       " failed\n", card_name(pdev), stat & 0x30);
+			       " failed\n", pci_name(pdev), stat & 0x30);
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -681,7 +675,7 @@
 	    (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) {
 		printk(KERN_WARNING "wanXL %s: no enough on-board RAM"
 		       " (%u bytes detected, %u bytes required)\n",
-		       card_name(pdev), ramsize, BUFFERS_ADDR +
+		       pci_name(pdev), ramsize, BUFFERS_ADDR +
 		       (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports);
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
@@ -689,7 +683,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) {
 		printk(KERN_WARNING "wanXL %s: unable to Set Byte Swap"
-		       " Mode\n", card_name(pdev));
+		       " Mode\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -720,7 +714,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) {
 		printk(KERN_WARNING "wanXL %s: unable to Abort and Jump\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -735,7 +729,7 @@
 
 	if (!stat) {
 		printk(KERN_WARNING "wanXL %s: timeout while initializing card"
-		       "firmware\n", card_name(pdev));
+		       "firmware\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -745,12 +739,12 @@
 #endif
 
 	printk(KERN_INFO "wanXL %s: at 0x%X, %u KB of RAM at 0x%X, irq %u\n",
-	       card_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
+	       pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
 
 	/* Allocate IRQ */
 	if (request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) {
 		printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
-		       card_name(pdev), pdev->irq);
+		       pci_name(pdev), pdev->irq);
 		wanxl_pci_remove_one(pdev);
 		return -EBUSY;
 	}
@@ -762,7 +756,7 @@
 		struct net_device *dev = alloc_hdlcdev(port);
 		if (!dev) {
 			printk(KERN_ERR "wanXL %s: unable to allocate"
-			       " memory\n", card_name(pdev));
+			       " memory\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENOMEM;
 		}
@@ -783,7 +777,7 @@
 		get_status(port)->clocking = CLOCK_EXT;
 		if (register_hdlc_device(dev)) {
 			printk(KERN_ERR "wanXL %s: unable to register hdlc"
-			       " device\n", card_name(pdev));
+			       " device\n", pci_name(pdev));
 			free_netdev(dev);
 			wanxl_pci_remove_one(pdev);
 			return -ENOBUFS;
@@ -791,7 +785,7 @@
 		card->n_ports++;
 	}
 
-	printk(KERN_INFO "wanXL %s: port", card_name(pdev));
+	printk(KERN_INFO "wanXL %s: port", pci_name(pdev));
 	for (i = 0; i < ports; i++)
 		printk("%s #%i: %s", i ? "," : "", i,
 		       card->ports[i].dev->name);
drivers/parisc/dino.c +2 -3
diff -Nru a/drivers/parisc/dino.c b/drivers/parisc/dino.c
@@ -653,14 +653,13 @@
 				      PCI_INTERRUPT_PIN, 1, &irq_pin);
 			irq_pin = (irq_pin + PCI_SLOT(dev->devfn) - 1) % 4 ;
 			printk(KERN_WARNING "Device %s has undefined IRQ, "
-					"setting to %d\n", dev->slot_name,
-					irq_pin);
+					"setting to %d\n", pci_name(dev), irq_pin);
 			dino_cfg_write(dev->bus, dev->devfn, 
 				       PCI_INTERRUPT_LINE, 1, irq_pin);
 			dino_assign_irq(dino_dev, irq_pin, &dev->irq);
 #else
 			dev->irq = 65535;
-			printk(KERN_WARNING "Device %s has unassigned IRQ\n", dev->slot_name);	
+			printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev));
 #endif
 		} else {
 
drivers/pci/pci.c +1 -1
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
@@ -271,7 +271,7 @@
 	if ((pmc & PCI_PM_CAP_VER_MASK) != 2) {
 		printk(KERN_DEBUG
 		       "PCI: %s has unsupported PM cap regs version (%u)\n",
-		       dev->slot_name, pmc & PCI_PM_CAP_VER_MASK);
+		       pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
 		return -EIO;
 	}
 
drivers/pci/probe.c +0 -1
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
@@ -549,7 +549,6 @@
 {
 	u32 class;
 
-	dev->slot_name = dev->dev.bus_id;
 	sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
 		dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 
drivers/pci/setup-res.c +1 -1
diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
@@ -86,7 +86,7 @@
 	}
 	res->flags &= ~IORESOURCE_UNSET;
 	DBGC((KERN_INFO "PCI: moved device %s resource %d (%lx) to %x\n",
-		dev->slot_name, resno, res->flags,
+		pci_name(dev), resno, res->flags,
 		new & ~PCI_REGION_FLAG_MASK));
 }
 
drivers/pcmcia/yenta_socket.c +1 -1
diff -Nru a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
@@ -963,7 +963,7 @@
 	 * the irq stuff...
 	 */
 	printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n",
-		dev->slot_name, dev->subsystem_vendor, dev->subsystem_device);
+		pci_name(dev), dev->subsystem_vendor, dev->subsystem_device);
 
 	yenta_config_init(socket);
 
drivers/scsi/qla2xxx/qla_os.c +7 -7
diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
@@ -1847,13 +1847,13 @@
 		if (pio_len < MIN_IOBASE_LEN) {
 			qla_printk(KERN_WARNING, ha,
 			    "Invalid PCI I/O region size (%s)...\n",
-			    ha->pdev->slot_name);
+				pci_name(ha->pdev));
 			pio = 0;
 		}
 	} else {
 		qla_printk(KERN_WARNING, ha,
 		    "region #0 not a PIO resource (%s)...\n",
-		    ha->pdev->slot_name);
+		    pci_name(ha->pdev));
 		pio = 0;
 	}
 
@@ -1865,20 +1865,20 @@
 	if (!(mmio_flags & IORESOURCE_MEM)) {
 		qla_printk(KERN_ERR, ha,
 		    "region #0 not an MMIO resource (%s), aborting\n",
-		    ha->pdev->slot_name);
+		    pci_name(ha->pdev));
 		goto iospace_error_exit;
 	}
 	if (mmio_len < MIN_IOBASE_LEN) {
 		qla_printk(KERN_ERR, ha,
 		    "Invalid PCI mem region size (%s), aborting\n",
-		    ha->pdev->slot_name);
+			pci_name(ha->pdev));
 		goto iospace_error_exit;
 	}
 
 	if (pci_request_regions(ha->pdev, ha->brd_info->drv_name)) {
 		qla_printk(KERN_WARNING, ha,
-		    "Failed to reserve PIO/MMIO regions (%s)\n", 
-		    ha->pdev->slot_name);
+		    "Failed to reserve PIO/MMIO regions (%s)\n",
+		    pci_name(ha->pdev));
 
 		goto iospace_error_exit;
 	}
@@ -1888,7 +1888,7 @@
 	ha->iobase = ioremap(mmio, MIN_IOBASE_LEN);
 	if (!ha->iobase) {
 		qla_printk(KERN_ERR, ha,
-		    "cannot remap MMIO (%s), aborting\n", ha->pdev->slot_name);
+		    "cannot remap MMIO (%s), aborting\n", pci_name(ha->pdev));
 
 		goto iospace_error_exit;
 	}
author
#2 lore raw

PATCH 1/1 Remove pci_dev->slot_name

ChangeSet 1.1998.11.7, 2005/02/07 14:37:01-08:00, [email protected]

[PATCH] Remove pci_dev->slot_name

This is a pointer to dev.bus_id, which is properly accessed through the pci_name() function.

 include/linux/pci.h |    2 --
 1 files changed, 2 deletions(-)
include/linux/pci.h +0 -2
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
@@ -549,8 +549,6 @@
 	unsigned int	irq;
 	struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
 
-	char *		slot_name;	/* pointer to dev.bus_id */
-
 	/* These fields are used by common fixups */
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
 	unsigned int	multifunction:1;/* Part of multi-function device */
author
#3 lore raw

PATCH 1/1 PCI Hotplug: Remove unneeded instructions from ibmphp_pci.c

ChangeSet 1.1998.11.8, 2005/02/07 14:37:42-08:00, [email protected]

[PATCH] PCI Hotplug: Remove unneeded instructions from ibmphp_pci.c

this patch removes some unneeded code from ibmphp_pci.c. First I thought it is a bug and the second line should have been "sec_no = (int) sec_number". But than I found exactly the same read only 9 lines higher and after it the line I expected the second one to be. Between the 2 pci_bus_read_config_byte's are only some checks so I don't expect them to return different results. And sec_no is and int so removing this wont change anything at all.

 drivers/pci/hotplug/ibmphp_pci.c |    3 ---
 1 files changed, 3 deletions(-)
drivers/pci/hotplug/ibmphp_pci.c +0 -3
diff -Nru a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
@@ -1384,9 +1384,6 @@
 		return -EINVAL;
 	}
 
-	pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
-	sec_no = (int) sec_no;
-
 	pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SUBORDINATE_BUS, &sub_number);
 	sub_no = (int) sub_number;
 	debug ("sub_no is %d, sec_no is %d\n", sub_no, sec_no);
author
#4 lore raw

PATCH 1/1 PCI: pci_proc_domain

ChangeSet 1.1998.11.9, 2005/02/07 14:38:06-08:00, [email protected]

[PATCH] PCI: pci_proc_domain

There's no need for the architectures to know how to name busses, so replace pci_name_bus with pci_proc_domain -- a predicate to allow architectures to choose whether domains are included in /proc/bus/pci or not. I've converted all architectures but only tested ia64 and a CONFIG_PCI_DOMAINS=n build.

 arch/ppc64/kernel/pci.c   |   16 ++++++----------
 arch/sparc64/kernel/pci.c |    6 ------
 drivers/pci/proc.c        |   20 +++++++++++++-------
 include/asm-alpha/pci.h   |   11 ++---------
 include/asm-ia64/pci.h    |    9 ++-------
 include/asm-mips/pci.h    |   11 ++---------
 include/asm-ppc/pci.h     |    3 +--
 include/asm-ppc64/pci.h   |    4 ++--
 include/asm-sparc64/pci.h |    5 ++++-
 include/linux/pci.h       |    3 +--
 10 files changed, 33 insertions(+), 55 deletions(-)
arch/ppc64/kernel/pci.c +6 -10
diff -Nru a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
@@ -300,19 +300,15 @@
 
 EXPORT_SYMBOL(pci_domain_nr);
 
-/* Set the name of the bus as it appears in /proc/bus/pci */
-int pci_name_bus(char *name, struct pci_bus *bus)
+/* Decide whether to display the domain number in /proc */
+int pci_proc_domain(struct pci_bus *bus)
 {
-#ifndef CONFIG_PPC_ISERIES
+#ifdef CONFIG_PPC_ISERIES
+	return 0;
+#else
 	struct pci_controller *hose = pci_bus_to_host(bus);
-
-	if (hose->buid)
-		sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	else
+	return hose->buid;
 #endif
-		sprintf(name, "%02x", bus->number);
-
-	return 0;
 }
 
 /*
arch/sparc64/kernel/pci.c +0 -6
diff -Nru a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
@@ -794,12 +794,6 @@
 }
 EXPORT_SYMBOL(pci_domain_nr);
 
-int pci_name_bus(char *name, struct pci_bus *bus)
-{
-	sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	return 0;
-}
-
 int pcibios_prep_mwi(struct pci_dev *dev)
 {
 	/* We set correct PCI_CACHE_LINE_SIZE register values for every
drivers/pci/proc.c +13 -7
diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
@@ -384,26 +384,32 @@
 int pci_proc_attach_device(struct pci_dev *dev)
 {
 	struct pci_bus *bus = dev->bus;
-	struct proc_dir_entry *de, *e;
+	struct proc_dir_entry *e;
 	char name[16];
 
 	if (!proc_initialized)
 		return -EACCES;
 
-	if (!(de = bus->procdir)) {
-		if (pci_name_bus(name, bus))
-			return -EEXIST;
-		de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
-		if (!de)
+	if (!bus->procdir) {
+		if (pci_proc_domain(bus)) {
+			sprintf(name, "%04x:%02x", pci_domain_nr(bus),
+					bus->number);
+		} else {
+			sprintf(name, "%02x", bus->number);
+		}
+		bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
+		if (!bus->procdir)
 			return -ENOMEM;
 	}
+
 	sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-	e = dev->procent = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, de);
+	e = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir);
 	if (!e)
 		return -ENOMEM;
 	e->proc_fops = &proc_bus_pci_operations;
 	e->data = dev;
 	e->size = dev->cfg_size;
+	dev->procent = e;
 
 	return 0;
 }
include/asm-alpha/pci.h +2 -9
diff -Nru a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
@@ -228,17 +228,10 @@
 
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
-static inline int
-pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
 	struct pci_controller *hose = bus->sysdata;
-
-	if (likely(hose->need_domain_info == 0)) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", hose->index, bus->number);
-	}
-	return 0;
+	return hose->need_domain_info;
 }
 
 static inline void
include/asm-ia64/pci.h +2 -7
diff -Nru a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
@@ -121,14 +121,9 @@
 
 extern struct pci_ops pci_root_ops;
 
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	if (pci_domain_nr(bus) == 0) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	}
-	return 0;
+	return (pci_domain_nr(bus) != 0);
 }
 
 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
include/asm-mips/pci.h +2 -9
diff -Nru a/include/asm-mips/pci.h b/include/asm-mips/pci.h
@@ -137,17 +137,10 @@
 
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
-static inline int
-pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
 	struct pci_controller *hose = bus->sysdata;
-
-	if (likely(hose->need_domain_info == 0)) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", hose->index, bus->number);
-	}
-	return 0;
+	return hose->need_domain_info;
 }
 
 #endif /* CONFIG_PCI_DOMAINS */
include/asm-ppc/pci.h +1 -2
diff -Nru a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
@@ -79,9 +79,8 @@
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
 /* Set the name of the bus as it appears in /proc/bus/pci */
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	sprintf(name, "%02x", bus->number);
 	return 0;
 }
 
include/asm-ppc64/pci.h +2 -2
diff -Nru a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
@@ -190,8 +190,8 @@
 
 extern int pci_domain_nr(struct pci_bus *bus);
 
-/* Set the name of the bus as it appears in /proc/bus/pci */
-extern int pci_name_bus(char *name, struct pci_bus *bus);
+/* Decide whether to display the domain number in /proc */
+extern int pci_proc_domain(struct pci_bus *bus);
 
 struct vm_area_struct;
 /* Map a range of PCI memory or I/O space for a device into user space */
include/asm-sparc64/pci.h +4 -1
diff -Nru a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
@@ -223,7 +223,10 @@
 /* Return the index of the PCI controller for device PDEV. */
 
 extern int pci_domain_nr(struct pci_bus *bus);
-extern int pci_name_bus(char *name, struct pci_bus *bus);
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+	return 1;
+}
 
 /* Platform support for /proc/bus/pci/X/Y mmap()s. */
 
include/linux/pci.h +1 -2
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
@@ -964,9 +964,8 @@
  */
 #ifndef CONFIG_PCI_DOMAINS
 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	sprintf(name, "%02x", bus->number);
 	return 0;
 }
 #endif
author
#5 lore raw

PATCH 1/1 PCI: Make pci_claim_resource __devinit

ChangeSet 1.1998.11.10, 2005/02/07 14:38:32-08:00, [email protected]

[PATCH] PCI: Make pci_claim_resource __devinit

ia64 calls pci_claim_resource() from pcibios_fixup_bus(), which is __devinit, so pci_claim_resource() needs to be __devinit too.

 drivers/pci/setup-res.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/pci/setup-res.c +1 -1
diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
@@ -90,7 +90,7 @@
 		new & ~PCI_REGION_FLAG_MASK));
 }
 
-int __init
+int __devinit
 pci_claim_resource(struct pci_dev *dev, int resource)
 {
 	struct resource *res = &dev->resource[resource];
author
#6 lore raw

PATCH 1/1 PCI: fix pci_remove_legacy_files() crash

ChangeSet 1.1998.11.11, 2005/02/07 16:20:26-08:00, [email protected]

[PATCH] PCI: fix pci_remove_legacy_files() crash

The legacy_io which is the member of pci_bus struct might be NULL. It should be checked.

This patch checks 'b->legacy_io', NULL or not.

 drivers/pci/probe.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/pci/probe.c +5 -3
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
@@ -64,9 +64,11 @@
 
 void pci_remove_legacy_files(struct pci_bus *b)
 {
-	class_device_remove_bin_file(&b->class_dev, b->legacy_io);
-	class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
-	kfree(b->legacy_io); /* both are allocated here */
+	if (b->legacy_io) {
+		class_device_remove_bin_file(&b->class_dev, b->legacy_io);
+		class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
+		kfree(b->legacy_io); /* both are allocated here */
+	}
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }
author
#7 lore raw

PATCH 1/1 PCI: NUMA-Q PCI config access arg validation

ChangeSet 1.1998.11.12, 2005/02/07 16:20:50-08:00, [email protected]

[PATCH] PCI: NUMA-Q PCI config access arg validation

Fix NUMA-Q PCI config access bus validation. "bus" indexes into BUS2QUAD, which is mp_bus_id_to_node[MAX_MP_BUSSES].

This depends on the "pci_raw_ops should use unsigned args" patch I posted earlier today (no functional dependency; it just happens to be very close textually).

 arch/i386/pci/numa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/i386/pci/numa.c +2 -2
diff -Nru a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
@@ -18,7 +18,7 @@
 {
 	unsigned long flags;
 
-	if (!value || (bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
+	if (!value || (bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
 		return -EINVAL;
 
 	spin_lock_irqsave(&pci_config_lock, flags);
@@ -46,7 +46,7 @@
 {
 	unsigned long flags;
 
-	if ((bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255)) 
+	if ((bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255)) 
 		return -EINVAL;
 
 	spin_lock_irqsave(&pci_config_lock, flags);
author
#8 lore raw

PATCH 1/1 PCI: pci_raw_ops should use unsigned args

ChangeSet 1.1998.11.13, 2005/02/07 16:21:16-08:00, [email protected]

[PATCH] PCI: pci_raw_ops should use unsigned args

Convert pci_raw_ops to use unsigned segment (aka domain), bus, and devfn. With the previous code, various ia64 config accesses fail due to segment sign-extension problems.

ia64:
- With a signed seg >= 0x8, unwanted sign-extension occurs when "seg << 28" is cast to u64 in PCI_SAL_EXT_ADDRESS()
- PCI_SAL_EXT_ADDRESS(): cast to u64 *before* shifting; otherwise "seg << 28" is evaluated as unsigned int (32 bits) and gets truncated when seg > 0xf
- pci_sal_read(): validate "value" ptr as other arches do
- pci_sal_{read,write}(): return -EINVAL rather than SAL error status

 arch/i386/pci/direct.c     |   12 ++++++----
 arch/i386/pci/mmconfig.c   |    6 +++--
 arch/i386/pci/numa.c       |    6 +++--
 arch/i386/pci/pcbios.c     |    6 +++--
 arch/ia64/pci/pci.c        |   53 ++++++++++++++++++---------------------------
 arch/x86_64/pci/mmconfig.c |    8 ++++--
 include/linux/pci.h        |    6 +++--
 7 files changed, 51 insertions(+), 46 deletions(-)
 arch/i386/pci/direct.c     |   12 ++++++----
 arch/i386/pci/mmconfig.c   |    6 +++--
 arch/i386/pci/numa.c       |    6 +++--
 arch/i386/pci/pcbios.c     |    6 +++--
 arch/ia64/pci/pci.c        |   53 ++++++++++++++++++---------------------------
 arch/x86_64/pci/mmconfig.c |    8 ++++--
 include/linux/pci.h        |    6 +++--
 7 files changed, 51 insertions(+), 46 deletions(-)
arch/i386/pci/direct.c +8 -4
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
@@ -13,7 +13,8 @@
 #define PCI_CONF1_ADDRESS(bus, devfn, reg) \
 	(0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
 
-static int pci_conf1_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf1_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -41,7 +42,8 @@
 	return 0;
 }
 
-static int pci_conf1_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf1_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
@@ -83,7 +85,8 @@
 
 #define PCI_CONF2_ADDRESS(dev, reg)	(u16)(0xC000 | (dev << 8) | reg)
 
-static int pci_conf2_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf2_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 	int dev, fn;
@@ -121,7 +124,8 @@
 	return 0;
 }
 
-static int pci_conf2_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf2_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 	int dev, fn;
arch/i386/pci/mmconfig.c +4 -2
diff -Nru a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
@@ -34,7 +34,8 @@
 	}
 }
 
-static int pci_mmcfg_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -62,7 +63,8 @@
 	return 0;
 }
 
-static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
arch/i386/pci/numa.c +4 -2
diff -Nru a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
@@ -14,7 +14,8 @@
 #define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
 	(0x80000000 | (BUS2LOCAL(bus) << 16) | (devfn << 8) | (reg & ~3))
 
-static int pci_conf1_mq_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf1_mq_read(unsigned int seg, unsigned int bus,
+			     unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -42,7 +43,8 @@
 	return 0;
 }
 
-static int pci_conf1_mq_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf1_mq_write(unsigned int seg, unsigned int bus,
+			      unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
arch/i386/pci/pcbios.c +4 -2
diff -Nru a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
@@ -172,7 +172,8 @@
 	return (int) (ret & 0xff00) >> 8;
 }
 
-static int pci_bios_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_bios_read(unsigned int seg, unsigned int bus,
+			 unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long result = 0;
 	unsigned long flags;
@@ -227,7 +228,8 @@
 	return (int)((result & 0xff00) >> 8);
 }
 
-static int pci_bios_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_bios_write(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long result = 0;
 	unsigned long flags;
arch/ia64/pci/pci.c +22 -31

103 lines not on this page · raw message

arch/x86_64/pci/mmconfig.c +5 -3
diff -Nru a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
@@ -17,12 +17,13 @@
 /* Static virtual mapping of the MMCONFIG aperture */
 char *pci_mmcfg_virt;
 
-static inline char *pci_dev_base(int bus, int devfn)
+static inline char *pci_dev_base(unsigned int bus, unsigned int devfn)
 {
 	return pci_mmcfg_virt + ((bus << 20) | (devfn << 12));
 }
 
-static int pci_mmcfg_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+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(bus, devfn); 
 
@@ -44,7 +45,8 @@
 	return 0;
 }
 
-static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 value)
+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(bus,devfn);
 
include/linux/pci.h +4 -2
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
@@ -640,8 +640,10 @@
 };
 
 struct pci_raw_ops {
-	int (*read)(int dom, int bus, int devfn, int reg, int len, u32 *val);
-	int (*write)(int dom, int bus, int devfn, int reg, int len, u32 val);
+	int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn,
+		    int reg, int len, u32 *val);
+	int (*write)(unsigned int domain, unsigned int bus, unsigned int devfn,
+		     int reg, int len, u32 val);
 };
 
 extern struct pci_raw_ops *raw_pci_ops;
author
#9 lore raw

PATCH 1/1 arch/i386/kernel/pci/irq.c: Wrong message output

ChangeSet 1.1998.11.14, 2005/02/08 12:22:53-08:00, [email protected]

[PATCH] arch/i386/kernel/pci/irq.c: Wrong message output

The following has been reported in the wild for kernel 2.6.8-24:

PCI: Enabling device 0000:00:05.0 (0000 -> 0002)
PCI: No IRQ known for interrupt pin @ of device 0000:00:05.0. Probably buggy MP table.

It should read "No IRQ known for interrupt pin A", but the 'pin' variable has already been decremented (from 1 to 0), so the line:

printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", 'A' + pin - 1, dev->slot_name, msg);

causes "pin @" to be output, because 'A' + 0 - 1 == '@'.

The supplied patch should fix it. It also removes a redundant check for a nonzero pin.

 arch/i386/pci/irq.c |   73 +++++++++++++++++++++++++---------------------------
 1 files changed, 36 insertions(+), 37 deletions(-)
arch/i386/pci/irq.c +36 -37
diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
@@ -1031,56 +1031,55 @@
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 	if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
-		char *msg;
-		msg = "";
+		char *msg = "";
+
+		pin--;		/* interrupt pins are numbered starting from 1 */
+
 		if (io_apic_assign_pci_irqs) {
 			int irq;
 
-			if (pin) {
-				pin--;		/* interrupt pins are numbered starting from 1 */
-				irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
-				/*
-				 * Busses behind bridges are typically not listed in the MP-table.
-				 * In this case we have to look up the IRQ based on the parent bus,
-				 * parent slot, and pin number. The SMP code detects such bridged
-				 * busses itself so we should get into this branch reliably.
-				 */
-				temp_dev = dev;
-				while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
-					struct pci_dev * bridge = dev->bus->self;
-
-					pin = (pin + PCI_SLOT(dev->devfn)) % 4;
-					irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 
-							PCI_SLOT(bridge->devfn), pin);
-					if (irq >= 0)
-						printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",
-							pci_name(bridge), 'A' + pin, irq);
-					dev = bridge;
-				}
-				dev = temp_dev;
-				if (irq >= 0) {
+			irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
+			/*
+			 * Busses behind bridges are typically not listed in the MP-table.
+			 * In this case we have to look up the IRQ based on the parent bus,
+			 * parent slot, and pin number. The SMP code detects such bridged
+			 * busses itself so we should get into this branch reliably.
+			 */
+			temp_dev = dev;
+			while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
+				struct pci_dev * bridge = dev->bus->self;
+
+				pin = (pin + PCI_SLOT(dev->devfn)) % 4;
+				irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 
+						PCI_SLOT(bridge->devfn), pin);
+				if (irq >= 0)
+					printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",
+						pci_name(bridge), 'A' + pin, irq);
+				dev = bridge;
+			}
+			dev = temp_dev;
+			if (irq >= 0) {
 #ifdef CONFIG_PCI_MSI
-					if (!platform_legacy_irq(irq))
-						irq = IO_APIC_VECTOR(irq);
+				if (!platform_legacy_irq(irq))
+					irq = IO_APIC_VECTOR(irq);
 #endif
-					printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n",
-						pci_name(dev), 'A' + pin, irq);
-					dev->irq = irq;
-					return 0;
-				} else
-					msg = " Probably buggy MP table.";
-			}
+				printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n",
+					pci_name(dev), 'A' + pin, irq);
+				dev->irq = irq;
+				return 0;
+			} else
+				msg = " Probably buggy MP table.";
 		} else if (pci_probe & PCI_BIOS_IRQ_SCAN)
 			msg = "";
 		else
 			msg = " Please try using pci=biosirq.";
-			
+
 		/* With IDE legacy devices the IRQ lookup failure is not a problem.. */
 		if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE && !(dev->class & 0x5))
 			return 0;
-			
+
 		printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n",
-		       'A' + pin - 1, pci_name(dev), msg);
+		       'A' + pin, pci_name(dev), msg);
 	}
 	/* VIA bridges use interrupt line for apic/pci steering across
 	   the V-Link */
author
#10 lore raw

PATCH 1/1 PCI: Dynids - passing driver data

ChangeSet 1.1998.11.15, 2005/02/08 12:23:18-08:00, [email protected]

[PATCH] PCI: Dynids - passing driver data

Currently, code exists in the pci layer to allow userspace to specify driver data when adding a pci dynamic id from sysfs. However, this data is never used and there exists no way in the existing code to use it. This patch allows device drivers to indicate that they want driver data passed to them on dynamic id adds by initializing use_driver_data in their pci_driver->pci_dynids struct. The documentation has also been updated to reflect this.

 Documentation/pci.txt    |    8 ++++----
 drivers/pci/pci-driver.c |    1 -
 2 files changed, 4 insertions(+), 5 deletions(-)
Documentation/pci.txt +4 -4
diff -Nru a/Documentation/pci.txt b/Documentation/pci.txt
@@ -99,10 +99,10 @@
 Users need pass only as many fields as necessary; vendor, device,
 subvendor, and subdevice fields default to PCI_ANY_ID (FFFFFFFF),
 class and classmask fields default to 0, and driver_data defaults to
-0UL.  Device drivers must call
-   pci_dynids_set_use_driver_data(pci_driver *, 1)
-in order for the driver_data field to get passed to the driver.
-Otherwise, only a 0 is passed in that field.
+0UL.  Device drivers must initialize use_driver_data in the dynids struct
+in their pci_driver struct prior to calling pci_register_driver in order
+for the driver_data field to get passed to the driver. Otherwise, only a
+0 is passed in that field.
 
 When the driver exits, it just calls pci_unregister_driver() and the PCI layer
 automatically calls the remove hook for all devices handled by the driver.
drivers/pci/pci-driver.c +0 -1
diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
@@ -115,7 +115,6 @@
 static inline void
 pci_init_dynids(struct pci_dynids *dynids)
 {
-	memset(dynids, 0, sizeof(*dynids));
 	spin_lock_init(&dynids->lock);
 	INIT_LIST_HEAD(&dynids->list);
 }
author
#11 lore raw

PATCH 1/1 drivers/pci/*: convert to pci_register_driver

ChangeSet 1.1998.11.16, 2005/02/17 15:05:08-08:00, [email protected]

[PATCH] drivers/pci/*: convert to pci_register_driver

convert from pci_module_init to pci_register_driver (from:http://kerneljanitors.org/TODO).

 drivers/pci/pcie/portdrv_pci.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/portdrv_pci.c +1 -1
diff -Nru a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
@@ -106,7 +106,7 @@
 	int retval = 0;
 
 	pcie_port_bus_register();
-	retval = pci_module_init(&pcie_portdrv);
+	retval = pci_register_driver(&pcie_portdrv);
 	if (retval)
 		pcie_port_bus_unregister();
 	return retval;
author
#12 lore raw

PATCH 1/1 PCI Hotplug: Fix OSHP calls in shpchp and pciehp drivers

ChangeSet 1.1998.11.17, 2005/02/17 15:05:32-08:00, [email protected]

[PATCH] PCI Hotplug: Fix OSHP calls in shpchp and pciehp drivers

Here is a patch to fix a problem in OSHP calls in shpchp and pciehp drivers that was detected in 2.6.11-rc3. In this kernel, calls to acpi_evaluate_object() to evaluate OSHP returned AE_BUFFER_OVERFLOW with the existing code. Earlier kernels didn't return this error code. The correct fix should be making return_buffer pointer NULL for no value is returned from this method.

 drivers/pci/hotplug/pciehprm_acpi.c |    3 +--
 drivers/pci/hotplug/shpchprm_acpi.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/pci/hotplug/pciehprm_acpi.c +1 -2
diff -Nru a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c
@@ -254,10 +254,9 @@
 {
 	acpi_status		status;
 	u8			*path_name = acpi_path_name(ab->handle);
-	struct acpi_buffer	ret_buf = { 0, NULL};
 
 	/* run OSHP */
-	status = acpi_evaluate_object(ab->handle, METHOD_NAME_OSHP, NULL, &ret_buf);
+	status = acpi_evaluate_object(ab->handle, METHOD_NAME_OSHP, NULL, NULL);
 	if (ACPI_FAILURE(status)) {
 		err("acpi_pciehprm:%s OSHP fails=0x%x\n", path_name, status);
 		oshp_run_status = (status == AE_NOT_FOUND) ? OSHP_NOT_EXIST : OSHP_RUN_FAILED;
drivers/pci/hotplug/shpchprm_acpi.c +1 -2
diff -Nru a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
@@ -242,10 +242,9 @@
 {
 	acpi_status		status;
 	u8			*path_name = acpi_path_name(ab->handle);
-	struct acpi_buffer	ret_buf = { 0, NULL};
 
 	/* run OSHP */
-	status = acpi_evaluate_object(ab->handle, METHOD_NAME_OSHP, NULL, &ret_buf);
+	status = acpi_evaluate_object(ab->handle, METHOD_NAME_OSHP, NULL, NULL);
 	if (ACPI_FAILURE(status)) {
 		err("acpi_pciehprm:%s OSHP fails=0x%x\n", path_name, status);
 	} else
author
#13 lore raw

PATCH 1/1 PCI: Add PCI quirk for SMBus on the Toshiba Satellite A40

ChangeSet 1.1998.11.18, 2005/02/17 15:05:53-08:00, [email protected]

[PATCH] PCI: Add PCI quirk for SMBus on the Toshiba Satellite A40

The Toshiba Satellite A40 laptop hides its SMBus device, much like a number of Asus boards reputedly do. This prevents access to the LM90 hardware monitoring chip. This simple patch extends the PCI quirk used for the Asus and HP systems to this Toshiba laptop.

 drivers/pci/quirks.c |    6 ++++++
 1 files changed, 6 insertions(+)
drivers/pci/quirks.c +6 -0
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
@@ -801,6 +801,12 @@
 			case 0x12bc: /* HP D330L */
 				asus_hides_smbus = 1;
 			}
+	} else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA)) {
+		if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
+			switch(dev->subsystem_device) {
+			case 0x0001: /* Toshiba Satellite A40 */
+				asus_hides_smbus = 1;
+			}
 	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82845_HB,	asus_hides_smbus_hostbridge );
author
#14 lore raw

PATCH 1/1 PCI: allow x86_64 to do pci express

ChangeSet 1.1998.11.19, 2005/02/17 15:06:16-08:00, [email protected]

[PATCH] PCI: allow x86_64 to do pci express

Quoted 5 lines · Piotr Kaczuba
Quoted 4 lines · Andi Kleen
Quoted 2 lines · Piotr Kaczuba

Is there a reason why "PCI access mode" config option isn't available for x86_64? Due to this, PCIE config options aren't available either.

Quoted 8 lines
Quoted 4 lines

There is no 64bit PCI BIOS, so access is always direct.

I assume you mean mmconfig access with "PCIE config options", that is a separate config option and available.

I mean the PCIEPORTBUS option which depends on PCI_GOMMCONFIG or PCI_GOANY. I assume that due to PCI_MMCONFIG / PCI_GOMMCONFIG mismatch it's not available on x86_64.

Ok, that's a bug in PCIEPORTBUS. Best is probably to completely remove the dependency, it doesn't make much sense (the code has to handle the case of mmconfig not being available at runtime anyways)

Remove bogus dependency in PCI Express root driver.

 drivers/pci/pcie/Kconfig |    1 -
 1 files changed, 1 deletion(-)
drivers/pci/pcie/Kconfig +0 -1
diff -Nru a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
@@ -3,7 +3,6 @@
 #
 config PCIEPORTBUS
 	bool "PCI Express support"
-	depends on PCI_GOMMCONFIG || PCI_GOANY
 	default n
 
 	---help---
author
#15 lore raw

PATCH 1/1 pci/quirks.c: unhide SMBus device on Samsung P35 laptop

ChangeSet 1.1998.11.20, 2005/02/17 15:06:37-08:00, [email protected]

[PATCH] pci/quirks.c: unhide SMBus device on Samsung P35 laptop

this patch is needed to make the SMBus device on my Samsung P35 laptop visible. By default, it doesn't appear as a pci device.

Patch tested, works perfectly for me. Please apply.

 drivers/pci/quirks.c    |    6 ++++++
 include/linux/pci_ids.h |    2 ++
 2 files changed, 8 insertions(+)
drivers/pci/quirks.c +6 -0
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
@@ -807,6 +807,12 @@
 			case 0x0001: /* Toshiba Satellite A40 */
 				asus_hides_smbus = 1;
 			}
+       } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) {
+               if (dev->device ==  PCI_DEVICE_ID_INTEL_82855PM_HB)
+                       switch(dev->subsystem_device) {
+                       case 0xC00C: /* Samsung P35 notebook */
+                               asus_hides_smbus = 1;
+                       }
 	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82845_HB,	asus_hides_smbus_hostbridge );
include/linux/pci_ids.h +2 -0
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
@@ -1905,6 +1905,8 @@
 #define PCI_DEVICE_ID_OXSEMI_16PCI954PP	0x9513
 #define PCI_DEVICE_ID_OXSEMI_16PCI952	0x9521
 
+#define PCI_VENDOR_ID_SAMSUNG		0x144d
+
 #define PCI_VENDOR_ID_AIRONET		0x14b9
 #define PCI_DEVICE_ID_AIRONET_4800_1	0x0001
 #define PCI_DEVICE_ID_AIRONET_4800	0x4500 // values switched?  see
author
#16 lore raw

PATCH 1/1 PCI: clean up the msi api

ChangeSet 1.1998.11.21, 2005/02/17 15:07:01-08:00, [email protected]

[PATCH] PCI: clean up the msi api

Remove the call to request_mem_region() in msix_capability_init() to grab the MSI-X vector table. Drivers should be using pci_request_regions() so that they own all of the PCI BARs, and the MSI-X core should trust it's being called by a correct driver.

 drivers/pci/msi.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
drivers/pci/msi.c +2 -11
diff -Nru a/drivers/pci/msi.c b/drivers/pci/msi.c
@@ -616,15 +616,10 @@
 	bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
 	phys_addr = pci_resource_start (dev, bir);
 	phys_addr += (u32)(table_offset & ~PCI_MSIX_FLAGS_BIRMASK);
-	if (!request_mem_region(phys_addr,
-		nr_entries * PCI_MSIX_ENTRY_SIZE,
-		"MSI-X vector table"))
-		return -ENOMEM;
 	base = ioremap_nocache(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
-	if (base == NULL) {
-		release_mem_region(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
+	if (base == NULL)
 		return -ENOMEM;
-	}
+
 	/* MSI-X Table Initialization */
 	for (i = 0; i < nvec; i++) {
 		entry = alloc_msi_entry();
@@ -859,8 +854,6 @@
 			phys_addr += (u32)(table_offset &
 				~PCI_MSIX_FLAGS_BIRMASK);
 			iounmap(base);
-			release_mem_region(phys_addr,
-				nr_entries * PCI_MSIX_ENTRY_SIZE);
 		}
 	}
 
@@ -1133,8 +1126,6 @@
 			phys_addr += (u32)(table_offset &
 				~PCI_MSIX_FLAGS_BIRMASK);
 			iounmap(base);
-			release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE *
-				multi_msix_capable(control));
 			printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
 			       "called without free_irq() on all MSI-X vectors\n",
 			       pci_name(dev));
#17 lore raw

Re: [PATCH] convert pci_dev->slot_name usage to pci_name()

In reply to Greg KH
Quoted 5 lines · Greg KH

ChangeSet 1.1998.11.6, 2005/02/07 14:36:14-08:00, [email protected]

[PATCH] convert pci_dev->slot_name usage to pci_name()

Prepare for removal of pci_dev->slot_name

Can you split this up and send me the drivers/net/* portion?

Jeff

author
#18 lore raw

Re: [PATCH] convert pci_dev->slot_name usage to pci_name()

Quoted 8 lines · Jeff Garzik
Quoted 5 lines · Greg KH

ChangeSet 1.1998.11.6, 2005/02/07 14:36:14-08:00, [email protected]

[PATCH] convert pci_dev->slot_name usage to pci_name()

Prepare for removal of pci_dev->slot_name

Can you split this up and send me the drivers/net/* portion?

Here ya go.

thanks,

greg k-h

-----

[PATCH] convert pci_dev->slot_name usage to pci_name()

Prepare for removal of pci_dev->slot_name

drivers/net/defxx.c +1 -1
diff -Nru a/drivers/net/defxx.c b/drivers/net/defxx.c
@@ -420,7 +420,7 @@
 	}
 
 	if (pdev != NULL)
-		print_name = pdev->slot_name;
+		print_name = pci_name(pdev);
 
 	dev = alloc_fddidev(sizeof(*bp));
 	if (!dev) {
drivers/net/r8169.c +2 -2
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
@@ -1146,7 +1146,7 @@
 	// enable device (incl. PCI PM wakeup and hotplug setup)
 	rc = pci_enable_device(pdev);
 	if (rc) {
-		printk(KERN_ERR PFX "%s: enable failure\n", pdev->slot_name);
+		printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev));
 		goto err_out_free_dev;
 	}
 
@@ -1184,7 +1184,7 @@
 	rc = pci_request_regions(pdev, MODULENAME);
 	if (rc) {
 		printk(KERN_ERR PFX "%s: could not request regions.\n",
-		       pdev->slot_name);
+		       pci_name(pdev));
 		goto err_out_mwi;
 	}
 
drivers/net/s2io.c +1 -1
diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c
@@ -3192,7 +3192,7 @@
 	strncpy(info->version, s2io_driver_version,
 		sizeof(s2io_driver_version));
 	strncpy(info->fw_version, "", 32);
-	strncpy(info->bus_info, sp->pdev->slot_name, 32);
+	strncpy(info->bus_info, pci_name(sp->pdev), 32);
 	info->regdump_len = XENA_REG_SPACE;
 	info->eedump_len = XENA_EEPROM_SPACE;
 	info->testinfo_len = S2IO_TEST_LEN;
drivers/net/sk98lin/skethtool.c +1 -1
diff -Nru a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
@@ -257,7 +257,7 @@
 	strlcpy(info->driver, DRIVER_FILE_NAME, sizeof(info->driver));
 	strcpy(info->version, vers);
 	strcpy(info->fw_version, "N/A");
-	strlcpy(info->bus_info, pAC->PciDev->slot_name, ETHTOOL_BUSINFO_LEN);
+	strlcpy(info->bus_info, pci_name(pAC->PciDev), ETHTOOL_BUSINFO_LEN);
 }
 
 /*
drivers/net/sk98lin/skge.c +1 -1
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
@@ -3058,7 +3058,7 @@
 		*/
 		* ((SK_U32 *)pMemBuf) = 0;
 		* ((SK_U32 *)pMemBuf + 1) = pdev->bus->number;
-		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pdev->slot_name);
+		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pci_name(pdev));
 		if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
 			Err = -EFAULT;
 			goto fault_diag;
drivers/net/tulip/tulip.h +1 -1
diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
@@ -476,7 +476,7 @@
 
 		if (!i)
 			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
-					tp->pdev->slot_name);
+					pci_name(tp->pdev));
 	}
 }
 
drivers/net/typhoon.c +1 -1
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
@@ -2438,7 +2438,7 @@
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
 	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
 		printk(ERR_PFX "%s: Could not get Sleep Image version\n",
-			pdev->slot_name);
+			pci_name(pdev));
 		goto error_out_reset;
 	}
 
drivers/net/via-velocity.c +1 -1
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
@@ -2898,7 +2898,7 @@
 	struct velocity_info *vptr = dev->priv;
 	strcpy(info->driver, VELOCITY_NAME);
 	strcpy(info->version, VELOCITY_VERSION);
-	strcpy(info->bus_info, vptr->pdev->slot_name);
+	strcpy(info->bus_info, pci_name(vptr->pdev));
 }
 
 static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
drivers/net/wan/wanxl.c +16 -22
diff -Nru a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
@@ -72,7 +72,7 @@
 	u8 irq;
 
 	u8 __iomem *plx;	/* PLX PCI9060 virtual base address */
-	struct pci_dev *pdev;	/* for pdev->slot_name */
+	struct pci_dev *pdev;	/* for pci_name(pdev) */
 	int rx_in;
 	struct sk_buff *rx_skbs[RX_QUEUE_LENGTH];
 	card_status_t *status;	/* shared between host and card */
@@ -88,12 +88,6 @@
 }
 
 
-static inline const char* card_name(struct pci_dev *pdev)
-{
-	return pdev->slot_name;
-}
-
-
 static inline port_status_t* get_status(port_t *port)
 {
 	return &port->card->status->port_status[port->node];
@@ -107,7 +101,7 @@
 	dma_addr_t addr = pci_map_single(pdev, ptr, size, direction);
 	if (addr + size > 0x100000000LL)
 		printk(KERN_CRIT "wanXL %s: pci_map_single() returned memory"
-		       " at 0x%LX!\n", card_name(pdev),
+		       " at 0x%LX!\n", pci_name(pdev),
 		       (unsigned long long)addr);
 	return addr;
 }
@@ -201,7 +195,7 @@
 	       desc->stat != PACKET_EMPTY) {
 		if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
 			printk(KERN_CRIT "wanXL %s: received packet for"
-			       " nonexistent port\n", card_name(card->pdev));
+			       " nonexistent port\n", pci_name(card->pdev));
 		else {
 			struct sk_buff *skb = card->rx_skbs[card->rx_in];
 			port_t *port = &card->ports[desc->stat &
@@ -604,7 +598,7 @@
 	card = kmalloc(alloc_size, GFP_KERNEL);
 	if (card == NULL) {
 		printk(KERN_ERR "wanXL %s: unable to allocate memory\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
 		return -ENOBUFS;
@@ -623,7 +617,7 @@
 
 #ifdef DEBUG_PCI
 	printk(KERN_DEBUG "wanXL %s: pci_alloc_consistent() returned memory"
-	       " at 0x%LX\n", card_name(pdev),
+	       " at 0x%LX\n", pci_name(pdev),
 	       (unsigned long long)card->status_address);
 #endif
 
@@ -649,7 +643,7 @@
 	while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) {
 		if (time_before(timeout, jiffies)) {
 			printk(KERN_WARNING "wanXL %s: timeout waiting for"
-			       " PUTS to complete\n", card_name(pdev));
+			       " PUTS to complete\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -661,7 +655,7 @@
 
 		default:
 			printk(KERN_WARNING "wanXL %s: PUTS test 0x%X"
-			       " failed\n", card_name(pdev), stat & 0x30);
+			       " failed\n", pci_name(pdev), stat & 0x30);
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -681,7 +675,7 @@
 	    (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) {
 		printk(KERN_WARNING "wanXL %s: no enough on-board RAM"
 		       " (%u bytes detected, %u bytes required)\n",
-		       card_name(pdev), ramsize, BUFFERS_ADDR +
+		       pci_name(pdev), ramsize, BUFFERS_ADDR +
 		       (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports);
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
@@ -689,7 +683,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) {
 		printk(KERN_WARNING "wanXL %s: unable to Set Byte Swap"
-		       " Mode\n", card_name(pdev));
+		       " Mode\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -720,7 +714,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) {
 		printk(KERN_WARNING "wanXL %s: unable to Abort and Jump\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -735,7 +729,7 @@
 
 	if (!stat) {
 		printk(KERN_WARNING "wanXL %s: timeout while initializing card"
-		       "firmware\n", card_name(pdev));
+		       "firmware\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -745,12 +739,12 @@
 #endif
 
 	printk(KERN_INFO "wanXL %s: at 0x%X, %u KB of RAM at 0x%X, irq %u\n",
-	       card_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
+	       pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
 
 	/* Allocate IRQ */
 	if (request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) {
 		printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
-		       card_name(pdev), pdev->irq);
+		       pci_name(pdev), pdev->irq);
 		wanxl_pci_remove_one(pdev);
 		return -EBUSY;
 	}
@@ -762,7 +756,7 @@
 		struct net_device *dev = alloc_hdlcdev(port);
 		if (!dev) {
 			printk(KERN_ERR "wanXL %s: unable to allocate"
-			       " memory\n", card_name(pdev));
+			       " memory\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENOMEM;
 		}
@@ -783,7 +777,7 @@
 		get_status(port)->clocking = CLOCK_EXT;
 		if (register_hdlc_device(dev)) {
 			printk(KERN_ERR "wanXL %s: unable to register hdlc"
-			       " device\n", card_name(pdev));
+			       " device\n", pci_name(pdev));
 			free_netdev(dev);
 			wanxl_pci_remove_one(pdev);
 			return -ENOBUFS;
@@ -791,7 +785,7 @@
 		card->n_ports++;
 	}
 
-	printk(KERN_INFO "wanXL %s: port", card_name(pdev));
+	printk(KERN_INFO "wanXL %s: port", pci_name(pdev));
 	for (i = 0; i < ports; i++)
 		printk("%s #%i: %s", i ? "," : "", i,
 		       card->ports[i].dev->name);
Applied
#19 lore raw

Re: [PATCH] convert pci_dev->slot_name usage to pci_name()

Quoted 10 lines · Greg KH
Quoted 8 lines · Jeff Garzik
Quoted 5 lines · Greg KH

ChangeSet 1.1998.11.6, 2005/02/07 14:36:14-08:00, [email protected]

[PATCH] convert pci_dev->slot_name usage to pci_name()

Prepare for removal of pci_dev->slot_name

Quoted 8 lines
Quoted 1 line

Can you split this up and send me the drivers/net/* portion?

Here ya go.

thanks,

greg k-h

Thanks, applied.

Jeff