N
N
NetBear2013-03-20 14:03:53
linux
NetBear, 2013-03-20 14:03:53

How to disable-enable PCI device on the fly

Hello.

I am developing some kind of automatic test during which there is a need to simulate a SCSI fiber channel shutdown.
The QLogic ISP2532 SCSI FC adapter is used in conjunction with the CentOS 6.2 operating system.
There is some progress in research, at the moment I managed to chop off the card via echo 0 > /sys/bus/slot/2-3/power and return it back via echo > /sys/bus/pci/rescan . Everything seems to be fine, except for one thing. This only works once, i.e. after connecting the device, it is impossible to disconnect it again, and echo 0\u003e /sys/bus/slot/2-3/powersimply doesn't work. Re-disabling is possible only after rebooting the entire operating system, which categorically does not suit me. My guess is that there is some separate system module that can be reloaded to give the desired effect.

Any ideas, colleagues?
Much in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2013-03-20
@jcmvbkbc

Disable PCI device: echo 1 > /sys/bus/pci/devices/ id /remove
Enable - yes, via rescan.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question