How to Enable or disable HBA ports temporarily, without a reboot ?

1. Locate the HBA address on the PCI bus:

# lspci -k
...
19:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
    Subsystem: QLogic Corp. Device 0171
    Kernel driver in use: qla2xxx
19:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
    Subsystem: QLogic Corp. Device 0171
    Kernel driver in use: qla2xxx
...

Alternate Method For Block Devices:

– Block devices have their PCI bus adress available by the disk name:

# ls -l /dev/disk/by-path/ | grep -v part
lrwxrwxrwx 1 root root  9 Jan  8 04:03 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-0 -> ../../sdx
lrwxrwxrwx 1 root root  9 Dec 29 10:36 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-1 -> ../../sdy
lrwxrwxrwx 1 root root 10 Jan  8 04:07 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-10 -> ../../sdbx
lrwxrwxrwx 1 root root 10 Jan  8 04:07 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-11 -> ../../sdby
lrwxrwxrwx 1 root root 10 Jan  8 04:07 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-12 -> ../../sdbz
lrwxrwxrwx 1 root root  9 Dec 29 10:36 pci-0000:19:00.0-fc-0x21000024ff49572c-lun-2 -> ../../sdz

2. Disconnect the PCI device from the PCI bus using the device driver name and the PCIbus address found earlier:

# echo '[pci-device-id]' > /sys/bus/pci/drivers/[pci-driver-name]/unbind

As an example, detach the /dev/sdy device from the PCIbus:

# echo '0000:19:00.0' > /sys/bus/pci/drivers/qla2xxx/unbind

3. Attach the device to the driver:

# echo "[pci-device-id]" > /sys/bus/pci/drivers/[pci_driver_name]/bind

4. As an example, have PCI device 0000:19:00.0 be controlled by the qla2xxx driver:

# echo '0000:19:00.0' > /sys/bus/pci/drivers/qla2xxx/bind

 Link Referencies : https://www.thegeekdiary.com/how-to-disable-or-enable-an-hba-without-reboot-under-centos-rhel/