linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Mark Lord <liml@rtr.ca>
Cc: Tejun Heo <htejun@gmail.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH/RFC]: recovery from power-up-in-standby feature
Date: Sun, 04 Mar 2007 18:37:09 -0500	[thread overview]
Message-ID: <45EB5825.501@garzik.org> (raw)
In-Reply-To: <45EB2F6D.7050407@rtr.ca>

Mark Lord wrote:
> ATA/SATA drives can be set to not spinup automatically at power-on,
> for use in staggered spin-up applications where frying power supplies
> is to be avoided.
> 
> These drives may return incomplete IDENTIFY responses
> until they have been spun-up first by the device driver.
> 
> There are two ways this happens, and the drive lets us know
> which it expects based on the initial, partial IDENTIFY response.
> 
> (1) The old method (34GB WD Raptor drives) will spin up on receipt of
> any media-access command.  The trick here being, we that don't have
> full IDENTIFY info to properly issue just *any* media command,
> so this has to be controlled carefully.
> 
> (2) The more common method is for the drive to require an explicit
> set-features "spin-up" subcommand after the IDENTIFY.
> 
> The patch below implements the latter method (tested, works for me).

I think we would want to test bit 6 of IDENTIFY DEVICE word 83, issue 
SET FEATURES - SPIN UP command if set, otherwise do a READ VERIFY or 
some other media access command.


> But as you can see, there is an "#if 0 FIXME" section around
> the code which attempts to deal with the "spin up on any media access"
> variant of this protocol.  That code just doesn't work for me,
> and I'm hoping Jeff/Tejun might be able to point out where it's gone silly.
> +#if 0
> +    /*
> +     * FIXME: this always fails with AC_ERR_DEV,
> +     * even when issued on a spun-up drive
> +     * (accomplished by commenting out the if-stmt below).
> +     *
> +     * What's wrong here???
> +     */
> +    if (!tried_spinup && id[2] == 0x8c73)
> +    {
> +        tried_spinup = 1;
> +        /*
> +         * Drive powered up in standby mode, and returned only
> +         * partial IDENTIFY data.  This requires a media access
> +         * command (to force a spin-up) before the drive can
> +         * return a complete set of IDENTIFY data.
> +         * Here, we use READ_VERIFY(LBA=0) to force the spin-up.
> +         */

ata_exec_internal() passes ATA_QCFLAG_RESULT_TF to the queued cmd.  So, 
what values are returned by the device in the taskfile registers?

AC_ERR_DEV means the command made it all the way to the device, which 
then spit back the command with ERR=1 in the Status shadow register.

	Jeff



  parent reply	other threads:[~2007-03-04 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-04 20:43 [PATCH/RFC]: recovery from power-up-in-standby feature Mark Lord
2007-03-04 22:32 ` Alan Cox
2007-03-04 22:04   ` Mark Lord
2007-03-04 23:37 ` Jeff Garzik [this message]
2007-03-05  3:55   ` Mark Lord

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=45EB5825.501@garzik.org \
    --to=jeff@garzik.org \
    --cc=htejun@gmail.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    /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).