Skip to contentSkip to conversation

zfcp: explicitly support initiator in scsi_host_template

PATCH New Steffen Maier 1 participant 1 message May 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 20/25 zfcp: explicitly support initiator in scsi_host_template

While the default did already correctly print "Initiator" let's make it explicit and convert zfcp to the feature.

$ cat /sys/class/scsi_host/host0/supported_mode
Initiator
$ cat /sys/class/scsi_host/host0/active_mode
Initiator

The default worked, because not setting the field has it initialized to zero == MODE_UNKNOWN. scsi_host_alloc() sets shost->active_mode = MODE_INITIATOR in this case. The sysfs accessor function show_shost_supported_mode() assumes MODE_INITIATOR in this case. This default behavior was introduced with v2.6.24 commit 7a39ac3f25be ("[SCSI] make supported_mode default to initiator.").
The feature flag was introduced with v2.6.24 commit 5dc2b89e1242 ("[SCSI] add supported_mode and active_mode attributes to the host"). So there was no release where zfcp would have shown "unknown".

---
 drivers/s390/scsi/zfcp_scsi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/s390/scsi/zfcp_scsi.c +1 -0
index b4e1f1b82503..f69ef78ea930 100644
@@ -401,6 +401,7 @@ static struct scsi_host_template zfcp_scsi_host_template = {
 	.shost_attrs		 = zfcp_sysfs_shost_attrs,
 	.sdev_attrs		 = zfcp_sysfs_sdev_attrs,
 	.track_queue_depth	 = 1,
+	.supported_mode		 = MODE_INITIATOR,
 };
 
 /**
Signature · 1 line
2.16.3