From patchwork Fri Sep 24 13:11:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Lord X-Patchwork-Id: 65651 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 602E6B6EFF for ; Fri, 24 Sep 2010 23:12:04 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750889Ab0IXNMD (ORCPT ); Fri, 24 Sep 2010 09:12:03 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:58170 "EHLO ironport2-out.pppoe.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750816Ab0IXNMC (ORCPT ); Fri, 24 Sep 2010 09:12:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIBAPZAnExLd/sX/2dsb2JhbAAHgxXSFZIegSKDLnME X-IronPort-AV: E=Sophos;i="4.57,229,1283745600"; d="scan'208";a="76628967" Received: from rtr.ca (HELO [10.0.0.6]) ([75.119.251.23]) by ironport2-out.pppoe.ca with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 24 Sep 2010 09:11:55 -0400 Message-ID: <4C9CA385.5090709@teksavvy.com> Date: Fri, 24 Sep 2010 09:11:33 -0400 From: Mark Lord User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Seed CC: Tejun Heo , Jeff Garzik , IDE/ATA development list Subject: Re: [BUG] libahci returns stale result tf much of the time. References: <4C9C3878.9010206@teksavvy.com> <4C9C44D0.1030409@teksavvy.com> In-Reply-To: Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On 10-09-24 03:01 AM, Seed wrote: > On Fri, Sep 24, 2010 at 4:27 PM, Mark Lord wrote: >> The bug seems to be in the libahci code somewhere. > > ahci_qc_fill_rtf seems to be the function converting FIS to result_tf. .. Yeah, that's as far as I got with it last night. If you apply this patch (below), it makes the problem more "obvious", though I still don't see exactly how that struct gets updated. --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/ata/libahci.c 2010-09-24 02:40:24.722887047 -0400 +++ b/drivers/ata/libahci.c 2010-09-24 09:10:21.761520099 -0400 @@ -1838,6 +1838,7 @@ d2h_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; ata_tf_from_fis(d2h_fis, &qc->result_tf); + memset(d2h_fis, 0xfd, AHCI_RX_FIS_SZ); return true; }