Subject: Re: powerhooks and SCSI disks
To: Jason Thorpe <thorpej@shagadelic.org>
From: Michael Lorenz <macallan@netbsd.org>
List: tech-kern
Date: 12/16/2005 12:36:15
--Signature_Fri__16_Dec_2005_12_36_15_-0500_Uckg3+rs/LE8Ydhj
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> > I'm currently looking for ways to improve power management on
> > SPARCbooks, mainly adding things like some sort of standby mode, =20
> > turning off unused peripherals and so on. We can for instance turn
> > off power for the internl SCSI disk ( in case a drive wouldn't
> > honour a motor stop command ) So, I have a few questions:
>=20
> What drive would not honor a STOP command?  Seems broken... anyway...

Well, different SPARCbooks use either small SCSI drives or several
different SCSI-to-IDE adaptors, mine has an adaptor and a Toshiba
drive. It spins down after a scsictl sd0 stop but I think there's a
reason why Tadpole added hardware to physically power down the drive.

> > - are there any objections against adding a power hook to sd so it =20
> > would flush the drive's cache before we're going to remove power?
>=20
> This seems like a fine thing to do.

Ok, so the initial version of the hook function would just call
sd_shutdown() when we're going into suspend or standby and do nothing on
resume.

> > - is there anything to do after turning the drive back on to resume
> >   operation?
>=20
> I can't think of anything special.
>=20
> One thing you might want to make sure of is that our SCSI I/O path =20
> can handle the case where a command fails BECAUSE the drive is not =20
> spinning, and can recover by issuing a START command to the drive.

Not quite sure - scsictl sd0 stop works as expected and when there's
something to do the drive just spins up again. Not sure if it got a
START or if it just spun up on its own.

Hmm, should I issue STOP resp. START commands in the powerhook ( and
keep a status bit to avoid confusion ) or is that a Bad Idea?

have fun
Michael

--Signature_Fri__16_Dec_2005_12_36_15_-0500_Uckg3+rs/LE8Ydhj
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQ6L7D8pnzkX8Yg2nAQKdFwf/cGfwmeIo8bk7gEr03q2m4SEy6zwVA2Yr
BDTUAX00+6bc074cCdEPcpMkV8bEEDA24Q/7IgmvmT5hZ2C79a22j1HRoosyna20
vw2Esyl/ieWRObYQwQrMe98x6U8mgTh84autOeotUiyDnD7zrnI3RlGFggTf54eE
U67UwQGMfpQlhSeDh8HImYIprkx7HhciMiVJr4wGq0+L+fOmQauNscR/EKdtpSYO
T1MPCNbhE13g+N4lGOvoGqWSFObALqX6Co6XRScNkkNLFQIETdL6qn353BixxHjt
sC1DrqDVYCDkTARZzJZ7CsVHGfrRjWToGX6bmRy7lIMvdy7rk6FJjg==
=Ntcd
-----END PGP SIGNATURE-----

--Signature_Fri__16_Dec_2005_12_36_15_-0500_Uckg3+rs/LE8Ydhj--