aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index eb4c0593b406..45eb932c3935 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -363,6 +363,8 @@ void ata_scsi_error(struct Scsi_Host *host)
363 repeat: 363 repeat:
364 /* invoke error handler */ 364 /* invoke error handler */
365 if (ap->ops->error_handler) { 365 if (ap->ops->error_handler) {
366 struct ata_link *link;
367
366 /* kill fast drain timer */ 368 /* kill fast drain timer */
367 del_timer_sync(&ap->fastdrain_timer); 369 del_timer_sync(&ap->fastdrain_timer);
368 370
@@ -372,9 +374,11 @@ void ata_scsi_error(struct Scsi_Host *host)
372 /* fetch & clear EH info */ 374 /* fetch & clear EH info */
373 spin_lock_irqsave(ap->lock, flags); 375 spin_lock_irqsave(ap->lock, flags);
374 376
375 memset(&ap->link.eh_context, 0, sizeof(ap->link.eh_context)); 377 __ata_port_for_each_link(link, ap) {
376 ap->link.eh_context.i = ap->link.eh_info; 378 memset(&link->eh_context, 0, sizeof(link->eh_context));
377 memset(&ap->link.eh_info, 0, sizeof(ap->link.eh_info)); 379 link->eh_context.i = link->eh_info;
380 memset(&link->eh_info, 0, sizeof(link->eh_info));
381 }
378 382
379 ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS; 383 ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
380 ap->pflags &= ~ATA_PFLAG_EH_PENDING; 384 ap->pflags &= ~ATA_PFLAG_EH_PENDING;
@@ -410,7 +414,8 @@ void ata_scsi_error(struct Scsi_Host *host)
410 } 414 }
411 415
412 /* this run is complete, make sure EH info is clear */ 416 /* this run is complete, make sure EH info is clear */
413 memset(&ap->link.eh_info, 0, sizeof(ap->link.eh_info)); 417 __ata_port_for_each_link(link, ap)
418 memset(&link->eh_info, 0, sizeof(link->eh_info));
414 419
415 /* Clear host_eh_scheduled while holding ap->lock such 420 /* Clear host_eh_scheduled while holding ap->lock such
416 * that if exception occurs after this point but 421 * that if exception occurs after this point but