* [BK PATCH] PCI fixes for 2.5.73
@ 2003-06-23 23:58 Greg KH
2003-06-23 23:59 ` [PATCH] " Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:58 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Hi,
Here's some PCI fixes that are against the latest 2.5.73 bk tree.
They fix the compile error that a number of people have reported with
2.5.73 and CONFIG_HOTPLUG=n. It also has some more acpi pci cleanups by
Matthew Wilcox.
Please pull from:
bk://kernel.bkbits.net/gregkh/linux/pci-2.5
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/Makefile | 28 +++++-----------------
arch/i386/pci/common.c | 6 +---
arch/i386/pci/direct.c | 48 +++++++++++++++++++++------------------
arch/i386/pci/numa.c | 16 ++++++-------
arch/i386/pci/pcbios.c | 12 ++++-----
arch/ia64/pci/pci.c | 20 ++++++++--------
drivers/acpi/osl.c | 6 +++-
drivers/pci/Makefile | 10 ++++----
drivers/pci/hotplug.c | 13 ----------
drivers/pci/hotplug/cpqphp_pci.c | 4 +--
drivers/pci/pci-driver.c | 8 ++++++
include/asm-alpha/pci.h | 3 +-
include/linux/pci.h | 4 +--
13 files changed, 84 insertions(+), 94 deletions(-)
-----
Adrian Bunk:
o PCI Hotplug: fix buggy comparison in cpqphp_pci.c
Ivan Kokshaysky:
o PCI: fix alpha for reimplement pci proc name
o PCI: fix non-hotplug build
Matthew Wilcox:
o PCI: pci_raw_ops devfn
o PCI: unconfuse arch/i386/pci/Makefile
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PCI fixes for 2.5.73
2003-06-23 23:58 [BK PATCH] PCI fixes for 2.5.73 Greg KH
@ 2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:59 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1348.14.1, 2003/06/23 11:44:52-07:00, ink@jurassic.park.msu.ru
[PATCH] PCI: fix non-hotplug build
Current BK won't build when CONFIG_HOTPLUG is not set due to
undefined references to pci_destroy_dev in hotplug.c.
I think it makes sense to not compile hotplug.c in this case at all.
Also, this allows to get rid of several function which are unused
in non-hotplug kernel.
Tested on Alpha.
drivers/pci/Makefile | 5 +++--
drivers/pci/hotplug.c | 13 -------------
drivers/pci/pci-driver.c | 8 ++++++++
3 files changed, 11 insertions(+), 15 deletions(-)
diff -Nru a/drivers/pci/Makefile b/drivers/pci/Makefile
--- a/drivers/pci/Makefile Mon Jun 23 16:54:07 2003
+++ b/drivers/pci/Makefile Mon Jun 23 16:54:07 2003
@@ -3,14 +3,15 @@
#
obj-y += access.o bus.o probe.o pci.o pool.o quirks.o \
- names.o pci-driver.o search.o hotplug.o \
- pci-sysfs.o
+ names.o pci-driver.o search.o pci-sysfs.o
obj-$(CONFIG_PM) += power.o
obj-$(CONFIG_PROC_FS) += proc.o
ifndef CONFIG_SPARC64
obj-$(CONFIG_PCI) += setup-res.o
endif
+
+obj-$(CONFIG_HOTPLUG) += hotplug.o
# Build the PCI Hotplug drivers if we were asked to
obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
diff -Nru a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
--- a/drivers/pci/hotplug.c Mon Jun 23 16:54:07 2003
+++ b/drivers/pci/hotplug.c Mon Jun 23 16:54:07 2003
@@ -12,7 +12,6 @@
static void pci_free_resources(struct pci_dev *dev);
-#ifdef CONFIG_HOTPLUG
int pci_hotplug (struct device *dev, char **envp, int num_envp,
char *buffer, int buffer_size)
{
@@ -209,16 +208,6 @@
}
EXPORT_SYMBOL(pci_remove_device_safe);
-#else /* CONFIG_HOTPLUG */
-
-int pci_hotplug (struct device *dev, char **envp, int num_envp,
- char *buffer, int buffer_size)
-{
- return -ENODEV;
-}
-
-#endif /* CONFIG_HOTPLUG */
-
static void
pci_free_resources(struct pci_dev *dev)
{
@@ -283,7 +272,5 @@
}
}
-#ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_remove_bus_device);
EXPORT_SYMBOL(pci_remove_behind_bridge);
-#endif
diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c Mon Jun 23 16:54:07 2003
+++ b/drivers/pci/pci-driver.c Mon Jun 23 16:54:07 2003
@@ -486,6 +486,14 @@
put_device(&dev->dev);
}
+#ifndef CONFIG_HOTPLUG
+int pci_hotplug (struct device *dev, char **envp, int num_envp,
+ char *buffer, int buffer_size)
+{
+ return -ENODEV;
+}
+#endif
+
struct bus_type pci_bus_type = {
.name = "pci",
.match = pci_bus_match,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.5.73
2003-06-23 23:59 ` [PATCH] " Greg KH
@ 2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:59 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1348.14.2, 2003/06/23 11:45:05-07:00, ink@jurassic.park.msu.ru
[PATCH] PCI: fix alpha for reimplement pci proc name
On Fri, Jun 20, 2003 at 02:24:13PM -0700, Greg KH wrote:
> Thanks, I've reverted your previous patch, and fixed the one typo in
> this patch and applied it all to my bk tree. Hopefully Linus will pull
> from it sometime soon :)
Argh, where were my eyes... There was another typo which broke Alpha.
include/asm-alpha/pci.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff -Nru a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
--- a/include/asm-alpha/pci.h Mon Jun 23 16:54:02 2003
+++ b/include/asm-alpha/pci.h Mon Jun 23 16:54:02 2003
@@ -197,7 +197,8 @@
/* Bus number == domain number until we get above 256 busses */
static inline int pci_name_bus(char *name, struct pci_bus *bus)
{
- int domain = pci_domain_nr(bus)
+ int domain = pci_domain_nr(bus);
+
if (domain < 256) {
sprintf(name, "%02x", domain);
} else {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.5.73
2003-06-23 23:59 ` Greg KH
@ 2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:59 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1348.14.3, 2003/06/23 14:44:35-07:00, willy@debian.org
[PATCH] PCI: unconfuse arch/i386/pci/Makefile
I was looking in this Makefile for link order when my head began to hurt.
Apparently you can't have both NUMAQ and VISWS selected, so getting rid
of all the ifdefs/ifndefs like this should work.
arch/i386/pci/Makefile | 28 +++++++---------------------
1 files changed, 7 insertions(+), 21 deletions(-)
diff -Nru a/arch/i386/pci/Makefile b/arch/i386/pci/Makefile
--- a/arch/i386/pci/Makefile Mon Jun 23 16:53:57 2003
+++ b/arch/i386/pci/Makefile Mon Jun 23 16:53:57 2003
@@ -1,27 +1,13 @@
-obj-y := i386.o
+obj-y := i386.o
obj-$(CONFIG_PCI_BIOS) += pcbios.o
obj-$(CONFIG_PCI_DIRECT) += direct.o
-obj-$(CONFIG_X86_VISWS) += visws.o
+pci-y := fixup.o
+pci-$(CONFIG_ACPI_PCI) += acpi.o
+pci-y += legacy.o irq.o
-ifdef CONFIG_X86_NUMAQ
-obj-y += numa.o
-else
-obj-y += fixup.o
+pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
+pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o
-ifdef CONFIG_ACPI_PCI
-obj-y += acpi.o
-endif
-
-ifndef CONFIG_X86_VISWS
-obj-y += legacy.o
-endif
-
-endif # CONFIG_X86_NUMAQ
-
-ifndef CONFIG_X86_VISWS
-obj-y += irq.o
-endif
-
-obj-y += common.o
+obj-y += $(pci-y) common.o
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.5.73
2003-06-23 23:59 ` Greg KH
@ 2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:59 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1348.14.4, 2003/06/23 15:03:31-07:00, willy@debian.org
[PATCH] PCI: pci_raw_ops devfn
Combine the dev and func arguments to pci_raw_ops into devfn which is
more natural all around.
arch/i386/pci/common.c | 6 ++----
arch/i386/pci/direct.c | 48 +++++++++++++++++++++++++++---------------------
arch/i386/pci/numa.c | 16 ++++++++--------
arch/i386/pci/pcbios.c | 12 ++++++------
arch/ia64/pci/pci.c | 20 ++++++++++----------
drivers/acpi/osl.c | 6 ++++--
include/linux/pci.h | 4 ++--
7 files changed, 59 insertions(+), 53 deletions(-)
diff -Nru a/arch/i386/pci/common.c b/arch/i386/pci/common.c
--- a/arch/i386/pci/common.c Mon Jun 23 16:53:53 2003
+++ b/arch/i386/pci/common.c Mon Jun 23 16:53:53 2003
@@ -27,14 +27,12 @@
static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- return raw_pci_ops->read(0, bus->number, PCI_SLOT(devfn),
- PCI_FUNC(devfn), where, size, value);
+ return raw_pci_ops->read(0, bus->number, devfn, where, size, value);
}
static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return raw_pci_ops->write(0, bus->number, PCI_SLOT(devfn),
- PCI_FUNC(devfn), where, size, value);
+ return raw_pci_ops->write(0, bus->number, devfn, where, size, value);
}
struct pci_ops pci_root_ops = {
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
--- a/arch/i386/pci/direct.c Mon Jun 23 16:53:53 2003
+++ b/arch/i386/pci/direct.c Mon Jun 23 16:53:53 2003
@@ -10,19 +10,19 @@
* Functions for accessing PCI configuration space with type 1 accesses
*/
-#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
- (0x80000000 | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
+#define PCI_CONF1_ADDRESS(bus, devfn, reg) \
+ (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
-static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int pci_conf1_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
{
unsigned long flags;
- if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if (!value || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
- outl(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8);
+ outl(PCI_CONF1_ADDRESS(bus, devfn, reg), 0xCF8);
switch (len) {
case 1:
@@ -41,16 +41,16 @@
return 0;
}
-static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int pci_conf1_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
unsigned long flags;
- if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if ((bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
- outl(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8);
+ outl(PCI_CONF1_ADDRESS(bus, devfn, reg), 0xCF8);
switch (len) {
case 1:
@@ -83,13 +83,17 @@
#define PCI_CONF2_ADDRESS(dev, reg) (u16)(0xC000 | (dev << 8) | reg)
-static int pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int pci_conf2_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
{
unsigned long flags;
+ int dev, fn;
- if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if (!value || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
+ dev = PCI_SLOT(devfn);
+ fn = PCI_FUNC(devfn);
+
if (dev & 0x10)
return PCIBIOS_DEVICE_NOT_FOUND;
@@ -110,20 +114,24 @@
break;
}
- outb (0, 0xCF8);
+ outb(0, 0xCF8);
spin_unlock_irqrestore(&pci_config_lock, flags);
return 0;
}
-static int pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int pci_conf2_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
unsigned long flags;
+ int dev, fn;
- if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if ((bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
+ dev = PCI_SLOT(devfn);
+ fn = PCI_FUNC(devfn);
+
if (dev & 0x10)
return PCIBIOS_DEVICE_NOT_FOUND;
@@ -134,17 +142,17 @@
switch (len) {
case 1:
- outb ((u8)value, PCI_CONF2_ADDRESS(dev, reg));
+ outb((u8)value, PCI_CONF2_ADDRESS(dev, reg));
break;
case 2:
- outw ((u16)value, PCI_CONF2_ADDRESS(dev, reg));
+ outw((u16)value, PCI_CONF2_ADDRESS(dev, reg));
break;
case 4:
- outl ((u32)value, PCI_CONF2_ADDRESS(dev, reg));
+ outl((u32)value, PCI_CONF2_ADDRESS(dev, reg));
break;
}
- outb (0, 0xCF8);
+ outb(0, 0xCF8);
spin_unlock_irqrestore(&pci_config_lock, flags);
@@ -178,14 +186,12 @@
return 1;
for (devfn = 0; devfn < 0x100; devfn++) {
- if (o->read(0, 0, PCI_SLOT(devfn), PCI_FUNC(devfn),
- PCI_CLASS_DEVICE, 2, &x))
+ if (o->read(0, 0, devfn, PCI_CLASS_DEVICE, 2, &x))
continue;
if (x == PCI_CLASS_BRIDGE_HOST || x == PCI_CLASS_DISPLAY_VGA)
return 1;
- if (o->read(0, 0, PCI_SLOT(devfn), PCI_FUNC(devfn),
- PCI_VENDOR_ID, 2, &x))
+ if (o->read(0, 0, devfn, PCI_VENDOR_ID, 2, &x))
continue;
if (x == PCI_VENDOR_ID_INTEL || x == PCI_VENDOR_ID_COMPAQ)
return 1;
diff -Nru a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
--- a/arch/i386/pci/numa.c Mon Jun 23 16:53:53 2003
+++ b/arch/i386/pci/numa.c Mon Jun 23 16:53:53 2003
@@ -10,19 +10,19 @@
#define BUS2LOCAL(global) (mp_bus_id_to_local[global])
#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
-#define PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg) \
- (0x80000000 | (BUS2LOCAL(bus) << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
+#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 dev, int fn, int reg, int len, u32 *value)
+static int pci_conf1_mq_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
{
unsigned long flags;
- if (!value || (bus > MAX_MP_BUSSES) || (dev > 31) || (fn > 7) || (reg > 255))
+ if (!value || (bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
- outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+ outl_quad(PCI_CONF1_MQ_ADDRESS(bus, devfn, reg), 0xCF8, BUS2QUAD(bus));
switch (len) {
case 1:
@@ -41,16 +41,16 @@
return 0;
}
-static int pci_conf1_mq_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int pci_conf1_mq_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
unsigned long flags;
- if ((bus > MAX_MP_BUSSES) || (dev > 31) || (fn > 7) || (reg > 255))
+ if ((bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
- outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+ outl_quad(PCI_CONF1_MQ_ADDRESS(bus, devfn, reg), 0xCF8, BUS2QUAD(bus));
switch (len) {
case 1:
diff -Nru a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
--- a/arch/i386/pci/pcbios.c Mon Jun 23 16:53:53 2003
+++ b/arch/i386/pci/pcbios.c Mon Jun 23 16:53:53 2003
@@ -172,13 +172,13 @@
return (int) (ret & 0xff00) >> 8;
}
-static int pci_bios_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int pci_bios_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
{
unsigned long result = 0;
unsigned long flags;
- unsigned long bx = ((bus << 8) | (dev << 3) | fn);
+ unsigned long bx = (bus << 8) | devfn;
- if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if (!value || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
@@ -227,13 +227,13 @@
return (int)((result & 0xff00) >> 8);
}
-static int pci_bios_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int pci_bios_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
unsigned long result = 0;
unsigned long flags;
- unsigned long bx = ((bus << 8) | (dev << 3) | fn);
+ unsigned long bx = (bus << 8) | devfn;
- if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if ((bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c Mon Jun 23 16:53:53 2003
+++ b/arch/ia64/pci/pci.c Mon Jun 23 16:53:53 2003
@@ -53,21 +53,21 @@
* synchronization mechanism here.
*/
-#define PCI_SAL_ADDRESS(seg, bus, dev, fn, reg) \
+#define PCI_SAL_ADDRESS(seg, bus, devfn, reg) \
((u64)(seg << 24) | (u64)(bus << 16) | \
- (u64)(dev << 11) | (u64)(fn << 8) | (u64)(reg))
+ (u64)(devfn << 8) | (u64)(reg))
static int
-pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+pci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
{
int result = 0;
u64 data = 0;
- if (!value || (seg > 255) || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if (!value || (seg > 255) || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
- result = ia64_sal_pci_config_read(PCI_SAL_ADDRESS(seg, bus, dev, fn, reg), len, &data);
+ result = ia64_sal_pci_config_read(PCI_SAL_ADDRESS(seg, bus, devfn, reg), len, &data);
*value = (u32) data;
@@ -75,12 +75,12 @@
}
static int
-pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+pci_sal_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
- if ((seg > 255) || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
+ if ((seg > 255) || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
- return ia64_sal_pci_config_write(PCI_SAL_ADDRESS(seg, bus, dev, fn, reg), len, value);
+ return ia64_sal_pci_config_write(PCI_SAL_ADDRESS(seg, bus, devfn, reg), len, value);
}
struct pci_raw_ops pci_sal_ops = {
@@ -95,14 +95,14 @@
pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
return raw_pci_ops->read(pci_domain_nr(bus), bus->number,
- PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, value);
+ devfn, where, size, value);
}
static int
pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
return raw_pci_ops->write(pci_domain_nr(bus), bus->number,
- PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, value);
+ devfn, where, size, value);
}
static struct pci_ops pci_root_ops = {
diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c
--- a/drivers/acpi/osl.c Mon Jun 23 16:53:53 2003
+++ b/drivers/acpi/osl.c Mon Jun 23 16:53:53 2003
@@ -466,7 +466,8 @@
}
result = raw_pci_ops->read(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, size, value);
+ PCI_DEVFN(pci_id->device, pci_id->function),
+ reg, size, value);
return (result ? AE_ERROR : AE_OK);
}
@@ -491,7 +492,8 @@
}
result = raw_pci_ops->write(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, size, value);
+ PCI_DEVFN(pci_id->device, pci_id->function),
+ reg, size, value);
return (result ? AE_ERROR : AE_OK);
}
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Mon Jun 23 16:53:53 2003
+++ b/include/linux/pci.h Mon Jun 23 16:53:53 2003
@@ -487,8 +487,8 @@
};
struct pci_raw_ops {
- int (*read)(int dom, int bus, int dev, int func, int reg, int len, u32 *val);
- int (*write)(int dom, int bus, int dev, int func, int reg, int len, u32 val);
+ 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);
};
extern struct pci_raw_ops *raw_pci_ops;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.5.73
2003-06-23 23:59 ` Greg KH
@ 2003-06-23 23:59 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2003-06-23 23:59 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1348.14.5, 2003/06/23 15:19:07-07:00, bunk@fs.tum.de
[PATCH] PCI Hotplug: fix buggy comparison in cpqphp_pci.c
I don't understand the code good enough to be sure my patch is correct,
but the current code is definitely buggy:
0xFF is the maximum value for an u8, so tdevice < 0x100 is _always_
true.
drivers/pci/hotplug/cpqphp_pci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -Nru a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
--- a/drivers/pci/hotplug/cpqphp_pci.c Mon Jun 23 16:53:48 2003
+++ b/drivers/pci/hotplug/cpqphp_pci.c Mon Jun 23 16:53:48 2003
@@ -198,7 +198,7 @@
ctrl->pci_bus->number = bus_num;
- for (tdevice = 0; tdevice < 0x100; tdevice++) {
+ for (tdevice = 0; tdevice < 0xFF; tdevice++) {
//Scan for access first
if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
continue;
@@ -210,7 +210,7 @@
return 0;
}
}
- for (tdevice = 0; tdevice < 0x100; tdevice++) {
+ for (tdevice = 0; tdevice < 0xFF; tdevice++) {
//Scan for access first
if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
continue;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-06-23 23:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-23 23:58 [BK PATCH] PCI fixes for 2.5.73 Greg KH
2003-06-23 23:59 ` [PATCH] " Greg KH
2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
2003-06-23 23:59 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox