* [BK PATCH] PCI fixes for 2.6.0-test3
@ 2003-08-21 17:29 Greg KH
2003-08-21 17:31 ` [PATCH] " Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:29 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Hi,
Here are some tiny PCI patches against 2.6.0-test3. They fix a bug with
code that shouldn't have gotten into setup-bus.c and allow pci drivers
to properly propagate their probe() errors up to the driver core (which
now reports them.) I've also moved the pci_pretty_name() macro to pci.h
as two different archs already created the same macro for themselves,
and created the PCI_DEVICE() and PCI_DEVICE_CLASS() macro to make the
pci_device_id lists in drivers a lot simpler to use.
I also added two compile bug fixes for video drivers, but you already
beat me to them in your tree, so they merged away.
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/alpha/kernel/sys_marvel.c | 7 -------
arch/x86_64/kernel/pci-gart.c | 6 ------
drivers/media/video/saa7111.c | 2 +-
drivers/pci/hotplug/cpqphp_core.c | 1 -
drivers/pci/hotplug/cpqphp_nvram.c | 1 -
drivers/pci/names.c | 6 +++---
drivers/pci/pci-driver.c | 6 ++----
drivers/pci/setup-bus.c | 5 -----
drivers/video/tridentfb.c | 2 +-
include/linux/pci.h | 37 ++++++++++++++++++++++++++++++++++++-
10 files changed, 43 insertions(+), 30 deletions(-)
------
<janiceg:us.ibm.com>:
o PCI: testing for probe errors in pci-driver.c
Greg Kroah-Hartman:
o PCI: added the pci_pretty_name() macro to pci.h as 2 arches already had it
o FB: fix broken tridentfb.c driver due to device.name change
o Video: fix broken saa7111.c driver due to i2c structure changes
o PCI: add PCI_NAME_SIZE instead of using DEVICE_NAME_SIZE
o PCI: remove #include <linux/miscdevice.h> from some pci hotplug drivers
o PCI: add PCI_DEVICE_CLASS() macro to match PCI_DEVICE() macro
o PCI: add PCI_DEVICE() macro to make pci_device_id tables easier to read
Ivan Kokshaysky:
o PCI: undo recent pci_setup_bridge() change
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:29 [BK PATCH] PCI fixes for 2.6.0-test3 Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1123.21.1, 2003/08/13 10:45:56-07:00, greg@kroah.com
[PATCH] PCI: add PCI_DEVICE() macro to make pci_device_id tables easier to read.
include/linux/pci.h | 12 ++++++++++++
1 files changed, 12 insertions(+)
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Thu Aug 21 10:23:14 2003
+++ b/include/linux/pci.h Thu Aug 21 10:23:14 2003
@@ -524,6 +524,18 @@
#define to_pci_driver(drv) container_of(drv,struct pci_driver, driver)
+/**
+ * PCI_DEVICE - macro used to describe a specific pci device
+ * @vend: the 16 bit PCI Vendor ID
+ * @dev: the 16 bit PCI Device ID
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific device. The subvendor and subdevice fields will be set to
+ * PCI_ANY_ID.
+ */
+#define PCI_DEVICE(vend,dev) \
+ .vendor = (vend), .device = (dev), \
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` [PATCH] " Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1123.21.2, 2003/08/13 17:42:56-07:00, janiceg@us.ibm.com
[PATCH] PCI: testing for probe errors in pci-driver.c
Currently if __pci_device_probe locates the correct
device driver, but receives an error from the static
drv->probe function, this error is not reported.
The attached patch reports the above error condition
to the caller. Only when a match for the device in
the static tables is not found, is the dynamic driver
table searched.
drivers/pci/pci-driver.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c Thu Aug 21 10:22:52 2003
+++ b/drivers/pci/pci-driver.c Thu Aug 21 10:22:52 2003
@@ -122,10 +122,8 @@
if (!pci_dev->driver && drv->probe) {
error = pci_device_probe_static(drv, pci_dev);
- if (error >= 0)
- return error;
-
- error = pci_device_probe_dynamic(drv, pci_dev);
+ if (error == -ENODEV)
+ error = pci_device_probe_dynamic(drv, pci_dev);
}
return error;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1123.21.3, 2003/08/18 15:22:01-07:00, greg@kroah.com
[PATCH] PCI: add PCI_DEVICE_CLASS() macro to match PCI_DEVICE() macro.
include/linux/pci.h | 14 ++++++++++++++
1 files changed, 14 insertions(+)
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Thu Aug 21 10:22:30 2003
+++ b/include/linux/pci.h Thu Aug 21 10:22:30 2003
@@ -537,6 +537,20 @@
.vendor = (vend), .device = (dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
+/**
+ * PCI_DEVICE_CLASS - macro used to describe a specific pci device class
+ * @dev_class: the class, subclass, prog-if triple for this device
+ * @dev_class_mask: the class mask for this device
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific PCI class. The vendor, device, subvendor, and subdevice
+ * fields will be set to PCI_ANY_ID.
+ */
+#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \
+ .class = (dev_class), .class_mask = (dev_class_mask), \
+ .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
+
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1123.21.4, 2003/08/20 15:57:41-07:00, greg@kroah.com
[PATCH] PCI: remove #include <linux/miscdevice.h> from some pci hotplug drivers.
It's not needed.
drivers/pci/hotplug/cpqphp_core.c | 1 -
drivers/pci/hotplug/cpqphp_nvram.c | 1 -
2 files changed, 2 deletions(-)
diff -Nru a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
--- a/drivers/pci/hotplug/cpqphp_core.c Thu Aug 21 10:22:08 2003
+++ b/drivers/pci/hotplug/cpqphp_core.c Thu Aug 21 10:22:08 2003
@@ -34,7 +34,6 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
-#include <linux/miscdevice.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/pci.h>
diff -Nru a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c
--- a/drivers/pci/hotplug/cpqphp_nvram.c Thu Aug 21 10:22:08 2003
+++ b/drivers/pci/hotplug/cpqphp_nvram.c Thu Aug 21 10:22:08 2003
@@ -31,7 +31,6 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
-#include <linux/miscdevice.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/pci.h>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1285.1.2, 2003/08/20 16:33:09-07:00, ink@jurassic.park.msu.ru
[PATCH] PCI: undo recent pci_setup_bridge() change
That patch went into mainline by mistake - it was initial variant of a
fix for the problem with disabled P2P bridges. Which has already been
fixed properly in -test3.
drivers/pci/setup-bus.c | 5 -----
1 files changed, 5 deletions(-)
diff -Nru a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
--- a/drivers/pci/setup-bus.c Thu Aug 21 10:21:45 2003
+++ b/drivers/pci/setup-bus.c Thu Aug 21 10:21:45 2003
@@ -203,11 +203,6 @@
Enable ISA in either case (FIXME!). */
l = (bus->resource[0]->flags & IORESOURCE_BUS_HAS_VGA) ? 0x0c : 0x04;
pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, l);
-
- /* Make sure the bridge COMMAND register has the appropriate
- bits set, just in case...
- */
- pcibios_enable_device(bridge, 0xfff);
}
/* Check whether the bridge supports optional I/O and
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1285.1.5, 2003/08/20 16:59:06-07:00, greg@kroah.com
FB: fix broken tridentfb.c driver due to device.name change.
drivers/video/tridentfb.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -Nru a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
--- a/drivers/video/tridentfb.c Thu Aug 21 10:20:41 2003
+++ b/drivers/video/tridentfb.c Thu Aug 21 10:20:41 2003
@@ -1129,7 +1129,7 @@
return -1;
}
- output("%s board found\n", dev->dev.name);
+ output("%s board found\n", pci_name(dev));
#if 0
output("Trident board found : mem = %X,io = %X, mem_v = %X, io_v = %X\n",
tridentfb_fix.smem_start, tridentfb_fix.mmio_start, fb_info.screen_base, default_par.io_virt);
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1285.1.4, 2003/08/20 16:49:58-07:00, greg@kroah.com
Video: fix broken saa7111.c driver due to i2c structure changes.
drivers/media/video/saa7111.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -Nru a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
--- a/drivers/media/video/saa7111.c Thu Aug 21 10:21:02 2003
+++ b/drivers/media/video/saa7111.c Thu Aug 21 10:21:02 2003
@@ -55,7 +55,7 @@
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
-#define I2C_NAME(s) (s)->dev.name
+#define I2C_NAME(s) (s)->name
#include <linux/video_decoder.h>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1285.1.3, 2003/08/20 16:48:01-07:00, greg@kroah.com
[PATCH] PCI: add PCI_NAME_SIZE instead of using DEVICE_NAME_SIZE
based on a patch from OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
drivers/pci/names.c | 6 +++---
include/linux/pci.h | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff -Nru a/drivers/pci/names.c b/drivers/pci/names.c
--- a/drivers/pci/names.c Thu Aug 21 10:21:23 2003
+++ b/drivers/pci/names.c Thu Aug 21 10:21:23 2003
@@ -80,14 +80,14 @@
}
/* Ok, found the vendor, but unknown device */
- sprintf(name, "PCI device %04x:%04x (%." DEVICE_NAME_HALF "s)",
+ sprintf(name, "PCI device %04x:%04x (%." PCI_NAME_HALF "s)",
dev->vendor, dev->device, vendor_p->name);
return;
/* Full match */
match_device: {
- char *n = name + sprintf(name, "%." DEVICE_NAME_HALF
- "s %." DEVICE_NAME_HALF "s",
+ char *n = name + sprintf(name, "%." PCI_NAME_HALF
+ "s %." PCI_NAME_HALF "s",
vendor_p->name, device_p->name);
int nr = device_p->seen + 1;
device_p->seen = nr;
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Thu Aug 21 10:21:23 2003
+++ b/include/linux/pci.h Thu Aug 21 10:21:23 2003
@@ -420,7 +420,9 @@
unsigned int transparent:1; /* Transparent PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */
#ifdef CONFIG_PCI_NAMES
- char pretty_name[DEVICE_NAME_SIZE]; /* pretty name for users to see */
+#define PCI_NAME_SIZE 50
+#define PCI_NAME_HALF __stringify(20) /* less than half to handle slop */
+ char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */
#endif
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test3
2003-08-21 17:31 ` Greg KH
@ 2003-08-21 17:31 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2003-08-21 17:31 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1285.1.6, 2003/08/21 10:07:11-07:00, greg@kroah.com
PCI: added the pci_pretty_name() macro to pci.h as 2 arches already had it.
arch/alpha/kernel/sys_marvel.c | 7 -------
arch/x86_64/kernel/pci-gart.c | 6 ------
include/linux/pci.h | 7 +++++++
3 files changed, 7 insertions(+), 13 deletions(-)
diff -Nru a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
--- a/arch/alpha/kernel/sys_marvel.c Thu Aug 21 10:20:18 2003
+++ b/arch/alpha/kernel/sys_marvel.c Thu Aug 21 10:20:18 2003
@@ -33,13 +33,6 @@
# error NR_IRQS < MARVEL_NR_IRQS !!!
#endif
-/* ??? Should probably be generic. */
-#ifdef CONFIG_PCI_NAMES
-#define pci_pretty_name(x) ((x)->pretty_name)
-#else
-#define pci_pretty_name(x) ""
-#endif
-
\f
/*
* Interrupt handling.
diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c Thu Aug 21 10:20:18 2003
+++ b/arch/x86_64/kernel/pci-gart.c Thu Aug 21 10:20:18 2003
@@ -31,12 +31,6 @@
#include <asm/kdebug.h>
#include <asm/proto.h>
-#ifdef CONFIG_PCI_NAMES
-#define pci_pretty_name(dev) ((dev)->pretty_name)
-#else
-#define pci_pretty_name(dev) ""
-#endif
-
dma_addr_t bad_dma_address;
unsigned long iommu_bus_base; /* GART remapping area (physical) */
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Thu Aug 21 10:20:18 2003
+++ b/include/linux/pci.h Thu Aug 21 10:20:18 2003
@@ -842,6 +842,13 @@
return pdev->dev.bus_id;
}
+/* Some archs want to see the pretty pci name, so use this macro */
+#ifdef CONFIG_PCI_NAMES
+#define pci_pretty_name(dev) ((dev)->pretty_name)
+#else
+#define pci_pretty_name(dev) ""
+#endif
+
/*
* The world is not perfect and supplies us with broken PCI devices.
* For at least a part of these bugs we need a work-around, so both
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-08-21 17:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-21 17:29 [BK PATCH] PCI fixes for 2.6.0-test3 Greg KH
2003-08-21 17:31 ` [PATCH] " Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
2003-08-21 17:31 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).