From patchwork Fri Apr 20 01:38:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ming X-Patchwork-Id: 153903 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 7CD1EB702A for ; Fri, 20 Apr 2012 11:39:02 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214Ab2DTBjB (ORCPT ); Thu, 19 Apr 2012 21:39:01 -0400 Received: from mga03.intel.com ([143.182.124.21]:49981 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141Ab2DTBjA (ORCPT ); Thu, 19 Apr 2012 21:39:00 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 19 Apr 2012 18:39:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="91151078" Received: from minggr.sh.intel.com (HELO [10.239.36.45]) ([10.239.36.45]) by AZSMGA002.ch.intel.com with ESMTP; 19 Apr 2012 18:38:59 -0700 Subject: [PATCH] libata: clear error mask of old error history From: Lin Ming To: Jeff Garzik Cc: linux-ide@vger.kernel.org, Martin Mokrejs Date: Fri, 20 Apr 2012 09:38:58 +0800 Message-ID: <1334885938.4927.11.camel@minggr> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The old error history was cleared in ata_ering_clear(). It only sets ATA_EFLAG_OLD_ER eflags, but the err_mask was not cleared. So ata_ering_map() still iterates the old error history. This causes problem, for example, wrong probe trials count were returned in ata_eh_schedule_probe(), which in turn causes SATA link speed to be slowed down to 1.5Gbps. Reported-and-tested-by: Martin Mokrejs Signed-off-by: Lin Ming --- Hi Jeff, This patch fixes an old regression introduced in 2.6.37-rc1 of commit d902747. So it should be included into stable releases since 2.6.37. drivers/ata/libata-eh.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c61316e..4c6f49b 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -419,9 +419,10 @@ int ata_ering_map(struct ata_ering *ering, return rc; } -int ata_ering_clear_cb(struct ata_ering_entry *ent, void *void_arg) +static int ata_ering_clear_cb(struct ata_ering_entry *ent, void *void_arg) { ent->eflags |= ATA_EFLAG_OLD_ER; + ent->err_mask = 0; return 0; }