[181] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: SCSI disk SPIN-UP on pwr-up ?

daemon@ATHENA.MIT.EDU (Eric Youngdale)
Fri May 19 14:43:46 1995

From: "Eric Youngdale" <eric@aib.com>
Date: Fri, 19 May 1995 13:57:32 -0400
In-Reply-To: rob@sys3.pe1chl.ampr.org (Rob Janssen)
        "Re: SCSI disk SPIN-UP on pwr-up ?" (May 19,  1:07pm)
To: pe1chl@wab-tis.rabobank.nl, linux-scsi@vger.rutgers.edu

On May 19,  1:07pm, Rob Janssen wrote:
> Subject: Re: SCSI disk SPIN-UP on pwr-up ?
> In <blevinD8s9xG.8Aq@netcom.com> blevin@netcom.com (Bryan Levin) writes:
>
> >On many unix workstations, the scsi disks only spin up with a scsi
command.
> >As such, most hard drives (I've encountered) don't spin up until told to
do
> >so.
>
> >However, on my linux system (with pcmcia 'new media bus toaster scsi-2
card')
> >I can't get my external scsi drives to spin up.  Should they (with 1.2.8
> >kernel)?
>
> >I have no problem doing I/O with drives that DO spin-up automatically at
> >pwr-up (some are already jumpered to auto-spin up - but some don't have
any
> >docs or have NO jumpers!)

	Most scsi drives have a jumper that indicates whether the drive
should spin up at power up.  The main point of doing this is that
on large systems with lots of disks, the power supply is loaded fairly
heavily if all of the disks attempt to spin up simultanously.

	The linux kernel needs to spin up the drive because we need to
determine what the partition table looks like.  You would not know, for
example, whether a partition was invalid or not unless you did this.  Thus
the kernel has some code in there to spin the drives up one at a time.

> Hmmm strange...  I have yet to encounter a disk that cannot spin-up
> automatically at power-up.   But probably they exist, especially when
> you get your disks from systems that want no spin-up.
> (special firmware version?)
>
> >So, is the kernel supposed to send this scsi command?  I scanned the
source
> >code but only found 1 occurence of "spin up", and it looks like it
"should"
> >spin up, but I am not a linux kernel hacker ;-)


	Yes.  After we have detected the disks themselves, send the
TEST_UNIT_READY command to see whether the disk is up or not.  If not,
we send the  START_STOP command which instructs the drive to spin up.
Again, we do this one drive at a time to minimize power supply loading.

> I checked that part in hd.c and there may be a problem with it.
> At the start of the function sd_init_onedisk a comment says:
>
>   /* We need to retry the READ_CAPACITY because a UNIT_ATTENTION is
considered
>      a fatal error, and many devices report such an error just after a
scsi
>      bus reset. */
>
> But then, code has been inserted below that (and before the READ_CAPACITY)
> that does not re-try the operation.
> Probably the TEST_UNIT_READY fails with an error, and the disks are not
> spun up.
> Who added this spin-up code?  Did it work?

	I added it, but I never had a way of testing it.  Some people
reported that it worked - my guess is that if the sense code is
UNIT_ATTENTION, we just need to retry the TEST_UNIT_READY.

-Eric




-- 
"The woods are lovely, dark and deep.  But I have promises to keep,
And lines to code before I sleep, And lines to code before I sleep."

home help back first fref pref prev next nref lref last post