From owner-freebsd-current@FreeBSD.ORG  Wed Apr  3 23:38:17 2013
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 56B2A28D
 for <freebsd-current@freebsd.org>; Wed,  3 Apr 2013 23:38:17 +0000 (UTC)
 (envelope-from jdc@koitsu.org)
Received: from qmta06.emeryville.ca.mail.comcast.net
 (qmta06.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:56])
 by mx1.freebsd.org (Postfix) with ESMTP id 3873684F
 for <freebsd-current@freebsd.org>; Wed,  3 Apr 2013 23:38:17 +0000 (UTC)
Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92])
 by qmta06.emeryville.ca.mail.comcast.net with comcast
 id Kasz1l0061zF43QA6beGX6; Wed, 03 Apr 2013 23:38:16 +0000
Received: from koitsu.strangled.net ([67.180.84.87])
 by omta24.emeryville.ca.mail.comcast.net with comcast
 id KbeF1l00S1t3BNj8kbeGyr; Wed, 03 Apr 2013 23:38:16 +0000
Received: by icarus.home.lan (Postfix, from userid 1000)
 id BBB4A73A1C; Wed,  3 Apr 2013 16:38:15 -0700 (PDT)
Date: Wed, 3 Apr 2013 16:38:15 -0700
From: Jeremy Chadwick <jdc@koitsu.org>
To: Matthias Andree <mandree@FreeBSD.org>
Subject: Re: Any objections/comments on axing out old ATA stack?
Message-ID: <20130403233815.GA65719@icarus.home.lan>
References: <51536306.5030907@FreeBSD.org>
 <20130331130409.GO3178@equilibrium.bsdes.net>
 <C699FE76-B456-49C7-8D3A-DD54F98DAFC1@samsco.org>
 <515B25D8.7050902@FreeBSD.org> <515BF5AE.4050804@FreeBSD.org>
 <515CAA04.1050108@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <515CAA04.1050108@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
 s=q20121106; t=1365032296;
 bh=0vyC6baetUvnRbBry/tm2+XU83XvplLjZi9RWo9evOU=;
 h=Received:Received:Received:Date:From:To:Subject:Message-ID:
 MIME-Version:Content-Type;
 b=ltpehHQqxJkXB72KbWqSxa8JcUFm02iVaNVCkDKvxcCIMX6jlTGkTKolprPp6pK9x
 i+jl8aXt/I9Zgkv1J1XnmPEPfdlKnPwaGmsf6X2eLN/KTlRQwpmq796KuwoDpmIiKE
 GPX2ktXb37hHQLdx9GOKhCrLEhHvFiocbNAtJJWgkelEnd6UzOS/uTy4E3D0dZV7tQ
 r87gPFky5ZuOKpFdxYnjdDC6QyGZPYo2RRwu9UZHczF0AjgzbD6g5IRFid2LlOgDtR
 rCd5vfwfMewF07apl448aIXa8rpB+J5Nq98xO3TYISnjncR9i3GCjCL2jKMJXqKU2Z
 ZWkHxBZhDHGFw==
X-Mailman-Approved-At: Thu, 04 Apr 2013 04:42:10 +0000
Cc: Alexander Motin <mav@FreeBSD.org>, freebsd-current@freebsd.org,
 freebsd-stable@freebsd.org
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Apr 2013 23:38:17 -0000

On Thu, Apr 04, 2013 at 12:15:32AM +0200, Matthias Andree wrote:
> I have just sent more information to the PR at
> http://www.freebsd.org/cgi/query-pr.cgi?pr=157397
> 
> The short summary (more info in the PR) is:
> 
> - limiting tags to 31 does not help
> 
> - disabling NCQ appears to help in initial testing, but warrants more
> testing
> 
> - error happens during WRITE_FPDMA_QUEUED,

This is an NCQ-based write LBA request.  There are many non-NCQ
equivalents of this, ATA-protocol-wise (too many to list here), but the
most likely non-NCQ ATA command you'd see is WRITE_DMA48.

> - File system in question is SU+J UFS2 mounted on /usr, and I can for
> instance "rm -rf /usr/obj" or just log into GNOME and try to open a
> gnome-terminal to trigger stalls;
> 
> - Linux uses 31 tags (for different reason) and has no drive quirks, but
> a controller quirk;
> 
> for Jeremy's topic #6, regarding the ATI/AMD SB7x0 that I am using, it
> might be worthwhile investigating the AHCI_HFLAG_IGN_SERR_INTERNAL flag
> - it gets set by Linux on the SB700 that my computer is using, see
> ahci_error_intr() in libahci.h - I am not going to interpret that for
> lack of expertise, but it does affect error handling and appears to
> ignore a certain condition.

Alexander could expand on this, but the name of the flag implies that
there are certain conditions where the SATA-level SERR condition gets
ignored ("IGN").

While skimming Linux libata code and commits in the past, the only
glaringly obvious bug/issue I see is with SB600/SB700 chipsets (the
hardware revision apparently matters) and port multiplier (PMP) support
and soft resets.

Are you using a port multiplier?  I doubt it, but I have to ask.

> Why only my Samsung HDD drive triggers this but not the WD drive, I do
> not know yet.

Please provide "gpart show -p ada1" output, both here and in the PR,
if you could.

I have a gut feeling I know what the issue is (and if it is what I think
it is, it's actually happening all the time, just that NCQ exacerbates
it given how command queueing works), but I won't know for sure until I
see the output.

Thanks.

-- 
| 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 |