From patchwork Thu Feb 24 18:30:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 84428 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 42E97B70D5 for ; Fri, 25 Feb 2011 05:30:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364Ab1BXSan (ORCPT ); Thu, 24 Feb 2011 13:30:43 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:44100 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755175Ab1BXSam (ORCPT ); Thu, 24 Feb 2011 13:30:42 -0500 Received: by bwz15 with SMTP id 15so1290283bwz.19 for ; Thu, 24 Feb 2011 10:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :mime-version:content-type:content-disposition:user-agent; bh=PcLKuN8qM3erJrKyicJupqNDgnq9crG30FwML3E+yio=; b=MoH60J/7DLcpnEmkHBf0r90vYtB4IOnTNfjZjtSaCq1+dsGFnTR0b7Bh9JaY+lk/bR SbYePyyd714yj7dwAoxPMX2hHVJ6z9nyvhkG8ZIJ3wHQQMfy3VYFaW7naUtoq6or5FZb 750fy6vS0ET8lo64sxN1wSpFGqVbw+BaBLVgo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ke0aPyvfJvFgfmClergoruYJ2wOCM5Xy84owzr31ZajKe/I6z00UEnjAXbgB1uKCye +XlLR5LC3OE5rkkyXGhbzGETXjdGMpQ4AAUH/9hY1piWlcxUMn+LyCC/qsh2TECO/24k Mt3e2Z0Cted5IF3vgocdwCDgoCbOmm+JJriUM= Received: by 10.204.33.70 with SMTP id g6mr1138332bkd.177.1298572241088; Thu, 24 Feb 2011 10:30:41 -0800 (PST) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id b16sm4138113bkw.2.2011.02.24.10.30.39 (version=SSLv3 cipher=OTHER); Thu, 24 Feb 2011 10:30:39 -0800 (PST) Date: Thu, 24 Feb 2011 19:30:37 +0100 From: Tejun Heo To: Jeff Garzik Cc: linux-ide@vger.kernel.org Subject: [PATCH #upstream-fixes] libata: fix hotplug for drivers which don't implement LPM Message-ID: <20110224183037.GS7840@htj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org ata_eh_analyze_serror() suppresses hotplug notifications if LPM is being used because LPM generates spurious hotplug events. It compared whether link->lpm_policy was different from ATA_LPM_MAX_POWER to determine whether LPM is enabled; however, this is incorrect as for drivers which don't implement LPM, lpm_policy is always ATA_LPM_UNKNOWN. This disabled hotplug detection for all drivers which don't implement LPM. Fix it by comparing whether lpm_policy is greater than ATA_LPM_MAX_POWER. Signed-off-by: Tejun Heo Cc: stable@kernel.org --- drivers/ata/libata-eh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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 diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 17a6378..e16850e 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1618,7 +1618,7 @@ static void ata_eh_analyze_serror(struct ata_link *link) * host links. For disabled PMP links, only N bit is * considered as X bit is left at 1 for link plugging. */ - if (link->lpm_policy != ATA_LPM_MAX_POWER) + if (link->lpm_policy > ATA_LPM_MAX_POWER) hotplug_mask = 0; /* hotplug doesn't work w/ LPM */ else if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link)) hotplug_mask = SERR_PHYRDY_CHG | SERR_DEV_XCHG;