Adding a pre-probe arch hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks !

I'm trying to refactor/cleanup our pseries "EEH" code (the IBM specific
error handling/recovery thingy), for the sake of general cleanness but
also because I will have to significantly extend it soon to deal with a
new/different platform.

Part of the thing that I'd like to get rid of is the way it walks the
device-tree at boot time to do "things" to every PCI device (like
enabling the EEH functionality) before the PCI probing happens.

This code is duplicated with hotplug hooks used when hot-plugging new
devices, and isn't going to be suitable for platforms that may not
represent all PCI devices in the OFW device-tree.

However, I -do- need to tickle the firmware/hardware for each device
before it is probed.

Thus would there be any objection to add a hook, possibly in
pci_scan_device(), something along the lines of:

static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
{
	struct pci_dev *dev;
	u32 l;
	int delay = 1;

+	if (pcibios_scan_device_hook(bus, devfn))
+		return NULL;
+
	if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
		return NULL;

I want to poke you guys first before I actually do the patch & refactor
everything on my side :-)

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux