problems with AHCI on FreeBSD 8.2

Victor Balada Diaz victor at
Wed Feb 15 16:50:52 UTC 2012

On Tue, Feb 14, 2012 at 04:42:47PM -0700, Scott Long wrote:
> On Feb 14, 2012, at 4:34 PM, Victor Balada Diaz wrote:
> > On Tue, Feb 14, 2012 at 03:09:58PM -0800, Jeremy Chadwick wrote:
> >> I took a stab at this, but I don't feel confident this is the proper
> >> solution/method.  I worry there's some sort of chicken-or-the-egg
> >> condition here (quirk setup/matching comes *after* SATA capabilities
> >> detection), or that it makes the code messier.  Need mav@'s
> >> recommendations on this.
> >> 
> >> Below is for RELENG_8.  I should note I haven't tested if this works, or
> >> even compiles -- normally I don't provide such patches without testing
> >> so I apologise in advance / user beware.
> > 
> > You're amazingly fast. Thanks for all your help :)
> > 
> > You start applying the quirks before 
> > 
> >        snprintf(announce_buf, sizeof(announce_buf),
> >            "", periph->unit_number);
> >        quirks = softc->quirks;
> >        TUNABLE_INT_FETCH(announce_buf, &quirks);
> > 
> > So you're breaking quirk setting at boot time.
> > 
> > See my attached patch. I can confirm it works for me.
> > 
> > Regards.
> > 
> I don't think that disabling NCQ entirely is the right solution.  It's a tag starvation issue in the firmware, not a complete failure, and it can be dealt with in the CAM XPT scheduler fairly efficiently.  Alexander and I talked about this recently, and though we differ on the details, a tag hack is not in order, IMHO.  In the short term, try just using "cam control tags ada0 -N 1" to limit the concurrent commands to 1.
> Scott

Seems changing tags on both disks doesn't fix the issue:

(ada0:ahcich0:0:0:0): Request requeued
(ada0:ahcich0:0:0:0): Retrying command
ahcich1: Timeout on slot 0
ahcich1: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd c0 serr 00000000
ahcich1: AHCI reset...
ahcich1: SATA connect time=0ms status=00000123
ahcich1: ready wait time=18ms
ahcich1: AHCI reset done: device found
(ada1:ahcich1:0:0:0): Request requeued
(ada1:ahcich1:0:0:0): Retrying command
(ada1:ahcich1:0:0:0): Command timed out
(ada1:ahcich1:0:0:0): Retrying command
ahcich0: Timeout on slot 30
ahcich0: is 00000000 cs c0000000 ss 00000000 rs c0000000 tfd c0 serr 00000000
ahcich0: AHCI reset...
ahcich0: SATA connect time=0ms status=00000123
ahcich0: ready wait time=18ms
ahcich0: AHCI reset done: device found

The only difference is that now i get "Request requeued" message.

La prueba más fehaciente de que existe vida inteligente en otros
planetas, es que no han intentado contactar con nosotros. 

More information about the freebsd-stable mailing list