[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49DBAC42.4040003@garzik.org>
Date: Tue, 07 Apr 2009 15:40:50 -0400
From: Jeff Garzik <jeff@...zik.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Arjan van de Ven <arjan@...radead.org>, Mark Lord <lkml@....ca>,
Theodore Tso <tytso@....edu>,
Jens Axboe <jens.axboe@...cle.com>,
Linux Kernel Developers List <linux-kernel@...r.kernel.org>,
Linux IDE mailing list <linux-ide@...r.kernel.org>
Subject: [PATCH libata: add SSD detection hueristic; move SSD setup to ata_dev_configure
(was Re: [GIT PULL] Ext3 latency fixes)
Linus Torvalds wrote:
>
> On Mon, 6 Apr 2009, Jeff Garzik wrote:
>
>> Arjan van de Ven wrote:
>>> On Sun, 05 Apr 2009 16:57:21 -0400
>>> Jeff Garzik <jeff@...zik.org> wrote:
>>>> We set it in libata-scsi.c:ata_scsi_dev_config() based on
>>>> ata_id_is_ssd()
>>>>
>>>> That hueristic probably assumes Intel SSDs or something :/
>>> you mean the "rpm" set to '1' ?
>>> I was pretty sure that that was industry standard...
>> A -new- industry standard. You can certainly create a compliant SSD while
>> only conforming to ATA-7, for example. Some older IDE flash devices pretend
>> they are normal hard drives in almost every respect, too.
>
> Something like this might be a good idea.
>
> I've seen several SSD's that do _not_ do that whole RPM == 1 thing, but
> they have "SSD" in their names.
>
> I forget how the ID is stored (I have this memory of it being big-endian
> 16-bit words or something crazy like that?), but aside from fixing up that
> kind of crazyness, maybe something like this is worth it?
>
> And making it non-inline, of course. And maybe it should use 'strstr()'
> instead of checking whether the name ends in 'SSD'. You get the idea..
ata_id_string() or ata_id_c_string() is what you want.
But yeah, we see what you're trying to illustrate.
For internal reasons, it is better to detect and set up SSD details in
ata_dev_configure(), where we detect and configure other ATA details.
I've attached an example patch, compiled-tested only.
If we wanted to get more fancy, we could extend the strn_pattern_cmp()
function in libata to accept wildcard '*' prefixes, as well as suffixes.
That would make it easy to auto-configure future ATA devices based on
the product id (such as "G.SKILL 128GB SSD").
Jeff
View attachment "patch" of type "text/plain" (1842 bytes)
Powered by blists - more mailing lists