aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/remote_device.c')
-rw-r--r--drivers/scsi/isci/remote_device.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index c5ce0f0f3645..5a86bb1e96df 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -136,16 +136,19 @@ static void rnc_destruct_done(void *_dev)
136static enum sci_status scic_sds_remote_device_terminate_requests(struct scic_sds_remote_device *sci_dev) 136static enum sci_status scic_sds_remote_device_terminate_requests(struct scic_sds_remote_device *sci_dev)
137{ 137{
138 struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller; 138 struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller;
139 struct isci_host *ihost = scic_to_ihost(scic);
139 u32 i, request_count = sci_dev->started_request_count; 140 u32 i, request_count = sci_dev->started_request_count;
140 enum sci_status status = SCI_SUCCESS; 141 enum sci_status status = SCI_SUCCESS;
141 142
142 for (i = 0; i < SCI_MAX_IO_REQUESTS && i < request_count; i++) { 143 for (i = 0; i < SCI_MAX_IO_REQUESTS && i < request_count; i++) {
143 struct scic_sds_request *sci_req; 144 struct isci_request *ireq = ihost->reqs[i];
145 struct scic_sds_request *sci_req = &ireq->sci;
144 enum sci_status s; 146 enum sci_status s;
145 147
146 sci_req = scic->io_request_table[i]; 148 if (!test_bit(IREQ_ACTIVE, &ireq->flags) ||
147 if (!sci_req || sci_req->target_device != sci_dev) 149 sci_req->target_device != sci_dev)
148 continue; 150 continue;
151
149 s = scic_controller_terminate_request(scic, sci_dev, sci_req); 152 s = scic_controller_terminate_request(scic, sci_dev, sci_req);
150 if (s != SCI_SUCCESS) 153 if (s != SCI_SUCCESS)
151 status = s; 154 status = s;