From: Satish Kharat Date: Tue, 27 Jun 2017 00:49:06 +0000 (-0700) Subject: scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init X-Git-Tag: v4.1.12-111.0.20170907_2225~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ead31ffa566d067e687d5b087d81a03cbbbc8b99;p=users%2Fjedix%2Flinux-maple.git scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init Currently the queue command returns DID_NO_CONNECT anytime the rport is not in RPORT_ST_READY state. Changing it to return DID_NO_CONNECT only when the rport is in RPORT_ST_DELETE state. When the rport is in one of the init states retruning DID_IMM_RETRY. Orabug: 26670341 Signed-off-by: Sesidhar Baddela Signed-off-by: Satish Kharat Signed-off-by: Martin K. Petersen (cherry picked from commit 4a1108d6caf7cd0f15d439bee6163ba00c7c1b33) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 26ff3f0df92ac..ac9f0034d0acd 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -450,15 +450,27 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ } rp = rport->dd_data; - if (!rp || rp->rp_state != RPORT_ST_READY) { + if (!rp || rp->rp_state == RPORT_ST_DELETE) { FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, - "returning DID_NO_CONNECT for IO as rport is removed\n"); + "rport 0x%x removed, returning DID_NO_CONNECT\n", + rport->port_id); + atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); sc->result = DID_NO_CONNECT<<16; done(sc); return 0; } + if (rp->rp_state != RPORT_ST_READY) { + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, + "rport 0x%x in state 0x%x, returning DID_IMM_RETRY\n", + rport->port_id, rp->rp_state); + + sc->result = DID_IMM_RETRY << 16; + done(sc); + return 0; + } + if (lp->state != LPORT_ST_READY || !(lp->link_up)) return SCSI_MLQUEUE_HOST_BUSY;