------- Comment From <email address hidden> 2016-09-27 19:58 EDT------- This is verified successfully. Updating tags.
The controller release function is only called when the last reference to one of its devices (eg, disks) is dropped.
# echo 'func pcibios_free_controller_deferred +pf' > /sys/kernel/debug/dynamic_debug/control
# lspci | grep Fibre 0021:01:00.0 Fibre Channel: Emulex Corporation Lancer-X: LightPulse Fibre Channel Host Adapter (rev 30) 0021:01:00.1 Fibre Channel: Emulex Corporation Lancer-X: LightPulse Fibre Channel Host Adapter (rev 30)
# ls -ld /sys/block/sd* | grep -m1 0021:01:00.0 <...> /sys/block/sdav -> ../devices/pci0021:01/0021:01:00.0/<...>
# ls -ld /sys/block/sd* | grep -m1 0021:01:00.1 <...> /sys/block/sdaa -> ../devices/pci0021:01/0021:01:00.1/<...>
# cat >/dev/sdav & pid1=$! # cat >/dev/sdaa & pid2=$!
# dmesg -c >/dev/null
# drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r Validating PHB DLPAR capability...yes.
# dmesg -c | tail -n3 [11629.473248] iommu: Removing device 0021:01:00.0 from group 1 [11639.480792] pci_bus 0021:01: busn_res: [bus 01-ff] is released [11639.480874] rpadlpar_io: slot PHB 33 removed
# kill -9 $pid1 # dmesg -c [11682.255067] scsi 5:0:0:1: rdac: Detached
# kill -9 $pid2 # dmesg -c [11695.380191] scsi 4:0:1:2: rdac: Detached [11695.380359] pcibios_free_controller_deferred: domain 33, dynamic 1
------- Comment From <email address hidden> 2016-09-27 19:58 EDT-------
This is verified successfully.
Updating tags.
The controller release function is only called when the last reference to one of its devices (eg, disks) is dropped.
# echo 'func pcibios_ free_controller _deferred +pf' > /sys/kernel/ debug/dynamic_ debug/control
# lspci | grep Fibre
0021:01:00.0 Fibre Channel: Emulex Corporation Lancer-X: LightPulse Fibre Channel Host Adapter (rev 30)
0021:01:00.1 Fibre Channel: Emulex Corporation Lancer-X: LightPulse Fibre Channel Host Adapter (rev 30)
# ls -ld /sys/block/sd* | grep -m1 0021:01:00.0 pci0021: 01/0021: 01:00.0/ <...>
<...> /sys/block/sdav -> ../devices/
# ls -ld /sys/block/sd* | grep -m1 0021:01:00.1 pci0021: 01/0021: 01:00.1/ <...>
<...> /sys/block/sdaa -> ../devices/
# cat >/dev/sdav & pid1=$!
# cat >/dev/sdaa & pid2=$!
# dmesg -c >/dev/null
# drmgr -w 5 -d 1 -c phb -s 'PHB 33' -r
Validating PHB DLPAR capability...yes.
# dmesg -c | tail -n3
[11629.473248] iommu: Removing device 0021:01:00.0 from group 1
[11639.480792] pci_bus 0021:01: busn_res: [bus 01-ff] is released
[11639.480874] rpadlpar_io: slot PHB 33 removed
# kill -9 $pid1
# dmesg -c
[11682.255067] scsi 5:0:0:1: rdac: Detached
# kill -9 $pid2 free_controller _deferred: domain 33, dynamic 1
# dmesg -c
[11695.380191] scsi 4:0:1:2: rdac: Detached
[11695.380359] pcibios_