linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, lkml@rtr.ca, axboe@suse.de,
	forrest.zhao@intel.com, alan@lxorguk.ukuu.org.uk,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 01/11] libata: implement ATA_EHI_RESUME_LINK
Date: Mon, 3 Jul 2006 16:07:26 +0900	[thread overview]
Message-ID: <11519104463685-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11519104451998-git-send-email-htejun@gmail.com>

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>

---

 drivers/scsi/libata-core.c |   15 ++++++++-------
 drivers/scsi/libata-scsi.c |    1 +
 include/linux/libata.h     |    3 ++-
 3 files changed, 11 insertions(+), 8 deletions(-)

11afe177206757095a8b265cd3649b629db45179
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 11f2257..3d6e41b 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2619,13 +2619,14 @@ int ata_std_prereset(struct ata_port *ap
 	const unsigned long *timing;
 	int rc;
 
-	/* hotplug? */
-	if (ehc->i.flags & ATA_EHI_HOTPLUGGED) {
-		if (ap->flags & ATA_FLAG_HRST_TO_RESUME)
-			ehc->i.action |= ATA_EH_HARDRESET;
-		if (ap->flags & ATA_FLAG_SKIP_D2H_BSY)
-			ata_wait_spinup(ap);
-	}
+	/* handle link resume & hotplug spinup */
+	if ((ehc->i.flags & ATA_EHI_RESUME_LINK) &&
+	    (ap->flags & ATA_FLAG_HRST_TO_RESUME))
+		ehc->i.action |= ATA_EH_HARDRESET;
+
+	if ((ehc->i.flags & ATA_EHI_HOTPLUGGED) &&
+	    (ap->flags & ATA_FLAG_SKIP_D2H_BSY))
+		ata_wait_spinup(ap);
 
 	/* if we're about to do hardreset, nothing more to do */
 	if (ehc->i.action & ATA_EH_HARDRESET)
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 1946979..1ed89d8 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -3013,6 +3013,7 @@ static int ata_scsi_user_scan(struct Scs
 		if (dev) {
 			ap->eh_info.probe_mask |= 1 << dev->devno;
 			ap->eh_info.action |= ATA_EH_SOFTRESET;
+			ap->eh_info.flags |= ATA_EHI_RESUME_LINK;
 		} else
 			rc = -EINVAL;
 	}
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b5d247d..4d4ed2c 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -259,6 +259,7 @@ enum {
 
 	/* ata_eh_info->flags */
 	ATA_EHI_HOTPLUGGED	= (1 << 0),  /* could have been hotplugged */
+	ATA_EHI_RESUME_LINK	= (1 << 1),  /* need to resume link */
 
 	ATA_EHI_DID_RESET	= (1 << 16), /* already reset this port */
 
@@ -836,7 +837,7 @@ static inline void ata_ehi_hotplugged(st
 	if (ehi->flags & ATA_EHI_HOTPLUGGED)
 		return;
 
-	ehi->flags |= ATA_EHI_HOTPLUGGED;
+	ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
 	ehi->hotplug_timestamp = jiffies;
 
 	ehi->err_mask |= AC_ERR_ATA_BUS;
-- 
1.3.2



  parent reply	other threads:[~2006-07-03  7:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03  7:07 [PATCHSET] new Power Management for libata, take 4 Tejun Heo
2006-07-03  7:07 ` [PATCH 06/11] libata: reimplement per-dev PM Tejun Heo
2006-07-03  7:07 ` [PATCH 02/11] libata: clean up debounce parameters and improve parameter selection Tejun Heo
2006-07-03  7:07 ` [PATCH 03/11] libata: implement ATA_EHI_NO_AUTOPSY and QUIET Tejun Heo
2006-07-03  7:07 ` Tejun Heo [this message]
2006-07-06  2:16   ` [PATCH 01/11] libata: implement ATA_EHI_RESUME_LINK Jeff Garzik
2006-07-03  7:07 ` [PATCH 05/11] libata: implement PM EH actions Tejun Heo
2006-07-03  7:07 ` [PATCH 04/11] libata: separate out __ata_ehi_hotplugged() Tejun Heo
2006-07-03  7:07 ` [PATCH 07/11] libata: reimplement controller-wide PM Tejun Heo
2006-07-03  7:07 ` [PATCH 08/11] sata_sil: separate out sil_init_controller() Tejun Heo
2006-07-03  7:07 ` [PATCH 11/11] sata_sil24: add suspend/sleep support Tejun Heo
2006-07-03  7:07 ` [PATCH 10/11] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-07-03  7:07 ` [PATCH 09/11] sata_sil: add suspend/sleep support Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11519104463685-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=forrest.zhao@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).