aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2016-06-18 14:59:01 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2016-06-18 14:59:01 -0400
commit951d77fd5a541d68eeb7372e72cd4757e3058517 (patch)
tree74ddfe541cc01e61dbcaf946b604c01863637c65
parent27ea13e6186c1a5bd0fa2b0d6f854d60ca4ca4c9 (diff)
parent8beb330044d0d1878c7b92290e91c0b889e92633 (diff)
Merge remote-tracking branch 'mkp-scsi/4.7/scsi-fixes' into fixes
-rw-r--r--Documentation/scsi/scsi_eh.txt8
-rw-r--r--drivers/ata/libata-eh.c2
-rw-r--r--drivers/scsi/53c700.c4
-rw-r--r--drivers/scsi/scsi_error.c4
4 files changed, 12 insertions, 6 deletions
diff --git a/Documentation/scsi/scsi_eh.txt b/Documentation/scsi/scsi_eh.txt
index 8638f61c8c9d..37eca00796ee 100644
--- a/Documentation/scsi/scsi_eh.txt
+++ b/Documentation/scsi/scsi_eh.txt
@@ -263,19 +263,23 @@ scmd->allowed.
263 263
264 3. scmd recovered 264 3. scmd recovered
265 ACTION: scsi_eh_finish_cmd() is invoked to EH-finish scmd 265 ACTION: scsi_eh_finish_cmd() is invoked to EH-finish scmd
266 - shost->host_failed--
267 - clear scmd->eh_eflags 266 - clear scmd->eh_eflags
268 - scsi_setup_cmd_retry() 267 - scsi_setup_cmd_retry()
269 - move from local eh_work_q to local eh_done_q 268 - move from local eh_work_q to local eh_done_q
270 LOCKING: none 269 LOCKING: none
270 CONCURRENCY: at most one thread per separate eh_work_q to
271 keep queue manipulation lockless
271 272
272 4. EH completes 273 4. EH completes
273 ACTION: scsi_eh_flush_done_q() retries scmds or notifies upper 274 ACTION: scsi_eh_flush_done_q() retries scmds or notifies upper
274 layer of failure. 275 layer of failure. May be called concurrently but must have
276 a no more than one thread per separate eh_work_q to
277 manipulate the queue locklessly
275 - scmd is removed from eh_done_q and scmd->eh_entry is cleared 278 - scmd is removed from eh_done_q and scmd->eh_entry is cleared
276 - if retry is necessary, scmd is requeued using 279 - if retry is necessary, scmd is requeued using
277 scsi_queue_insert() 280 scsi_queue_insert()
278 - otherwise, scsi_finish_command() is invoked for scmd 281 - otherwise, scsi_finish_command() is invoked for scmd
282 - zero shost->host_failed
279 LOCKING: queue or finish function performs appropriate locking 283 LOCKING: queue or finish function performs appropriate locking
280 284
281 285
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 61dc7a99e89a..c6f017458958 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -606,7 +606,7 @@ void ata_scsi_error(struct Scsi_Host *host)
606 ata_scsi_port_error_handler(host, ap); 606 ata_scsi_port_error_handler(host, ap);
607 607
608 /* finish or retry handled scmd's and clean up */ 608 /* finish or retry handled scmd's and clean up */
609 WARN_ON(host->host_failed || !list_empty(&eh_work_q)); 609 WARN_ON(!list_empty(&eh_work_q));
610 610
611 DPRINTK("EXIT\n"); 611 DPRINTK("EXIT\n");
612} 612}
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index d4c285688ce9..3ddc85e6efd6 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -1122,7 +1122,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
1122 } else { 1122 } else {
1123 struct scsi_cmnd *SCp; 1123 struct scsi_cmnd *SCp;
1124 1124
1125 SCp = scsi_host_find_tag(SDp->host, SCSI_NO_TAG); 1125 SCp = SDp->current_cmnd;
1126 if(unlikely(SCp == NULL)) { 1126 if(unlikely(SCp == NULL)) {
1127 sdev_printk(KERN_ERR, SDp, 1127 sdev_printk(KERN_ERR, SDp,
1128 "no saved request for untagged cmd\n"); 1128 "no saved request for untagged cmd\n");
@@ -1826,7 +1826,7 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)
1826 slot->tag, slot); 1826 slot->tag, slot);
1827 } else { 1827 } else {
1828 slot->tag = SCSI_NO_TAG; 1828 slot->tag = SCSI_NO_TAG;
1829 /* must populate current_cmnd for scsi_host_find_tag to work */ 1829 /* save current command for reselection */
1830 SCp->device->current_cmnd = SCp; 1830 SCp->device->current_cmnd = SCp;
1831 } 1831 }
1832 /* sanity check: some of the commands generated by the mid-layer 1832 /* sanity check: some of the commands generated by the mid-layer
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index a8b610eaa0ca..106a6adbd6f1 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1128,7 +1128,6 @@ static int scsi_eh_action(struct scsi_cmnd *scmd, int rtn)
1128 */ 1128 */
1129void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q) 1129void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q)
1130{ 1130{
1131 scmd->device->host->host_failed--;
1132 scmd->eh_eflags = 0; 1131 scmd->eh_eflags = 0;
1133 list_move_tail(&scmd->eh_entry, done_q); 1132 list_move_tail(&scmd->eh_entry, done_q);
1134} 1133}
@@ -2227,6 +2226,9 @@ int scsi_error_handler(void *data)
2227 else 2226 else
2228 scsi_unjam_host(shost); 2227 scsi_unjam_host(shost);
2229 2228
2229 /* All scmds have been handled */
2230 shost->host_failed = 0;
2231
2230 /* 2232 /*
2231 * Note - if the above fails completely, the action is to take 2233 * Note - if the above fails completely, the action is to take
2232 * individual devices offline and flush the queue of any 2234 * individual devices offline and flush the queue of any