small ata driver enhancement project for someone

Greg Freemyer greg.freemyer at gmail.com
Mon Jan 3 14:21:56 EST 2011


All,

I don't think the kernel is yet tracking SSD vs Rotational.

It would be a nice patch if someone would do that.  I don't maintain
the subsystem, but I assume it would be accepted if well done.  You
could model your patch by looking at how the drive topology patches
were done.  Effectively this patch would do the same thing.

(Petersen wrote those, so I think these are them:
http://markmail.org/message/azj3z4tofrknnbbe)

My thoughts:

===> How to tell

For SATA:

Per T13/1699-D Revision 4a (from May 2007) word 217 of the identify
block should be populated with a "1" to identify non-rotating media.

http://www.t13.org/Documents/UploadedDocuments/docs2007/D1699r4a-ATA8-ACS.pdf

IIRC: The identify block is read during drive query time, so you
should not have to actually generate any i/o.  Just patch the portion
of the kernel working with the identify block.  ie. See the topology
patch.

For SCSI - no idea, but I'd be surprised if they did not already have
a scsi flag for it.  The topology patch also handled SCSI, so it's
just a matter of finding the scsi field to use.

===> Quirks

Lots of manufacturers don't follow the specs on something like this,
so a quirks functionality is typically how the ATA driver handles it.
ie. If you find a SSD that is not setting the flag, then setup a quirk
to override the flag.  The quirk table should be based on make & model
at a minimum, and maybe firmware.

You should be able to find existing quirk logic, so don't invent your own.

SCSI seems to be followed much more accurately, so you may not need a
quirks functionality for it.

===> userspace API

Seems like there should be a "/sys/block/sda/*" file that allows
userspace to interrogate.  The topology patches added a few of these,
so one more would be good.

If you can generate the same data for scsi, maybe just create
/sys/block/sda/rotation_speed and have it just reflect exactly word
217 of the identify block.

Greg



More information about the Kernelnewbies mailing list