From patchwork Fri Sep 11 15:27:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Lala X-Patchwork-Id: 33469 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 7737BB6F56 for ; Sat, 12 Sep 2009 01:35:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752089AbZIKPfy (ORCPT ); Fri, 11 Sep 2009 11:35:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753508AbZIKPfy (ORCPT ); Fri, 11 Sep 2009 11:35:54 -0400 Received: from autosupport.riverbed.com ([208.70.196.44]:61399 "EHLO smtp2.riverbed.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbZIKPfx (ORCPT ); Fri, 11 Sep 2009 11:35:53 -0400 X-Greylist: delayed 569 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Sep 2009 11:35:53 EDT Received: from unknown (HELO tlssmtp) ([10.16.4.52]) by smtp2.riverbed.com with ESMTP; 11 Sep 2009 08:26:28 -0700 Received: from localhost (unknown [216.52.20.2]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by tlssmtp (Postfix) with ESMTP id A60E56B8B9; Fri, 11 Sep 2009 08:36:59 -0700 (PDT) Date: Fri, 11 Sep 2009 08:27:04 -0700 From: Chaitanya Lala To: jgarzik@pobox.com Cc: linux-ide@vger.kernel.org, ajones@riverbed.com, rbecker@riverbed.com, clala@riverbed.com Subject: [libata PATCH 1/1] libata: thaw port after maximum reset retries Message-ID: <20090911152703.GA5222@clala-laptop> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The libata error recovery tries to reset a port a number of times and if unsuccessful, gives up. The code does not thaw the port before it exits. If the bad disk i.e. the disk that could not be reset is removed and a healthy disk is inserted, the new disk does not register, since the port is frozen. This patch fixes the same. Signed-off-by: Chaitanya Lala --- drivers/ata/libata-eh.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 79711b6..724f86f 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2637,8 +2637,12 @@ int ata_eh_reset(struct ata_link *link, int classify, sata_scr_read(link, SCR_STATUS, &sstatus)) rc = -ERESTART; - if (rc == -ERESTART || try >= max_tries) + if (rc == -ERESTART || try >= max_tries) { + /* thaw the port */ + if (ata_is_host_link(link)) + ata_eh_thaw_port(ap); goto out; + } now = jiffies; if (time_before(now, deadline)) {