From patchwork Fri Aug 7 23:17:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwendal Grignou X-Patchwork-Id: 30991 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.176.167]) by bilbo.ozlabs.org (Postfix) with ESMTP id BDAFFB7B60 for ; Sat, 8 Aug 2009 09:18:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932079AbZHGXSu (ORCPT ); Fri, 7 Aug 2009 19:18:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932101AbZHGXSu (ORCPT ); Fri, 7 Aug 2009 19:18:50 -0400 Received: from smtp-out.google.com ([216.239.33.17]:8431 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbZHGXSt (ORCPT ); Fri, 7 Aug 2009 19:18:49 -0400 Received: from spaceape13.eur.corp.google.com (spaceape13.eur.corp.google.com [172.28.16.147]) by smtp-out.google.com with ESMTP id n77NHrgA011588; Sat, 8 Aug 2009 00:17:53 +0100 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1249687073; bh=1BbSBJjxZLSKaFkI0mcy1ku+dnU=; h=DomainKey-Signature:From:To:Cc:Subject:Date:Message-Id:X-Mailer: In-Reply-To:References; b=oxS4DXO3/ZdYIBO1HL3yosc6a7h4nLwzPhalwxOy 0mboRpNW8Cszr7JOdc9Hq/SGnJb8WJaDn+3oa81lttR4Qw== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=klpge82EUc+a9QbmS4I10rrrUh2OU7cX78ZS/+arGXwHQel1cTpr5cQBYDLpAp77v Vd2A6ZcYtvQuAsg1Wc7Ww== Received: from localhost (hippo2.mtv.corp.google.com [172.18.118.87]) by spaceape13.eur.corp.google.com with ESMTP id n77NHocD027724; Fri, 7 Aug 2009 16:17:50 -0700 Received: by localhost (Postfix, from userid 60833) id C9CC35A670; Fri, 7 Aug 2009 16:17:49 -0700 (PDT) From: Gwendal Grignou To: tj@kernel.org Cc: linux-ide@vger.kernel.org, Gwendal Grignou Subject: [PATCH] When a disk wakes up from sleep, ensure that the command is retried by SCSI EH. Date: Fri, 7 Aug 2009 16:17:49 -0700 Message-Id: <1249687069-31011-1-git-send-email-gwendal@google.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <4A7CB4D6.7020902@kernel.org> References: <4A7CB4D6.7020902@kernel.org> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Without this fix, ATA passthrough commands are not resend to the drive, and no error is signalled to the caller because: - allowed retry count is 1 - ata_eh_qc_complete fill the sense data, so result is valid - sense data is filled with untouched ATA registers. Signed-off-by: Gwendal Grignou Acked-by: Tejun Heo --- drivers/ata/libata-eh.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 79711b6..202da9c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1183,14 +1183,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc) * should be retried. To be used from EH. * * SCSI midlayer limits the number of retries to scmd->allowed. - * scmd->retries is decremented for commands which get retried + * scmd->allowed is incremented for commands which get retried * due to unrelated failures (qc->err_mask is zero). */ void ata_eh_qc_retry(struct ata_queued_cmd *qc) { struct scsi_cmnd *scmd = qc->scsicmd; - if (!qc->err_mask && scmd->retries) - scmd->retries--; + if (!qc->err_mask) + scmd->allowed++; __ata_eh_qc_complete(qc); }