linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 07/11] prep LLDDs for hotplug support, take 1
@ 2006-05-11 15:11 Tejun Heo
  2006-05-11 15:11 ` [PATCH 02/14] libata-hp-prep: implement ata_dev_init() Tejun Heo
                   ` (20 more replies)
  0 siblings, 21 replies; 26+ messages in thread
From: Tejun Heo @ 2006-05-11 15:11 UTC (permalink / raw)
  To: jgarzik, alan, axboe, albertcc, forrest.zhao, efalk, linux-ide,
	htejun

Hairu.

This is part of patchset series described in [T].

This is the first take of prep-LLDDs-for-hotplug-support patchset.
Some of patches in this patchset are from the first take of
add-hotplug-support patchset.

Things worth noting are

* Simply exporting ata_hsm_move() and calling the function with
  appropriate status is good enough for driving HSM for LLDDs
  implementing their own irq handlers.  sata_sil's new irq handler
  now uses it.

* TF faking is removed from sata_sil24.

This patchset is against

  upstream (acc696d93dcf993dec123d69d599979e1456ffec)
  + [1] prep-for-new-EH patchset
  + [2] new-EH-framework patchset, take 3
  + [3] new-EH-implementation patchset, take 3
  + [4] merge-irq-pio patchset
  + [5] add-NCQ-support patchset, take 3
  + [6] prep for hotplug support, take 2

--
tejun

[T] http://article.gmane.org/gmane.linux.ide/9957
[1] http://article.gmane.org/gmane.linux.ide/9959
[2] http://article.gmane.org/gmane.linux.ide/9984
[3] http://article.gmane.org/gmane.linux.ide/9995
[4] http://article.gmane.org/gmane.linux.ide/10005
[5] http://article.gmane.org/gmane.linux.ide/10011
[6] http://article.gmane.org/gmane.linux.ide/10028



^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCHSET 01/03] prep for hotplug support, take 3
@ 2006-05-19 13:16 Tejun Heo
  2006-05-19 13:16 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
  0 siblings, 1 reply; 26+ messages in thread
From: Tejun Heo @ 2006-05-19 13:16 UTC (permalink / raw)
  To: jgarzik, mlord, albertcc, alan, axboe, forrest.zhao, linux-ide,
	htejun

Hello,

This is This is part of patchset series described in [T].

This is the third take of prep-for-hotplug-support patchset.  Changes
from the last take[L] are

* sata_phy_debounce() now takes const array of three ulongs for timing
  parameters.  This makes it easy to define and export different
  predefined timing parameters and to pass timing parameter through
  other functions.  sata_phy_resume() is changed to take timing
  parameters and pass it to sata_phy_debounce() intead of crude
  boolean @quick.

* Three predefined parameters are provided - sata_deb_timing_boot,
  sata_deb_timing_eh and sata_deb_timing_before_fsrst.  These
  predefined parameters are used in the new hotplug framework and
  don't have to be long enough to cover all the cases.  The goal is to
  cover most cases in reasonable amount of time.  If timeout occurs,
  libata will give it more time and then retry.

* prereset() framework has been updated such that prereset() can tell
  EH what reset mechanism to use or to skip reset completely.  This
  way, HRST_TO_RESUME handling is confined into prereset() and device
  detection from prereset() is handled cleanly.

* ata_std_prereset() has been updated to handle different behaviors
  controllers show on hotplug.  Some controllers can wait for the
  first FIS34, some can only after COMRESET, others just can't.  These
  are controlled by two flags - ATA_FLAG_HRST_TO_RESUME and
  ATA_FLAG_CANT_WAIT_FIS34.  Note that those two flags describe PHY
  property.  They will move out to ata_link later.

  If necessary, ata_std_prereset() waits for spinup until hotplug
  event timestamp + spinup wait time (currently 8s).  This mechanism
  will allow later PMP support to avoid excessive amount of waiting.

This patchset is against

  upstream (8d4ee71ff6de5255ebfdf44fb83419d27bd06368)
  + enforce-default-EH-actions patch [1]
  + scsi_implement_eh-patch [2]

Thanks.

--
tejun

[T] http://article.gmane.org/gmane.linux.ide/10530
[L] http://article.gmane.org/gmane.linux.ide/10073
[1] http://article.gmane.org/gmane.linux.ide/10317
[2] http://article.gmane.org/gmane.linux.ide/10529


^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH 06/14] libata-hp-prep: implement ap->hw_sata_spd_limit
@ 2006-05-19 13:06 Tejun Heo
  2006-05-19 13:06 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
  0 siblings, 1 reply; 26+ messages in thread
From: Tejun Heo @ 2006-05-19 13:06 UTC (permalink / raw)
  To: jgarzik, mlord, albertcc, alan, axboe, forrest.zhao, linux-ide; +Cc: Tejun Heo

Add ap->hw_sata_spd_limit and initialize it once during the boot
initialization (or driver load initialization).  ap->sata_spd_limit is
reset to ap->hw_sata_spd_limit on hotplug.  This prevents spd limits
introduced by earlier devices from affecting new devices.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/libata-core.c |   21 ++++++++++++---------
 include/linux/libata.h     |    1 +
 2 files changed, 13 insertions(+), 9 deletions(-)

b2fd37ae97c04c7d19e5ae17dd50ad8d3ad8c725
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ccdb867..9e10b79 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2457,17 +2457,9 @@ static int sata_phy_resume(struct ata_po
  */
 void ata_std_probeinit(struct ata_port *ap)
 {
-	u32 scontrol;
-
 	/* resume link */
 	sata_phy_resume(ap);
 
-	/* init sata_spd_limit to the current value */
-	if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
-		int spd = (scontrol >> 4) & 0xf;
-		ap->sata_spd_limit &= (1 << spd) - 1;
-	}
-
 	/* wait for device */
 	if (ata_port_online(ap))
 		ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
@@ -5122,6 +5114,9 @@ void ata_dev_init(struct ata_device *dev
 	struct ata_port *ap = dev->ap;
 	unsigned long flags;
 
+	/* SATA spd limit is bound to the first device */
+	ap->sata_spd_limit = ap->hw_sata_spd_limit;
+
 	/* High bits of dev->flags are used to record warm plug
 	 * requests which occur asynchronously.  Synchronize using
 	 * host_set lock.
@@ -5177,7 +5172,7 @@ static void ata_host_init(struct ata_por
 	ap->udma_mask = ent->udma_mask;
 	ap->flags |= ent->host_flags;
 	ap->ops = ent->port_ops;
-	ap->sata_spd_limit = UINT_MAX;
+	ap->hw_sata_spd_limit = UINT_MAX;
 	ap->active_tag = ATA_TAG_POISON;
 	ap->last_ctl = 0xFF;
 
@@ -5340,10 +5335,18 @@ int ata_device_add(const struct ata_prob
 	DPRINTK("probe begin\n");
 	for (i = 0; i < count; i++) {
 		struct ata_port *ap;
+		u32 scontrol;
 		int rc;
 
 		ap = host_set->ports[i];
 
+		/* init sata_spd_limit to the current value */
+		if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
+			int spd = (scontrol >> 4) & 0xf;
+			ap->hw_sata_spd_limit &= (1 << spd) - 1;
+		}
+		ap->sata_spd_limit = ap->hw_sata_spd_limit;
+
 		DPRINTK("ata%u: bus probe begin\n", ap->id);
 		rc = ata_bus_probe(ap);
 		DPRINTK("ata%u: bus probe end\n", ap->id);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 99808c5..07c98c2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -486,6 +486,7 @@ struct ata_port {
 	unsigned int		mwdma_mask;
 	unsigned int		udma_mask;
 	unsigned int		cbl;	/* cable type; ATA_CBL_xxx */
+	unsigned int		hw_sata_spd_limit;
 	unsigned int		sata_spd_limit;	/* SATA PHY speed limit */
 
 	/* record runtime error info, protected by host_set lock */
-- 
1.3.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread
* [PATCHSET 06/11] prep for hotplug support, take 2
@ 2006-05-11 15:02 Tejun Heo
  2006-05-11 15:02 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
  0 siblings, 1 reply; 26+ messages in thread
From: Tejun Heo @ 2006-05-11 15:02 UTC (permalink / raw)
  To: jgarzik, alan, axboe, albertcc, forrest.zhao, efalk, linux-ide,
	htejun

Bang-Ga.

This is part of patchset series described in [T].

This is the second take of prep-for-hotplug-support patchset.  Changes
from the last take[L] are

* dev->flags is used for warm plug and synchronized with host_set
  lock.  ata_dev_init() is updated to clear non-persistent part of
  dev->flags while holding host_set lock.

* ap->orig_sata_spd_limit renamed to ap->hw_sata_spd_limit.

* sata_phy_debounce() implemented.  This function will be called
  before performing EH resets to settle devices instead of blind
  delay.  sata_phy_debounce() is superset of the wait used in
  sata_phy_resume() and sata_phy_resume() is converted to use it.

* TF access is made optional.  All probing (including boot probing)
  will be done via hotplug and hotplug probing is implemented such
  that ->tf_read/write() isn't necessary, so now drivers like
  sata_sil24 don't have to fake TF access.  As ->check_[alt]status()
  was embedded too deep, ata_noop_check_status() is added instead of
  making those methods optional.  In the long term, those low level
  methods should be separated from highlevel ops somehow.

* ops->prereset() added.  This function is the counterpart of
  postreset() and called before a series of resets.  This is quite
  similar to ->probe_init() except that it's called for all resets.
  prereset() can determine things like whether it's prepping for boot
  probing or not, and which reset will be performed by testing
  ap->flags and ehi.

* Followup-softreset handling implemented.

* hotplug will completely replace ->probe_init/reset().

This patchset is against

  upstream (acc696d93dcf993dec123d69d599979e1456ffec)
  + [1] prep-for-new-EH patchset
  + [2] new-EH-framework patchset, take 3
  + [3] new-EH-implementation patchset, take 3
  + [4] merge-irq-pio patchset
  + [5] add-NCQ-support patchset, take 3

--
tejun

[T] http://article.gmane.org/gmane.linux.ide/9957
[L] http://article.gmane.org/gmane.linux.ide/9579
[1] http://article.gmane.org/gmane.linux.ide/9959
[2] http://article.gmane.org/gmane.linux.ide/9984
[3] http://article.gmane.org/gmane.linux.ide/9995
[4] http://article.gmane.org/gmane.linux.ide/10005
[5] http://article.gmane.org/gmane.linux.ide/10011



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2006-05-19 15:04 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11 15:11 [PATCHSET 07/11] prep LLDDs for hotplug support, take 1 Tejun Heo
2006-05-11 15:11 ` [PATCH 02/14] libata-hp-prep: implement ata_dev_init() Tejun Heo
2006-05-11 15:11 ` [PATCH 2/6] sata_sil: add new constants in preparation for new interrupt handler Tejun Heo
2006-05-11 15:11 ` [PATCH 1/6] libata: export ata_hsm_move() Tejun Heo
2006-05-11 15:11 ` [PATCH 01/14] libata-hp-prep: add flags and eh_info/context fields for hotplug Tejun Heo
2006-05-11 15:11 ` [PATCH 4/6] sata_sil24: rename PORT_PRB to PORT_LRAM and add PORT_LRAM_SLOT_SZ Tejun Heo
2006-05-11 15:11 ` [PATCH 09/14] libata-hp-prep: make probing related functions global Tejun Heo
2006-05-11 15:11 ` [PATCH 3/6] sata_sil: new interrupt handler Tejun Heo
2006-05-11 15:11 ` [PATCH 6/6] sata_sil24: kill ops->tf_read() and use ata_std_noop_check_status() Tejun Heo
2006-05-11 15:11 ` [PATCH 04/14] libata-hp-prep: update ata_scsi_find_dev() and friends Tejun Heo
2006-05-11 15:11 ` [PATCH 06/14] libata-hp-prep: implement ap->hw_sata_spd_limit Tejun Heo
2006-05-11 15:11 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
2006-05-11 15:11 ` [PATCH 03/14] libata-hp-prep: make some ata_device fields persistent Tejun Heo
2006-05-11 15:11 ` [PATCH 5/6] sata_sil24: use sata_phy_debounce() in sil24_hardreset() Tejun Heo
2006-05-11 15:11 ` [PATCH 08/14] libata-hp-prep: add ata_hotplug_wq Tejun Heo
2006-05-11 15:11 ` [PATCH 10/14] libata-hp-prep: implement sata_phy_debounce() Tejun Heo
2006-05-11 15:11 ` [PATCH 05/14] libata-hp-prep: use __ata_scsi_find_dev() Tejun Heo
2006-05-11 15:12 ` [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional Tejun Heo
2006-05-11 15:12 ` [PATCH 12/14] libata-hp-prep: implement ata_noop_check_status() Tejun Heo
2006-05-11 15:12 ` [PATCH 13/14] libata-hp-prep: add prereset() method and implement ata_std_prereset() Tejun Heo
2006-05-11 15:12 ` [PATCH 14/14] libata-hp-prep: implement followup softreset handling Tejun Heo
2006-05-11 15:14 ` THIS THREAD IS MESSED UP, PLEASE IGNORE Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2006-05-19 13:16 [PATCHSET 01/03] prep for hotplug support, take 3 Tejun Heo
2006-05-19 13:16 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
2006-05-19 15:04   ` Jeff Garzik
2006-05-19 13:06 [PATCH 06/14] libata-hp-prep: implement ap->hw_sata_spd_limit Tejun Heo
2006-05-19 13:06 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
2006-05-11 15:02 [PATCHSET 06/11] prep for hotplug support, take 2 Tejun Heo
2006-05-11 15:02 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo

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).