linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: "kernel.majianpeng" <kernel.majianpeng@gmail.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: sata disk model/firmware length smaller
Date: Thu, 06 Jan 2011 11:34:08 -0500	[thread overview]
Message-ID: <4D25EF00.7020301@interlog.com> (raw)
In-Reply-To: <201101061538027183872@gmail.com>

On 11-01-06 02:38 AM, kernel.majianpeng wrote:
>
> At present,I using WD SATA disk:
> [root@kedacom device]# smartctl -i /dev/sdo
> smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
> Home page is http://smartmontools.sourceforge.net/
> === START OF INFORMATION SECTION ===
> Device Model:     WDC WD2003FYYS-02W0B0
> Serial Number:    WD-WMAY00749168
> Firmware Version: 01.01D01
> User Capacity:    2,000,398,934,016 bytes
> Device is:        Not in smartctl database [for details use: -P showall]
> ATA Version is:   8
> ATA Standard is:  Exact ATA specification draft version not indicated
> Local Time is:    Thu Jan  6 15:12:37 2011 UTC
> SMART support is: Available - device has SMART capability.
> SMART support is: Enabled
> [root@kedacom device]# cat /sys/block/sdo/device/rev
> 01.0
> [root@kedacom device]# cat /sys/block/sdo/device/model
> WDC WD2003FYYS-0
> I read ATA spec7, The INQUERY DEVICE command return valued:
> Firmware revision 8byte
> Model Number 40byte
>
> This may be a bug?

Not our bug. There is a size mismatch between the
ATA 'firmware revision' field (8 bytes) and the
SCSI 'product revision level' field (4 bytes). Given
the mappings defined in the SAT and SAT-2 standards
when an ATA device is being viewed via a SCSI INQUIRY
command only the first 4 bytes of the revision field
are taken.

A compliant SAT layer should support the ATA Information
VPD page which is accessed via the SCSI INQUIRY command
with the EVPD bit set. libata does this:

# sg_inq /dev/sda
standard INQUIRY:
   PQual=0  Device_type=0  RMB=0  version=0x05  [SPC-3]
   [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
   SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  BQue=0
   EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
   [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=0
   [SPI: Clocking=0x0  QAS=0  IUS=0]
     length=96 (0x60)   Peripheral device type: disk
  Vendor identification: ATA
  Product identification: INTEL SSDSA2M080
  Product revision level: 2CV1
  Unit serial number: xxxxxx

# sg_vpd -p ai /dev/sda
ATA information VPD page:
   SAT Vendor identification: linux
   SAT Product identification: libata
   SAT Product revision level: 2CV1
   ATA command IDENTIFY DEVICE response summary:
     model: INTEL SSDSA2M080G2GC
     serial number: xxxxxx
     firmware revision: 2CV102HD

The whole of an ATA disk's IDENTIFY DEVICE response (512
bytes) is available in the SCSI ATA Information VPD page.

Doug Gilbert

      parent reply	other threads:[~2011-01-06 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06  7:38 sata disk model/firmware length smaller kernel.majianpeng
2011-01-06  8:23 ` Stefan /*St0fF*/ Hübner
2011-01-06 16:34 ` Douglas Gilbert [this message]

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=4D25EF00.7020301@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=kernel.majianpeng@gmail.com \
    --cc=linux-scsi@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).