@@ -1663,8 +1663,15 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
struct ibmvfc_event *evt;
int rc;
- if (unlikely((rc = fc_remote_port_chkready(rport))) ||
- unlikely((rc = ibmvfc_host_chkready(vhost)))) {
+ rc = fc_remote_port_chkready(rport, cmnd);
+ if (unlikely(rc)) {
+ cmnd->result = rc;
+ done(cmnd);
+ return 0;
+ }
+
+ rc = ibmvfc_host_chkready(vhost);
+ if (unlikely(rc)) {
cmnd->result = rc;
done(cmnd);
return 0;
@@ -1934,8 +1941,19 @@ static int ibmvfc_bsg_request(struct bsg_job *job)
spin_lock_irqsave(vhost->host->host_lock, flags);
- if (unlikely(rc || (rport && (rc = fc_remote_port_chkready(rport)))) ||
- unlikely((rc = ibmvfc_host_chkready(vhost)))) {
+ if (unlikely(rc)) {
+ spin_unlock_irqrestore(vhost->host->host_lock, flags);
+ goto out;
+ }
+
+ rc = fc_remote_port_chkready(rport, NULL);
+ if (rport && rc) {
+ spin_unlock_irqrestore(vhost->host->host_lock, flags);
+ goto out;
+ }
+
+ rc = ibmvfc_host_chkready(vhost);
+ if (unlikely(rc)) {
spin_unlock_irqrestore(vhost->host->host_lock, flags);
goto out;
}
@@ -2910,7 +2928,7 @@ static int ibmvfc_slave_alloc(struct scsi_device *sdev)
struct ibmvfc_host *vhost = shost_priv(shost);
unsigned long flags = 0;
- if (!rport || fc_remote_port_chkready(rport))
+ if (!rport || fc_remote_port_chkready(rport, NULL))
return -ENXIO;
spin_lock_irqsave(shost->host_lock, flags);
Added changes to pass a new argument to fc_remote_port_chkready Also fixed the checkpatch error "do not use assignment in if condition" Signed-off-by: Muneendra <muneendra.kumar@broadcom.com> --- v3: New Patch --- drivers/scsi/ibmvscsi/ibmvfc.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)