kernel-ark/drivers/pci
Russell King 7461b60afa PCI: use /sys/bus/pci/drivers/<driver>/new_id first
Unfortunately, the .../new_id feature does not work with the 8250_pci
driver.

The reason for this comes down to the way .../new_id is implemented.
When PCI tries to match a driver to a device, it checks the modules
static device ID tables _before_ checking the dynamic new_id tables.

When a driver is capable of matching by ID, and falls back to matching
by class (as 8250_pci does), this makes it absolutely impossible to
specify a board by ID, and as such the correct driver_data value to
use with it.

Let's say you have a serial board with vendor 0x1234 and device 0x5678.
It's class is set to PCI_CLASS_COMMUNICATION_SERIAL.

On boot, this card is matched to the 8250_pci driver, which tries to
probe it because it matched using the class entry.  The driver finds
that it is unable to automatically detect the correct settings to use,
so it returns -ENODEV.

You know that the information the driver needs is to match this card
using a device_data value of '7'.  So you echo 1234 5678 0 0 0 0 7
into new_id.

The kernel attempts to re-bind 8250_pci to this device.  However,
because it scans the PCI driver tables, it _again_ matches the class
entry which has the wrong device_data.  It fails.

End of story.  You can't support the card without rebuilding the
kernel (or writing a specific PCI probe module to support it.)

So, can we make new_id override the driver-internal PCI ID tables?
IOW, like this:


From: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-20 10:54:41 -08:00
..
hotplug [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
pcie [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
.gitignore
access.c [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
bus.c
hotplug.c
htirq.c
Kconfig Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-12-01 16:41:27 -08:00
Makefile
msi.c Merge branch 'intx' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2006-12-07 15:04:20 -08:00
msi.h
pci-acpi.c
pci-driver.c PCI: use /sys/bus/pci/drivers/<driver>/new_id first 2006-12-20 10:54:41 -08:00
pci-sysfs.c
pci.c
pci.h
probe.c [PATCH] add numa node information to struct device 2006-12-07 08:39:22 -08:00
proc.c [PATCH] struct path: convert pci 2006-12-08 08:28:48 -08:00
quirks.c
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
syscall.c