From patchwork Wed May 2 00:00:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Lord X-Patchwork-Id: 156269 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 EAF88B6F9A for ; Wed, 2 May 2012 10:00:56 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756507Ab2EBAAz (ORCPT ); Tue, 1 May 2012 20:00:55 -0400 Received: from ironport-out.teksavvy.com ([206.248.143.162]:50636 "EHLO ironport-out.teksavvy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756364Ab2EBAAz (ORCPT ); Tue, 1 May 2012 20:00:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBACxOgk8Y9geI/2dsb2JhbAANNoVztlEBAQQjBFEBEBkTFgsCAgkDAgECAUUGDQEFAgEBtCSKGI9CgRgEjmyaOQ X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="178004861" Received: from 24-246-7-136.cable.teksavvy.com (HELO [10.0.0.2]) ([24.246.7.136]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 01 May 2012 20:00:50 -0400 Message-ID: <4FA07932.2090003@teksavvy.com> Date: Tue, 01 May 2012 20:00:50 -0400 From: Mark Lord User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Tejun Heo CC: IDE/ATA development list Subject: [PATCH] libata-eh don't waste time retrying media errors References: <4FA043BE.2010009@teksavvy.com> <4FA04714.7050602@teksavvy.com> <20120501215854.GA21677@google.com> <4FA07655.6090506@teksavvy.com> In-Reply-To: <4FA07655.6090506@teksavvy.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org ATA and SATA drives have had built-in retries for media errors for as long as they've been commonplace in computers (early 1990s). When libata stumbles across a bad sector, it can waste minutes sitting there doing retry after retry before finally giving up and letting the higher layers deal with it. This patch removes retries for media errors only. Signed-off-by: Mark Lord Prevent libata from retrying bad sectors. Otherwise a single bad sector gets stuck here for minutes at a time. --- linux-3.3.4/drivers/ata/libata-eh.c 2012-04-27 13:17:35.000000000 -0400 +++ linux/drivers/ata/libata-eh.c 2012-05-01 19:53:55.586811975 -0400 @@ -2121,8 +2121,9 @@ /* determine whether the command is worth retrying */ if (qc->flags & ATA_QCFLAG_IO || (!(qc->err_mask & AC_ERR_INVALID) && - qc->err_mask != AC_ERR_DEV)) - qc->flags |= ATA_QCFLAG_RETRY; + !(qc->err_mask & AC_ERR_DEV))) + if (!(qc->err_mask & AC_ERR_MEDIA)) + qc->flags |= ATA_QCFLAG_RETRY; /* accumulate error info */ ehc->i.dev = qc->dev;