aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2012-05-18 00:56:57 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:22 -0400
commit5d9fb5cc1b88277bb28a2a54e51b34cacaa123c2 (patch)
tree9067ba87ee1455850d97984608daa717f381e0d8 /drivers/scsi/scsi_transport_fc.c
parent1b8d26206134458044b0689f48194af00c96d406 (diff)
[SCSI] core, classes, mpt2sas: have scsi_internal_device_unblock take new state
This has scsi_internal_device_unblock/scsi_target_unblock take the new state to set the devices as an argument instead of always setting to running. The patch also converts users of these functions. This allows the FC and iSCSI class to transition devices from blocked to transport-offline, so that when fast_io_fail/replacement_timeout has fired we do not set the devices back to running. Instead, we set them to SDEV_TRANSPORT_OFFLINE. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 2fded793997c..2d1e68db9b3f 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2495,11 +2495,9 @@ static void fc_terminate_rport_io(struct fc_rport *rport)
2495 i->f->terminate_rport_io(rport); 2495 i->f->terminate_rport_io(rport);
2496 2496
2497 /* 2497 /*
2498 * must unblock to flush queued IO. The caller will have set 2498 * Must unblock to flush queued IO. scsi-ml will fail incoming reqs.
2499 * the port_state or flags, so that fc_remote_port_chkready will
2500 * fail IO.
2501 */ 2499 */
2502 scsi_target_unblock(&rport->dev); 2500 scsi_target_unblock(&rport->dev, SDEV_TRANSPORT_OFFLINE);
2503} 2501}
2504 2502
2505/** 2503/**
@@ -2830,8 +2828,8 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
2830 2828
2831 /* if target, initiate a scan */ 2829 /* if target, initiate a scan */
2832 if (rport->scsi_target_id != -1) { 2830 if (rport->scsi_target_id != -1) {
2833 scsi_target_unblock(&rport->dev); 2831 scsi_target_unblock(&rport->dev,
2834 2832 SDEV_RUNNING);
2835 spin_lock_irqsave(shost->host_lock, 2833 spin_lock_irqsave(shost->host_lock,
2836 flags); 2834 flags);
2837 rport->flags |= FC_RPORT_SCAN_PENDING; 2835 rport->flags |= FC_RPORT_SCAN_PENDING;
@@ -2900,7 +2898,7 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
2900 spin_unlock_irqrestore(shost->host_lock, flags); 2898 spin_unlock_irqrestore(shost->host_lock, flags);
2901 2899
2902 if (ids->roles & FC_PORT_ROLE_FCP_TARGET) { 2900 if (ids->roles & FC_PORT_ROLE_FCP_TARGET) {
2903 scsi_target_unblock(&rport->dev); 2901 scsi_target_unblock(&rport->dev, SDEV_RUNNING);
2904 2902
2905 /* initiate a scan of the target */ 2903 /* initiate a scan of the target */
2906 spin_lock_irqsave(shost->host_lock, flags); 2904 spin_lock_irqsave(shost->host_lock, flags);
@@ -3105,7 +3103,7 @@ fc_remote_port_rolechg(struct fc_rport *rport, u32 roles)
3105 /* ensure any stgt delete functions are done */ 3103 /* ensure any stgt delete functions are done */
3106 fc_flush_work(shost); 3104 fc_flush_work(shost);
3107 3105
3108 scsi_target_unblock(&rport->dev); 3106 scsi_target_unblock(&rport->dev, SDEV_RUNNING);
3109 /* initiate a scan of the target */ 3107 /* initiate a scan of the target */
3110 spin_lock_irqsave(shost->host_lock, flags); 3108 spin_lock_irqsave(shost->host_lock, flags);
3111 rport->flags |= FC_RPORT_SCAN_PENDING; 3109 rport->flags |= FC_RPORT_SCAN_PENDING;
@@ -3149,7 +3147,7 @@ fc_timeout_deleted_rport(struct work_struct *work)
3149 "blocked FC remote port time out: no longer" 3147 "blocked FC remote port time out: no longer"
3150 " a FCP target, removing starget\n"); 3148 " a FCP target, removing starget\n");
3151 spin_unlock_irqrestore(shost->host_lock, flags); 3149 spin_unlock_irqrestore(shost->host_lock, flags);
3152 scsi_target_unblock(&rport->dev); 3150 scsi_target_unblock(&rport->dev, SDEV_TRANSPORT_OFFLINE);
3153 fc_queue_work(shost, &rport->stgt_delete_work); 3151 fc_queue_work(shost, &rport->stgt_delete_work);
3154 return; 3152 return;
3155 } 3153 }