LastBusNum is set to static, but there doesn't seem to be a real reason for it to be static. This causes problems when resetting and re-initialising the bus, as there is no way to reset the value of LastBusNum.
I found that removing the static attribute makes it work without issues, particularly after re-initialising the bus after a warm reset.
In pciepsu.c line 795 :
LastBusNum is set to static, but there doesn't seem to be a real reason for it to be static. This causes problems when resetting and re-initialising the bus, as there is no way to reset the value of LastBusNum. I found that removing the static attribute makes it work without issues, particularly after re-initialising the bus after a warm reset.