[SCSI] qla2xxx: Don't issue set or get port param MBC if port is not online.
authorGiridhar Malavali <giridhar.malavali@qlogic.com>
Fri, 3 Sep 2010 22:20:48 +0000 (15:20 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 5 Sep 2010 18:33:00 +0000 (15:33 -0300)
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_init.c

index 9067629817ea4867ac99d342c3985fa895023237..fdfbf83a63309316c394bf360d189c8bae7a9b33 100644 (file)
@@ -1254,10 +1254,9 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
                return -EINVAL;
        }
 
-       if (fcport->loop_id == FC_NO_LOOP_ID) {
-               DEBUG2(printk(KERN_ERR "%s(%ld): Invalid port loop id, "
-                       "loop_id = 0x%x\n",
-                       __func__, vha->host_no, fcport->loop_id));
+       if (atomic_read(&fcport->state) != FCS_ONLINE) {
+               DEBUG2(printk(KERN_ERR "%s(%ld): Port not online\n",
+                       __func__, vha->host_no));
                return -EINVAL;
        }
 
index d863ed2619b56853f7d29250dfd17b876fb0ee5c..9f71226e0a3e1ddfc159fb05c280f052c54870b0 100644 (file)
@@ -2785,6 +2785,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
        if (!IS_IIDMA_CAPABLE(ha))
                return;
 
+       if (atomic_read(&fcport->state) != FCS_ONLINE)
+               return;
+
        if (fcport->fp_speed == PORT_SPEED_UNKNOWN ||
            fcport->fp_speed > ha->link_data_rate)
                return;