Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2013 13:19:32 -0800
From:      Jeremy Chadwick <jdc@koitsu.org>
To:        Michael BlackHeart <amdmiek@gmail.com>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: Old ICH7 SATA-2 question
Message-ID:  <20130223211932.GA41809@icarus.home.lan>
In-Reply-To: <CA%2BAz77OiEauxDK_73NgZgbJCk0HHfmALywS4ZQ3KwQiiuyGDiQ@mail.gmail.com>
References:  <CA%2BAz77OiEauxDK_73NgZgbJCk0HHfmALywS4ZQ3KwQiiuyGDiQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 24, 2013 at 12:46:43AM +0400, Michael BlackHeart wrote:
> Hello there, I've got a question about SATA.
> 
> I've got ASUS P5GC-MX/1333 with ICH7. (SATA2 support)
> A few HDD with SATA2.
> 
> system:
> uname -a
> FreeBSD diablo.miekoff.local 9.1-STABLE FreeBSD 9.1-STABLE #1 r246666:
> Tue Feb 12 00:19:07 MSK 2013
> root@diablo.miekoff.local:/usr/obj/usr/src/sys/DIABLO64  amd64
> 
> 
> camcontrol info
> 
> camcontrol iden ada2
> pass2: <ST3500320AS SD1A> ATA-8 SATA 2.x device
> pass2: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
> 
> protocol              ATA/ATAPI-8 SATA 2.x
> device model          ST3500320AS
> firmware revision     SD1A
> serial number         5QM3LB0N
> WWN                   5000c50011db1e03
> cylinders             16383
> heads                 16
> sectors/track         63
> sector size           logical 512, physical 512, offset 0
> LBA supported         268435455 sectors
> LBA48 supported       976773168 sectors
> PIO supported         PIO4
> DMA supported         WDMA2 UDMA6
> media RPM             7200
> 
> Feature                      Support  Enabled   Value           Vendor
> read ahead                     yes      yes
> write cache                    yes      yes
> flush cache                    yes      yes
> overlap                        no
> Tagged Command Queuing (TCQ)   no       no
> Native Command Queuing (NCQ)   yes              32 tags
> SMART                          yes      yes
> microcode download             yes      yes
> security                       yes      no
> power management               yes      yes
> advanced power management      no       no
> automatic acoustic management  no       no
> media status notification      no       no
> power-up in Standby            no       no
> write-read-verify              yes      yes     2/0x2
> unload                         no       no
> free-fall                      no       no
> data set management (TRIM)     no

The "protocol" line in camcontrol identify output indicates the maximum
capability the device can support, not what the current negotiated PHY
speed is.  Let me clarify by being more technical:

"camcontrol identify" issues the ATA IDENTIFY (0xec) command to the
underlying disk; all the output you get back is information that the
disk itself returns (not the controller).  For example, SATA signalling
speed capability is returned in word 76 of the output (ref T13/2015-D
rev 3 WD spec).

> smartctl -a /dev/ada2 | more
> smartctl 6.0 2012-10-10 r3643 [FreeBSD 9.1-STABLE amd64] (local build)
> Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org
> 
> === START OF INFORMATION SECTION ===
> Model Family:     Seagate Barracuda 7200.11
> Device Model:     ST3500320AS
> Serial Number:    5QM3LB0N
> LU WWN Device Id: 5 000c50 011db1e03
> Firmware Version: SD1A
> User Capacity:    500 107 862 016 bytes [500 GB]
> Sector Size:      512 bytes logical/physical
> Rotation Rate:    7200 rpm
> Device is:        In smartctl database [for details use: -P show]
> ATA Version is:   ATA8-ACS T13/1699-D revision 4
> SATA Version is:  SATA 2.6, 3.0 Gb/s
> Local Time is:    Sun Feb 24 00:29:47 2013 MSK
> SMART support is: Available - device has SMART capability.
> SMART support is: Enabled

The "SATA Version is" line in smartmontools 6.0 can indicate both
operational PHY speed **as well** as disk capability.

For example, a drive which has SATA600 capability but has negotiated
SATA300 speed will show something like this:

SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)

Lines lacking "(current: xxx)" notation indicate either lack of a way to
determine current PHY speed with the OS, or, the maximum capability matches
the negotiated speed.  In other words, there's no point to saying
something like "SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)"; the author
feels its redundant.

However, I have seen this reporting mechanism in smartmontools work
incorrectly in some cases.  In those cases, from what I've seen, the
"SATA Version" line indicates **only** what the maximum capability is
of the device.

> At this point all seems SATA2 capatible.
> 
> But at loading:
> atapci0: <Intel ICH7 UDMA100 controller> port
> 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on
> pci0
> ata0: <ATA channel> at channel 0 on atapci0
> atapci1: <Intel ICH7 SATA300 controller> port
> 0xb800-0xb807,0xb400-0xb403,0xb000-0xb007,0xa800-0xa803,0xa400-0xa40f
> irq 23 at device 31.2 on pci0
> ata2: <ATA channel> at channel 0 on atapci1
> ata3: <ATA channel> at channel 1 on atapci1
> 
> Looks like it's also SATA2 (SATA300)

Your ICH7 controller is SATA300 capable.  However, what you have not
provided is output from "pciconf -lvbc".  The exact revision of
controller matters greatly here.  Wikipedia sums this up -- read the
first paragraph fully:

http://en.wikipedia.org/wiki/I/O_Controller_Hub#ICH7

> But HDD says this:
> 
> ada2 at ata2 bus 0 scbus1 target 0 lun 0
> ada2: <ST3500320AS SD1A> ATA-8 SATA 2.x device
> ada2: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
> ada2: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
> ada2: Previously was known as ad2

To me, this indicates the ada2 device is capable of SATA300 speeds
("SATA 2.x device"), but has negotiated SATA150 speed.

The ST3500320AS is a model of hard disk which also has a jumper that can
limit the drive controller PHY to SATA150; please see page 22 of this
PDF:

http://www.seagate.com/staticfiles/support/disc/manuals/desktop/Barracuda%207200.11/100452348g.pdf

You will need to check to see if that jumper is installed.

This particular model of disk will never exceed SATA150 speeds, so there
is no reliable way to test what the actual PHY is operating at
(throughput-wise).

At this point, the only "mismatch" I can see is between smartmontools
and what dmesg shows.  As mentioned, I have seen smartmontools get this
wrong.

> At this point I've a quiestion - what's the real operation speed and why's that.
> And for the record - I can't switch ICH 7 to ahci due to bios limitations.

It may not be a BIOS limitation but revision of ICH7 chipset.  There are
some revisions which offer AHCI capability, others which offer AHCI and
RAID, and others which offer none of these.  Which revision your vendor
chose to put on their mainboard is up to them.

> And one more, I've got netbook with ICH7 (NM-10 mb).
> It uses achi driver, and HDD says it's
> 
> ahci0: <Intel ICH7 ACHI SATA controller> <...>
> ahic0: AHCI v1.10 with 4 3Gbs ports <...>
> <...>
> ada0: <vendor blah-blah-blah> ATA-8 SATA 2.x device
> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
> ada0: Command Queueing enabled

This disk (no idea if it's the same disk as what you listed above; you
have opted to hand-type information and exclude things) is SATA300
capable and is operating at SATA300 speed.

Again: no "pciconf -lvbc" output means nobody can tell you what revision
of ICH7 you're using on this (different) system.

But regardless, it's obvious that the two systems use different ICH7
revisions.  There is nothing you can do about that.

> As far as I remember without AHCI there's no NCQ support.

For ICHxx-based controllers that's correct.

> But why with SATA300 controller on P5GC-MX/1333 I've got only 150
> transfers? Is it's a limitations of this driver for old chip?

See above.

-- 
| Jeremy Chadwick                                   jdc@koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Mountain View, CA, US                                            |
| Making life hard for others since 1977.             PGP 4BD6C0CB |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130223211932.GA41809>