Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2011 16:19:55 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Nikolay Denev <ndenev@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r218596 - head/sys/dev/ahci
Message-ID:  <4D56970B.3030609@FreeBSD.org>
In-Reply-To: <B7AF5EEA-24AD-4D83-9520-65199CA00B05@gmail.com>
References:  <201102120706.p1C76eLP088428@svn.freebsd.org> <B7AF5EEA-24AD-4D83-9520-65199CA00B05@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nikolay Denev wrote:
> On 12 Feb, 2011, at 09:06 , Alexander Motin wrote:
>> Author: mav
>> Date: Sat Feb 12 07:06:40 2011
>> New Revision: 218596
>> URL: http://svn.freebsd.org/changeset/base/218596
>>
>> Log:
>>  Disable NCQ for multiport Marvell 88SX61XX SATA controllers. Simultaneous
>>  active I/O to several disks (copying large file on ZFS) causes timeout after
>>  just a few seconds of run. Single port 88SX6111 seems like not affected.
>>
>>  Skip reading transferred bytes count for these controllers. It works for
>>  88SX6111, but 88SX6145 always returns zero there. Haven't tested others,
>>  but better to be safe.
>>
>> Modified:
>>  head/sys/dev/ahci/ahci.c
> 
> I was using Marvell 6121 for quite some time with OCZ Throttle eSATA 8G flash drive for zfs l2arc,
> but the timeouts were not there from the beginning. Maybe NCQ was not enabled in earlier drivers?
> Also there is no other drive/ssd attached to the controller, the OCZ drive reports that it supports 2 tag openings.
> 
> atapci2@pci0:4:0:0:	class=0x01018f card=0x612111ab chip=0x612111ab rev=0xb2 hdr=0x00
>     vendor     = 'Marvell Semiconductor (Was: Galileo Technology Ltd)'
>     device     = '6121 SATA2 Controller'
>     class      = mass storage
>     subclass   = ATA
>     bar   [10] = type I/O Port, range 32, base 0xbf00, size  8, enabled
>     bar   [14] = type I/O Port, range 32, base 0xbe00, size  4, enabled
>     bar   [18] = type I/O Port, range 32, base 0xbd00, size  8, enabled
>     bar   [1c] = type I/O Port, range 32, base 0xbc00, size  4, enabled
>     bar   [20] = type I/O Port, range 32, base 0xbb00, size 16, enabled
>     bar   [24] = type Memory, range 32, base 0xfb9ff000, size 1024, enabled
>     cap 01[48] = powerspec 2  supports D0 D1 D3  current D0
>     cap 05[50] = MSI supports 1 message 
>     cap 10[e0] = PCI-Express 1 legacy endpoint max data 128(128) link x1(x1)
> ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected

I can't see here whether you are using ahci(4) or ataahci from ata(4).
In last case (from the beginning) there is no NCQ by definition.

If you are using ahci(4), and 2 tags you are talking about were reported
by `camcontrol tags ...`, then quite likely your device doesn't support
NCQ at all, but CAM submits two command at a time to the queue-aware
controller just to hide some inter-request latencies.

If both device and controller support NCQ, you should see such message
during probe:
ada0: Command Queueing enabled

PS: I can't confirm that problem exist on 88SX6121 -- I have no such
hardware. But I have seen user complaining about it and that is what
Linux also does.

-- 
Alexander Motin



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