diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-05-15 00:40:35 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-05-15 14:14:56 -0400 |
commit | 4bca3286433585b5f1c3e7d8ac37a2f4b3def9ca (patch) | |
tree | 54188630bb30858acf409df5bd07b7f31bf575ec /drivers | |
parent | 61d79a8eb362f826a002d3d14c4f9a070a818542 (diff) |
libata: Media rotation rate and form factor heuristics
This patch provides new heuristics for parsing both the form factor and
media rotation rate ATA IDENFITY words.
The reported ATA version must be 7 or greater and the device must return
values defined as valid in the standard. Only then are the
characteristics reported to SCSI via the VPD B1 page.
This seems like a reasonable compromise to me considering that we have
been shipping several kernel releases that key off the rotation rate bit
without any version checking whatsoever. With no complaints so far.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-scsi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index d1718a1f278a..342316064e9f 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2142,13 +2142,14 @@ static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf) | |||
2142 | 2142 | ||
2143 | static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf) | 2143 | static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf) |
2144 | { | 2144 | { |
2145 | int form_factor = ata_id_form_factor(args->id); | ||
2146 | int media_rotation_rate = ata_id_rotation_rate(args->id); | ||
2147 | |||
2145 | rbuf[1] = 0xb1; | 2148 | rbuf[1] = 0xb1; |
2146 | rbuf[3] = 0x3c; | 2149 | rbuf[3] = 0x3c; |
2147 | if (ata_id_major_version(args->id) > 7) { | 2150 | rbuf[4] = media_rotation_rate >> 8; |
2148 | rbuf[4] = args->id[217] >> 8; | 2151 | rbuf[5] = media_rotation_rate; |
2149 | rbuf[5] = args->id[217]; | 2152 | rbuf[7] = form_factor; |
2150 | rbuf[7] = args->id[168] & 0xf; | ||
2151 | } | ||
2152 | 2153 | ||
2153 | return 0; | 2154 | return 0; |
2154 | } | 2155 | } |