linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: lkml@rtr.ca, axboe@suse.de, forrest.zhao@intel.com,
	alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Subject: Re: [PATCH 05/10] libata: implement new EH action ATA_EH_SPINUP
Date: Thu, 15 Jun 2006 00:02:41 +0900	[thread overview]
Message-ID: <44902511.2040102@gmail.com> (raw)
In-Reply-To: <448F63F3.5010909@pobox.com>

Jeff Garzik wrote:
> Tejun Heo wrote:
>> Implement new EH action ATA_EH_SPINUP.  This will be used by new PM
>> implementation.
>>
>> Signed-off-by: Tejun Heo <htejun@gmail.com>
> 
> This patch further reinforces something I've been thinking about, as I 
> watch the EH grow:  these EH actions really should be separated into 
> small, discrete operations.  Then the EH "driver" will push discrete 
> operations onto an execution stack.
> 
> It's always getting tough to follow ata_eh_recover() and ata_eh_reset() 
> 's code through multiple iterations of recovery.  This patch 
> (ata_eh_spinup) also illustrates how difficult it would be if the 
> ordering of these operations ever needed to change.
> 
> So, I'm not NAK'ing the patch, just throwing out a 'caution' sign.  :)
> 
> I've often thought something along the lines of a list of tasks 
> ("eh_op_list"), for when a port is frozen and doing EH:
>     ata_eh_freeze()
>     ata_eh_push(ap, EH_OP_RESET_BUS, ...)
>     ata_eh_push(ap, EH_OP_SPINUP, ...)
>     ata_eh_push(ap, EH_OP_CONFIGURE, ...)
>     ata_eh_push(ap, EH_OP_SET_MODE, ...)
>     ata_eh_run()
>     ata_eh_thaw()
> 
> would be nice.  A discrete operation would handle its own discrete 
> operation, prepend and append other operations to eh_op_list, or 
> optionally cause the engine to fail, and return immediately.

At first, I thought many different controllers would use different EH 
drive routines, so I put all EH operations in separate functions and 
grouped them into several larger steps - currently autopsy, report, 
recover and finish.

In earlier implementation, sil24 and ahci actually had to implement 
their own drive routine calling those ops and doing private things 
in-between, but as EH implementation matures all those are handled by 
feeding proper information into the core EH.  I'm looking at other 
drivers to convert them to new EH but haven't found any driver which the 
current standard EH can't handle.  Although I haven't looked at all 
drivers yet and some of them may indeed need such specialized 
implementation.

I think it boils down to the fact that the core EH is more about ATA 
devices than it's about controllers.  Controllers vary from one another 
but ATA/ATAPI devices are the same old ATA/ATAPI devices whatever the 
controller is.  So, as long as LLD has a way to feed enough information 
to core EH about the state of the attached device && core EH's 
controller interface (freeze, thaw & resets) fits the controller to 
acceptable degree, core EH doesn't have to be different across different 
LLDs.

IMHO, it's best to keep single unified implementation until it begins to 
pick up many special cases to deal with specific LLDs.  I think we're 
still in the safe regarding that.  If we pass that point, I think we 
should start by implementing private drive routines in LLDs before 
making core EH programmable.  After several such tries, the requirements 
for programmable EH would be much clearer and we would be able to do 
much better job of implementing something which is flexible enough but 
still as simple as possible.

To sum up...

* Until now, unified EH seems good enough.  In fact, not a single driver 
needs to go further than calling ata_do_eh() w/ proper callbacks.

* I agree that it would be nice to have programmable EH, but let's do it 
when it's actually needed.  It seems that early implementation of 
complex infrastructure seldom ends up in something pleasant to look at.

Thanks.

-- 
tejun

  reply	other threads:[~2006-06-14 15:02 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 15:50 [PATCHSET] new Power Management for libata Tejun Heo
2006-06-12 15:50 ` [PATCH 02/10] libata: kill per-device PM Tejun Heo
2006-06-12 15:50 ` [PATCH 04/10] libata: update ata_do_simple_cmd() Tejun Heo
2006-06-12 15:50 ` [PATCH 01/10] libata: power down controller only on PMSG_SUSPEND Tejun Heo
2006-06-12 16:32   ` Jeff Garzik
2006-06-13  2:20     ` Tejun Heo
2006-06-12 15:50 ` [PATCH 03/10] libata: move ata_do_simple_cmd() right below ata_exec_internal() Tejun Heo
2006-06-12 15:50 ` [PATCH 07/10] sata_sil: separate out sil_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 05/10] libata: implement new EH action ATA_EH_SPINUP Tejun Heo
2006-06-14  1:18   ` Jeff Garzik
2006-06-14 15:02     ` Tejun Heo [this message]
2006-06-14 15:25       ` Alan Cox
2006-06-12 15:50 ` [PATCH 06/10] libata: implement new Power Management framework Tejun Heo
2006-06-12 16:34   ` Alan Cox
2006-06-13  2:08     ` Tejun Heo
2006-06-13  6:25   ` zhao, forrest
2006-06-13  8:56     ` Tejun Heo
2006-06-13 11:59       ` Jeff Garzik
2006-06-13  8:17   ` zhao, forrest
2006-06-13  9:00     ` Tejun Heo
2006-06-13  8:54       ` zhao, forrest
2006-06-13  9:15         ` Tejun Heo
2006-06-13  8:37   ` zhao, forrest
2006-06-14  7:56   ` zhao, forrest
2006-06-14 13:29     ` Tejun Heo
2006-06-15  1:33       ` zhao, forrest
2006-06-15  3:41         ` Tejun Heo
2006-06-12 15:50 ` [PATCH 09/10] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 10/10] sata_sil24: add suspend/sleep support Tejun Heo
2006-06-12 15:50 ` [PATCH 08/10] sata_sil: " Tejun Heo
2006-06-12 15:57 ` [PATCHSET] new Power Management for libata Tejun Heo
2006-06-13  6:28 ` zhao, forrest
2006-06-13  9:09 ` rolled up patch for " Tejun Heo
2006-06-13 10:38   ` Jens Axboe
2006-06-19  5:46     ` Jens Axboe
2006-06-14  1:25 ` [PATCHSET] " Jeff Garzik
2006-06-14 13:46   ` Tejun Heo
2006-06-19  5:18     ` zhao, forrest
2006-06-19  8:46       ` 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=44902511.2040102@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).