Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:pcie:hot-reset-linux [2019/04/16 23:02] alex |
en:pcie:hot-reset-linux [2020/04/29 07:59] (current) alex |
||
---|---|---|---|
Line 15: | Line 15: | ||
I am not aware of any 'nice' method for triggering a hot reset (there is no sysfs entry for that). However, it is possible to use setpci to do so with the following script: | I am not aware of any 'nice' method for triggering a hot reset (there is no sysfs entry for that). However, it is possible to use setpci to do so with the following script: | ||
- | <code sh> | + | <code bash pcie_hot_reset.sh> |
#!/bin/bash | #!/bin/bash | ||
Line 65: | Line 65: | ||
Ensure that all attached drivers are unloaded before running this script. This script will attempt to remove the PCIe device, then command the upstream switch port to issue a hot reset, then attempt to rescan the PCIe bus. This script has also only been tested on devices with a single function, so it may need some reworking for devices with multiple functions. | Ensure that all attached drivers are unloaded before running this script. This script will attempt to remove the PCIe device, then command the upstream switch port to issue a hot reset, then attempt to rescan the PCIe bus. This script has also only been tested on devices with a single function, so it may need some reworking for devices with multiple functions. | ||
+ | [[https://unix.stackexchange.com/a/474378/55879|Answer on Stack Exchange]] |