From: Hannes Reinecke Date: Fri, 30 Sep 2016 09:01:18 +0000 (+0200) Subject: scsi: libfc: Do not login if the port is already started X-Git-Tag: v4.14-rc1~1899^2~245 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06ee2571a438653bd14c33c70379a5f008a91901;p=platform%2Fkernel%2Flinux-rpi.git scsi: libfc: Do not login if the port is already started When the port is already started we don't need to login; that will only confuse the state machine. Signed-off-by: Hannes Reinecke Acked-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 4e4087a..72a7183 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -418,6 +418,12 @@ static int fc_rport_login(struct fc_rport_priv *rdata) { mutex_lock(&rdata->rp_mutex); + if (rdata->flags & FC_RP_STARTED) { + FC_RPORT_DBG(rdata, "port already started\n"); + mutex_unlock(&rdata->rp_mutex); + return 0; + } + rdata->flags |= FC_RP_STARTED; switch (rdata->rp_state) { case RPORT_ST_READY: