aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libata-eh.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index 71ad18b7cff6..1968f2d140f3 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -229,9 +229,15 @@ void ata_scsi_error(struct Scsi_Host *host)
229 repeat: 229 repeat:
230 /* invoke error handler */ 230 /* invoke error handler */
231 if (ap->ops->error_handler) { 231 if (ap->ops->error_handler) {
232 /* clear EH pending */ 232 /* fetch & clear EH info */
233 spin_lock_irqsave(hs_lock, flags); 233 spin_lock_irqsave(hs_lock, flags);
234
235 memset(&ap->eh_context, 0, sizeof(ap->eh_context));
236 ap->eh_context.i = ap->eh_info;
237 memset(&ap->eh_info, 0, sizeof(ap->eh_info));
238
234 ap->flags &= ~ATA_FLAG_EH_PENDING; 239 ap->flags &= ~ATA_FLAG_EH_PENDING;
240
235 spin_unlock_irqrestore(hs_lock, flags); 241 spin_unlock_irqrestore(hs_lock, flags);
236 242
237 /* invoke EH */ 243 /* invoke EH */
@@ -255,6 +261,9 @@ void ata_scsi_error(struct Scsi_Host *host)
255 "tries, giving up\n", ATA_EH_MAX_REPEAT); 261 "tries, giving up\n", ATA_EH_MAX_REPEAT);
256 } 262 }
257 263
264 /* this run is complete, make sure EH info is clear */
265 memset(&ap->eh_info, 0, sizeof(ap->eh_info));
266
258 /* Clear host_eh_scheduled while holding hs_lock such 267 /* Clear host_eh_scheduled while holding hs_lock such
259 * that if exception occurs after this point but 268 * that if exception occurs after this point but
260 * before EH completion, SCSI midlayer will 269 * before EH completion, SCSI midlayer will