public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Block <bblock@linux.ibm.com>
To: "James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Benjamin Block <bblock@linux.ibm.com>,
	Steffen Maier <maier@linux.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Fedor Loshakov <loshakov@linux.ibm.com>,
	Julian Wiedmann <jwi@linux.ibm.com>,
	linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH 4/8] zfcp: fence fc_host updates during link-down handling
Date: Fri,  8 May 2020 19:23:31 +0200	[thread overview]
Message-ID: <f841f2cda61dcd7b8549910c44e1831927459edf.1588956679.git.bblock@linux.ibm.com> (raw)
In-Reply-To: <cover.1588956679.git.bblock@linux.ibm.com>

When receiving a notification that a FCP device lost its local link we
usually update the fibre channel host object which represents that FCP
device to reflect that.

This notification/information can also surface when the FCP device is
running through adapter recovery (exchange config and exchange port data
return incomplete).

When moving the scsi host object allocation and registration  - and thus
also the fibre channel host object allocation - to after the first
exchange config and exchange port data, and this happens during the very
first adapter recovery, these updates can not be done until after the
scsi host object is allocated.

Reorder the fc_host updates in zfcp_fsf_fc_host_link_down() so that they
only happen after a check of whether the scsi host object is already
allocated or not.

During the first adapter recovery this will cause the skip of these
updates if a link-down condition is detected, but we can repeat them
after we allocated the scsi host object, if necessary.

For any further link-down handling the only changes in the work flow are
the slightly reordered assignments in zfcp_fsf_fc_host_link_down().

Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
---
 drivers/s390/scsi/zfcp_fsf.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index bfb567a1d7bf..8c4b690e329e 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -124,17 +124,21 @@ static void zfcp_fsf_fc_host_link_down(struct zfcp_adapter *adapter)
 {
 	struct Scsi_Host *shost = adapter->scsi_host;
 
+	adapter->hydra_version = 0;
+	adapter->peer_wwpn = 0;
+	adapter->peer_wwnn = 0;
+	adapter->peer_d_id = 0;
+
+	/* if there is no shost yet, we have nothing to zero-out */
+	if (shost == NULL)
+		return;
+
 	fc_host_port_id(shost) = 0;
 	fc_host_fabric_name(shost) = 0;
 	fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
 	fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
-	adapter->hydra_version = 0;
 	snprintf(fc_host_model(shost), FC_SYMBOLIC_NAME_SIZE, "0x%04x", 0);
 	memset(fc_host_active_fc4s(shost), 0, FC_FC4_LIST_SIZE);
-
-	adapter->peer_wwpn = 0;
-	adapter->peer_wwnn = 0;
-	adapter->peer_d_id = 0;
 }
 
 static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req,
-- 
2.17.1

  parent reply	other threads:[~2020-05-08 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 17:23 [PATCH 0/8] zfcp: fix DIF/DIX support with scsi-mq host-wide tag-set Benjamin Block
2020-05-08 17:23 ` [PATCH 1/8] zfcp: move shost modification after QDIO (re-)open into fenced function Benjamin Block
2020-05-08 17:23 ` [PATCH 2/8] zfcp: move shost updates during xconfig data handling " Benjamin Block
2020-05-08 17:23 ` [PATCH 3/8] zfcp: move fc_host updates during xport " Benjamin Block
2020-05-08 17:23 ` Benjamin Block [this message]
2020-05-08 17:23 ` [PATCH 5/8] zfcp: move p-t-p port allocation to after xport data Benjamin Block
2020-05-08 17:23 ` [PATCH 6/8] zfcp: fence adapter status propagation for common statuses Benjamin Block
2020-05-08 17:23 ` [PATCH 7/8] zfcp: fence early sysfs interfaces for accesses of shost objects Benjamin Block
2020-05-08 17:23 ` [PATCH 8/8] zfcp: move allocation of the shost object to after xconf- and xport-data Benjamin Block
2020-05-12  3:28 ` [PATCH 0/8] zfcp: fix DIF/DIX support with scsi-mq host-wide tag-set Martin K. Petersen
2020-05-12  9:27   ` Benjamin Block

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f841f2cda61dcd7b8549910c44e1831927459edf.1588956679.git.bblock@linux.ibm.com \
    --to=bblock@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jejb@linux.ibm.com \
    --cc=jwi@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loshakov@linux.ibm.com \
    --cc=maier@linux.ibm.com \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox