Skip to content

Commit 8388401

Browse files
Jeff Skirvindjbw
authored andcommitted
isci: Remote device stop also suspends the RNC and terminates I/O.
Fixing the remote device state machine to suspend and terminate all outstanding I/O before the device stopped state is reached. Signed-off-by: Jeff Skirvin <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 23ec2aa commit 8388401

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

drivers/scsi/isci/remote_device.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,15 @@ enum sci_status sci_remote_device_stop(struct isci_remote_device *idev,
263263
case SCI_SMP_DEV_IDLE:
264264
case SCI_SMP_DEV_CMD:
265265
sci_change_state(sm, SCI_DEV_STOPPING);
266-
if (idev->started_request_count == 0) {
266+
if (idev->started_request_count == 0)
267267
sci_remote_node_context_destruct(&idev->rnc,
268-
rnc_destruct_done, idev);
269-
return SCI_SUCCESS;
270-
} else
271-
return sci_remote_device_terminate_requests(idev);
272-
break;
268+
rnc_destruct_done,
269+
idev);
270+
else {
271+
sci_remote_device_suspend(idev);
272+
sci_remote_device_terminate_requests(idev);
273+
}
274+
return SCI_SUCCESS;
273275
case SCI_DEV_STOPPING:
274276
/* All requests should have been terminated, but if there is an
275277
* attempt to stop a device already in the stopping state, then
@@ -1403,14 +1405,8 @@ enum sci_status isci_remote_device_stop(struct isci_host *ihost, struct isci_rem
14031405
spin_lock_irqsave(&ihost->scic_lock, flags);
14041406
idev->domain_dev->lldd_dev = NULL; /* disable new lookups */
14051407
set_bit(IDEV_GONE, &idev->flags);
1406-
spin_unlock_irqrestore(&ihost->scic_lock, flags);
1407-
1408-
/* Kill all outstanding requests. */
1409-
isci_remote_device_nuke_requests(ihost, idev);
14101408

14111409
set_bit(IDEV_STOP_PENDING, &idev->flags);
1412-
1413-
spin_lock_irqsave(&ihost->scic_lock, flags);
14141410
status = sci_remote_device_stop(idev, 50);
14151411
spin_unlock_irqrestore(&ihost->scic_lock, flags);
14161412

@@ -1420,6 +1416,9 @@ enum sci_status isci_remote_device_stop(struct isci_host *ihost, struct isci_rem
14201416
else
14211417
wait_for_device_stop(ihost, idev);
14221418

1419+
dev_dbg(&ihost->pdev->dev,
1420+
"%s: isci_device = %p, waiting done.\n", __func__, idev);
1421+
14231422
return status;
14241423
}
14251424

0 commit comments

Comments
 (0)