aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-07-03 03:07:26 -0400
committerJeff Garzik <jeff@garzik.org>2006-07-05 22:16:27 -0400
commit28324304350e23db24d679c55de3f06a5b1e40aa (patch)
treed1100fbbc939a5f214a3d2917f5ef9cce5159a0e
parente30349d27e093f32ef517b5416d9dce1998d4676 (diff)
[PATCH] libata: implement ATA_EHI_RESUME_LINK
Implement ATA_EHI_RESUME_LINK, which indicates that the link needs to be resumed. This used to be implied by ATA_EHI_HOTPLUGGED. However, hotplug isn't the only event which requires link resume and separating this out allows other places to request link resume. This differentiation also allows better debounce timing selection. This patch converts user scan to use ATA_EHI_RESUME_LINK. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/scsi/libata-core.c15
-rw-r--r--drivers/scsi/libata-scsi.c1
-rw-r--r--include/linux/libata.h3
3 files changed, 11 insertions, 8 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ccab1d7ceada..90db054fa994 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2627,13 +2627,14 @@ int ata_std_prereset(struct ata_port *ap)
2627 const unsigned long *timing; 2627 const unsigned long *timing;
2628 int rc; 2628 int rc;
2629 2629
2630 /* hotplug? */ 2630 /* handle link resume & hotplug spinup */
2631 if (ehc->i.flags & ATA_EHI_HOTPLUGGED) { 2631 if ((ehc->i.flags & ATA_EHI_RESUME_LINK) &&
2632 if (ap->flags & ATA_FLAG_HRST_TO_RESUME) 2632 (ap->flags & ATA_FLAG_HRST_TO_RESUME))
2633 ehc->i.action |= ATA_EH_HARDRESET; 2633 ehc->i.action |= ATA_EH_HARDRESET;
2634 if (ap->flags & ATA_FLAG_SKIP_D2H_BSY) 2634
2635 ata_wait_spinup(ap); 2635 if ((ehc->i.flags & ATA_EHI_HOTPLUGGED) &&
2636 } 2636 (ap->flags & ATA_FLAG_SKIP_D2H_BSY))
2637 ata_wait_spinup(ap);
2637 2638
2638 /* if we're about to do hardreset, nothing more to do */ 2639 /* if we're about to do hardreset, nothing more to do */
2639 if (ehc->i.action & ATA_EH_HARDRESET) 2640 if (ehc->i.action & ATA_EH_HARDRESET)
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 153452e77264..ba3e515f2b9d 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -3011,6 +3011,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3011 if (dev) { 3011 if (dev) {
3012 ap->eh_info.probe_mask |= 1 << dev->devno; 3012 ap->eh_info.probe_mask |= 1 << dev->devno;
3013 ap->eh_info.action |= ATA_EH_SOFTRESET; 3013 ap->eh_info.action |= ATA_EH_SOFTRESET;
3014 ap->eh_info.flags |= ATA_EHI_RESUME_LINK;
3014 } else 3015 } else
3015 rc = -EINVAL; 3016 rc = -EINVAL;
3016 } 3017 }
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b5d247d780f8..4d4ed2c8fec7 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -259,6 +259,7 @@ enum {
259 259
260 /* ata_eh_info->flags */ 260 /* ata_eh_info->flags */
261 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ 261 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
262 ATA_EHI_RESUME_LINK = (1 << 1), /* need to resume link */
262 263
263 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ 264 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
264 265
@@ -836,7 +837,7 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
836 if (ehi->flags & ATA_EHI_HOTPLUGGED) 837 if (ehi->flags & ATA_EHI_HOTPLUGGED)
837 return; 838 return;
838 839
839 ehi->flags |= ATA_EHI_HOTPLUGGED; 840 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
840 ehi->hotplug_timestamp = jiffies; 841 ehi->hotplug_timestamp = jiffies;
841 842
842 ehi->err_mask |= AC_ERR_ATA_BUS; 843 ehi->err_mask |= AC_ERR_ATA_BUS;