small ata driver enhancement project for someone
Greg Freemyer
greg.freemyer at gmail.com
Mon Jan 3 16:05:58 EST 2011
All,
Please ignore. the code is there (see ata_id_rotation_rate()), I just
missed it somewhere along the line.
I'm still walking thru it, so I'm not sure of the details.
=== detail if you care
The most recent update is for 2.6.37 and it introduced the first quirk.
eg. The new flag is ATA_HORKAGE_NONROT which indicates a pre-ATA8
device that is a SSD.
http://patchwork.ozlabs.org/patch/63414/
In theory, SSDs should report ATA8 and use field 217 as I said. That
logic is also already present.
But it looks to me that ata_id_rotation_rate() is trusting that field
for ATA7 as well, which I don't understand.
Also, it seems to be reported to userspace through a SCSI command
simulation, which is probably fine, but I was looking for it in
/sys/block. To me it seems inconsistent to have the topology abi in
/sys/block, but the rotating vs. ssd abi via a scsi command emulation.
:(
Greg
On Mon, Jan 3, 2011 at 2:21 PM, Greg Freemyer <greg.freemyer at gmail.com> wrote:
> 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
>
--
Greg Freemyer
Head of EDD Tape Extraction and Processing team
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
CNN/TruTV Aired Forensic Imaging Demo -
http://insession.blogs.cnn.com/2010/03/23/how-computer-evidence-gets-retrieved/
The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com
More information about the Kernelnewbies
mailing list