linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Christian Mueller <Christian.Mueller@wdc.com>,
	Bruce Allen <ballen@gravity.phys.uwm.edu>,
	Smartmontools Mailing List
	<smartmontools-support@lists.sourceforge.net>,
	LKML <linux-kernel@vger.kernel.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [smartmontools-support] inactive SATA drives won't stay in standby or sleep, PATA models did. (fwd)
Date: Tue, 21 Oct 2008 18:02:08 +0900	[thread overview]
Message-ID: <48FD9A90.8000205@gmail.com> (raw)
In-Reply-To: <18685.35653.125899.390135@harpo.it.uu.se>

Hello,

Mikael Pettersson wrote:
> Tejun Heo writes:
>  > Hello, Mikael.
>  > I would put this into ->hardreset itself as the controller can also
>  > get out of sync with reality during reset.
> 
> The only thing I see going on between prereset and (hard/soft)reset
> is an optional freeze, so I don't see why moving the pdc_reset_port()
> into the beginning of hardreset() would make any difference.
> 
> sata_promise currently uses the ->hardreset and ->softreset inherited
> from ata_sff_port_ops, so it would need to override both to ensure that
> we always do pdc_reset_port() before libata does its thing. That's why
> I felt doing that in ->prereset would be the right solution.

Hmm.. reset sequence goes on like the following.

 1. prereset
 2. hardreset, if fail, retry
 3. follow-up softreset if requested, if fail, goto #2
 4. postreset, if successful

So, if some PHY event happens while the reset is waiting for device
readiness and makes the controller state go out of sync with the
drive.  ->prereset() will NOT be called for the following retry.

As a rule, ->hardreset should be able to reset the controller from all
possible situations.  ->prereset can be used to smooth out initial
reset tries (ie. during initial probing, waiting for device readiness
before SRST for SFF controllers w/o hardreset) but at best its
function is advisory.  When things go wrong, ->hardreset should be
able to provide solution whatever state the controller is in.

If both hard and soft resets work better with the controller reset
added, I think it would be best to override both.

Thanks.

-- 
tejun

  reply	other threads:[~2008-10-21  9:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <D73D40172004714D95D7A84AC3E68EC802282133@wdscexbe03.sc.wdc.com>
2008-10-08  0:28 ` [smartmontools-support] inactive SATA drives won't stay in standby or sleep, PATA models did. (fwd) Tejun Heo
2008-10-12 14:55   ` Mikael Pettersson
2008-10-13  5:16     ` Tejun Heo
2008-10-13  7:03       ` Mikael Pettersson
2008-10-13  7:08         ` Tejun Heo
2008-10-19 23:40       ` Mikael Pettersson
2008-10-21  4:18         ` Tejun Heo
2008-10-21  7:56           ` Mikael Pettersson
2008-10-21  9:02             ` Tejun Heo [this message]
2008-10-21  9:30               ` Mikael Pettersson
2008-10-21  7:59         ` Mikael Pettersson
2008-10-21  8:55           ` 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=48FD9A90.8000205@gmail.com \
    --to=htejun@gmail.com \
    --cc=Christian.Mueller@wdc.com \
    --cc=ballen@gravity.phys.uwm.edu \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=smartmontools-support@lists.sourceforge.net \
    /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).