scsi: scsi_transport_fc: Add store capability to rport port_state in sysfs
authorMuneendra Kumar <muneendra.kumar@broadcom.com>
Wed, 6 Jan 2021 21:49:07 +0000 (03:19 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jan 2021 03:55:17 +0000 (22:55 -0500)
commitafdd1126940068ef06c2b4b08b85a47a3eafba5b
treee0bfb9b0e899cc49a93035731607959201ae8e71
parent02c66326dc7e8b3a71b7ceb9a08ec1208e13ea84
scsi: scsi_transport_fc: Add store capability to rport port_state in sysfs

Add store capability to the rport port_state using sysfs under
fc_remote_ports/rport-*/port_state.

With this the user can move the port_state from Marginal->Online and
Online->Marginal.

 - Marginal: This interface will set SCMD_NORETRIES_ABORT bit in
   scmd->state for all the pending I/Os on the SCSI device associated with
   target port.

 - Online: This interface will clear SCMD_NORETRIES_ABORT bit in
   scmd->state for all the pending I/Os on the SCSI device associated with
   target port.

The following interface is provided to set the port state to Marginal and
Online respectively:

echo "Marginal" >> /sys/class/fc_remote_ports/rport-X\:Y-Z/port_state
echo "Online" >> /sys/class/fc_remote_ports/rport-X\:Y-Z/port_state

Link: https://lore.kernel.org/r/1609969748-17684-5-git-send-email-muneendra.kumar@broadcom.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_fc.c