Hi Mani, Thanks for your comments. >But in your case, looks like the PCI device is available somehow before >pci_proc_init() gets executed. Now, it is not very clear to me how the device >becomes available at this point. It might be due to some other issue. But in >anycase, I think we need to get rid of calling pci_proc_attach_device() from >pci_proc_init() as I don't see a reason to call this function from two >different places. pci_bus_add_device() should be the one calling this function >as it is the one adding the PCI device. Got it. I need to figure out why the PCI device is available already before pci_proc_init() is executed. (Actually I didn't change too much source code yet, basically running my test based on the upstream code). >Ironically, I do see a similar pattern for sysfs also. Maybe there is (or was) a >reason to create these files from two different places? Yes, I see the sysfs register confusion (pci_create_sysfs_dev_files) from pci_sysfs_init() and pci_bus_add_device() as well. There do have concurrence protection through pci_bus_add_device() paths, so I agree that function pci_proc_attach_device and pci_create_sysfs_dev_files should be called from pci_bus_add_devices(). Anyway, it appears there is a great deal of work/effort needed before making this part clear. :( Bests, Shuan