Pci_Driver.probe is not called

I am starting to develop Linux device drivers for a PCI device connected through a PCIe expansion slot for a laptop.

When loading, everything works beautifully. However, I am trying to get basic Hotplug support online. When I pull out the card, I see (c dmesg) that the proper removal of the material is being called up. However, when the card is reinserted, nothing happens. If I manually remove the module, and then insert the card (or insert the card after loading), then I see that the module is being called init, but not probe. In addition, the device is not displayed in the output lspci.

However, if I am echo 1 > /sys/bus/pci/rescan, then it appears in the output lspci, but the module does not load with errors ( pci_enable_device failed with code -22).

Any ideas where to even start diagnosing this? The impossibility of exec .probeis what puzzles me.

I should mention that this is the FPGA board plugged in here, so it’s possible that there is something wrong with the device itself, but I still expect the trial program to start, and then crash with a weirder error later.

+4
source share
1 answer

If the device does not appear in lspci, there is no way that your driver's .probe function will be called because it falls into the kernel device tree.

pci, lspci, , . , lspci -vv -s BB:DD ( BB: DD - , lspci. , 0xFF ( , BAR). , , pci_enable_device .

FPGA-, . , reset. ( root):

cp /sys/bus/pci/devices/0000\:BB\:DD.0/config ~/config.save

, :

cp ~/config.save /sys/bus/pci/devices/0000\:BB\:DD.0/config

- , ( ).

+3

Source: https://habr.com/ru/post/1541041/


All Articles