[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0904071107500.27889@localhost.localdomain>
Date: Tue, 7 Apr 2009 11:18:01 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Jeff Garzik <jeff@...zik.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>,
Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [GIT PULL] Ext3 latency fixes
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..
Linus
---
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -769,7 +769,14 @@ static inline int ata_id_is_cfa(const u16 *id)
static inline int ata_id_is_ssd(const u16 *id)
{
- return id[ATA_ID_ROT_SPEED] == 0x01;
+ int len;
+ const char *model;
+
+ if (id[ATA_ID_ROT_SPEED] == 0x01)
+ return 1;
+ model = (const char *)&id[ATA_ID_PROD];
+ len = strnlen(model, ATA_ID_PROD_LEN);
+ return len > 3 && !memcmp(model+len-3, "SSD", 3);
}
static inline int ata_drive_40wire(const u16 *dev_id)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists