From: Jens Axboe <jens.axboe@oracle.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
Jeff Garzik <jgarzik@pobox.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] ata: ata_id_is_ssd() bugfix
Date: Sun, 19 Oct 2008 20:05:46 +0200 [thread overview]
Message-ID: <20081019180545.GT19428@kernel.dk> (raw)
In-Reply-To: <200810182222.13281.bzolnier@gmail.com>
On Sat, Oct 18 2008, Bartlomiej Zolnierkiewicz wrote:
> We need to explicitly check for major and minor version
> of supported ATA spec as earlier revisions used word 217
> for different purposes.
What did they use to put in that word? Just curious if it does any harm,
because as it stands, this patch will prevent ANY ssd from being
correctly flagged as such. So I'm inclined to file this as too much spec
fiddling, it'll do more harm than good.
>
> [ The issue was originally spotted by Alan Cox. ]
>
> This patch fixes regression introduced by:
> commit 8bff7c6b0f63c7ee9c5e3a076338d74125b8debb
> ("libata: set queue SSD flag for SSD devices").
>
> Cc: Jeff Garzik <jgarzik@pobox.com>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Jens Axboe <jens.axboe@oracle.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> somebody owe me one for going through all these spec drafts... ;)
>
> include/linux/ata.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> Index: b/include/linux/ata.h
> ===================================================================
> --- a/include/linux/ata.h
> +++ b/include/linux/ata.h
> @@ -75,6 +75,7 @@ enum {
> ATA_ID_EIDE_PIO_IORDY = 68,
> ATA_ID_QUEUE_DEPTH = 75,
> ATA_ID_MAJOR_VER = 80,
> + ATA_ID_MINOR_VER = 81,
> ATA_ID_COMMAND_SET_1 = 82,
> ATA_ID_COMMAND_SET_2 = 83,
> ATA_ID_CFSSE = 84,
> @@ -743,7 +744,12 @@ static inline int ata_id_is_cfa(const u1
>
> static inline int ata_id_is_ssd(const u16 *id)
> {
> - return id[ATA_ID_ROT_SPEED] == 0x01;
> + /* ATA8-ACS version 4c or higher (=> 4c or 6 at the moment) */
> + if (ata_id_major_version(id) >= 8 &&
> + (id[ATA_ID_MINOR_VER] == 0x39 || id[ATA_ID_MINOR_VER] == 0x28) &&
> + id[ATA_ID_ROT_SPEED] == 0x01)
> + return 1;
> + return 0;
Is the check even correct? It'll match version 8 AND the currently
listed minor version, not newer.
--
Jens Axboe
next prev parent reply other threads:[~2008-10-19 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-18 20:22 [PATCH] ata: ata_id_is_ssd() bugfix Bartlomiej Zolnierkiewicz
2008-10-19 18:05 ` Jens Axboe [this message]
2008-10-19 18:52 ` Bartlomiej Zolnierkiewicz
2008-10-19 19:12 ` Jens Axboe
2008-10-28 4:28 ` Jeff Garzik
2008-11-07 14:37 ` KueiHuan Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081019180545.GT19428@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bzolnier@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).