diff options
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 5d687d7cffae..8077bdf5d30d 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -603,6 +603,9 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
603 | ata_link_for_each_dev(dev, link) { | 603 | ata_link_for_each_dev(dev, link) { |
604 | int devno = dev->devno; | 604 | int devno = dev->devno; |
605 | 605 | ||
606 | if (!ata_dev_enabled(dev)) | ||
607 | continue; | ||
608 | |||
606 | ehc->saved_xfer_mode[devno] = dev->xfer_mode; | 609 | ehc->saved_xfer_mode[devno] = dev->xfer_mode; |
607 | if (ata_ncq_enabled(dev)) | 610 | if (ata_ncq_enabled(dev)) |
608 | ehc->saved_ncq_enabled |= 1 << devno; | 611 | ehc->saved_ncq_enabled |= 1 << devno; |
@@ -1161,6 +1164,7 @@ void ata_eh_detach_dev(struct ata_device *dev) | |||
1161 | { | 1164 | { |
1162 | struct ata_link *link = dev->link; | 1165 | struct ata_link *link = dev->link; |
1163 | struct ata_port *ap = link->ap; | 1166 | struct ata_port *ap = link->ap; |
1167 | struct ata_eh_context *ehc = &link->eh_context; | ||
1164 | unsigned long flags; | 1168 | unsigned long flags; |
1165 | 1169 | ||
1166 | ata_dev_disable(dev); | 1170 | ata_dev_disable(dev); |
@@ -1174,9 +1178,11 @@ void ata_eh_detach_dev(struct ata_device *dev) | |||
1174 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; | 1178 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; |
1175 | } | 1179 | } |
1176 | 1180 | ||
1177 | /* clear per-dev EH actions */ | 1181 | /* clear per-dev EH info */ |
1178 | ata_eh_clear_action(link, dev, &link->eh_info, ATA_EH_PERDEV_MASK); | 1182 | ata_eh_clear_action(link, dev, &link->eh_info, ATA_EH_PERDEV_MASK); |
1179 | ata_eh_clear_action(link, dev, &link->eh_context.i, ATA_EH_PERDEV_MASK); | 1183 | ata_eh_clear_action(link, dev, &link->eh_context.i, ATA_EH_PERDEV_MASK); |
1184 | ehc->saved_xfer_mode[dev->devno] = 0; | ||
1185 | ehc->saved_ncq_enabled &= ~(1 << dev->devno); | ||
1180 | 1186 | ||
1181 | spin_unlock_irqrestore(ap->lock, flags); | 1187 | spin_unlock_irqrestore(ap->lock, flags); |
1182 | } | 1188 | } |
@@ -2787,6 +2793,9 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) | |||
2787 | 2793 | ||
2788 | /* if data transfer is verified, clear DUBIOUS_XFER on ering top */ | 2794 | /* if data transfer is verified, clear DUBIOUS_XFER on ering top */ |
2789 | ata_link_for_each_dev(dev, link) { | 2795 | ata_link_for_each_dev(dev, link) { |
2796 | if (!ata_dev_enabled(dev)) | ||
2797 | continue; | ||
2798 | |||
2790 | if (!(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) { | 2799 | if (!(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) { |
2791 | struct ata_ering_entry *ent; | 2800 | struct ata_ering_entry *ent; |
2792 | 2801 | ||
@@ -2808,6 +2817,9 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) | |||
2808 | u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; | 2817 | u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; |
2809 | u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); | 2818 | u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); |
2810 | 2819 | ||
2820 | if (!ata_dev_enabled(dev)) | ||
2821 | continue; | ||
2822 | |||
2811 | if (dev->xfer_mode != saved_xfer_mode || | 2823 | if (dev->xfer_mode != saved_xfer_mode || |
2812 | ata_ncq_enabled(dev) != saved_ncq) | 2824 | ata_ncq_enabled(dev) != saved_ncq) |
2813 | dev->flags |= ATA_DFLAG_DUBIOUS_XFER; | 2825 | dev->flags |= ATA_DFLAG_DUBIOUS_XFER; |