From patchwork Wed Mar 16 10:14:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 87215 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 14254B6FFC for ; Wed, 16 Mar 2011 21:15:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409Ab1CPKPO (ORCPT ); Wed, 16 Mar 2011 06:15:14 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:44593 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270Ab1CPKPN (ORCPT ); Wed, 16 Mar 2011 06:15:13 -0400 Received: by fxm17 with SMTP id 17so1479454fxm.19 for ; Wed, 16 Mar 2011 03:15:12 -0700 (PDT) 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 :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=HTtCrnLT5L/9aVyyPzBEKshjraDJO1jyNEao45veh1c=; b=rCIshRy6DFrEh9h57U6mQ/n3fxsdruc5STouL2YJ8k+j+16m27gtW//MwQgJoBhTk4 P2WOLSxAbNZfZh3uc8rDnshOwtn/tQPUmekGgAf0SR+V2UmZLrUKQEqRkrRLE3LuU7Ui JMUWBWDeKg2DB+PdpX2sPH/fHXVLqG3Lfc23c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=gZxG6LF70Ga5oQ4UTAAGTYjOF4tvXtsZY7cKK2Lb0+rE1RwBjNFZzXEwpFQtmNtBfq BKunxos/J0KqFUiAZeCcgWJjgkacv7+ddiSd39BKo1Hv6rAFjHycc9iZD+FuQMR2NueC k3LlFw4ozVYezerboEin1XkpMYG/R5yiPZV44= Received: by 10.223.3.132 with SMTP id 4mr676059fan.132.1300270498253; Wed, 16 Mar 2011 03:14:58 -0700 (PDT) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id c21sm71084fac.22.2011.03.16.03.14.57 (version=SSLv3 cipher=OTHER); Wed, 16 Mar 2011 03:14:57 -0700 (PDT) Date: Wed, 16 Mar 2011 11:14:55 +0100 From: Tejun Heo To: Jeff Garzik , linux-ide@vger.kernel.org Cc: Stefan Bader Subject: [PATCH 2/2] libata: Implement ATA_FLAG_NO_DIPM and apply it to mcp65 Message-ID: <20110316101455.GC1752@htj.dyndns.org> References: <20110316101425.GB1752@htj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110316101425.GB1752@htj.dyndns.org> 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 NVIDIA mcp65 familiy of controllers cause command timeouts when DIPM is used. Implement ATA_FLAG_NO_DIPM and apply it. This problem was reported by Stefan Bader in the following thread. http://thread.gmane.org/gmane.linux.ide/48841 stable: applicable to 2.6.37 and 38. Signed-off-by: Tejun Heo Reported-by: Stefan Bader Cc: stable@kernel.org --- drivers/ata/ahci.c | 2 +- drivers/ata/libata-eh.c | 6 ++++-- include/linux/libata.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) -- 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 Index: work/drivers/ata/ahci.c =================================================================== --- work.orig/drivers/ata/ahci.c +++ work/drivers/ata/ahci.c @@ -150,7 +150,7 @@ static const struct ata_port_info ahci_p { AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ), - .flags = AHCI_FLAG_COMMON, + .flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_DIPM, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, Index: work/drivers/ata/libata-eh.c =================================================================== --- work.orig/drivers/ata/libata-eh.c +++ work/drivers/ata/libata-eh.c @@ -3276,6 +3276,7 @@ static int ata_eh_set_lpm(struct ata_lin struct ata_eh_context *ehc = &link->eh_context; struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL; enum ata_lpm_policy old_policy = link->lpm_policy; + bool no_dipm = ap->flags & ATA_FLAG_NO_DIPM; unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM; unsigned int err_mask; int rc; @@ -3292,7 +3293,7 @@ static int ata_eh_set_lpm(struct ata_lin */ ata_for_each_dev(dev, link, ENABLED) { bool hipm = ata_id_has_hipm(dev->id); - bool dipm = ata_id_has_dipm(dev->id); + bool dipm = ata_id_has_dipm(dev->id) && !no_dipm; /* find the first enabled and LPM enabled devices */ if (!link_dev) @@ -3349,7 +3350,8 @@ static int ata_eh_set_lpm(struct ata_lin /* host config updated, enable DIPM if transitioning to MIN_POWER */ ata_for_each_dev(dev, link, ENABLED) { - if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) { + if (policy == ATA_LPM_MIN_POWER && !no_dipm && + ata_id_has_dipm(dev->id)) { err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, SATA_DIPM); if (err_mask && err_mask != AC_ERR_DEV) { Index: work/include/linux/libata.h =================================================================== --- work.orig/include/linux/libata.h +++ work/include/linux/libata.h @@ -201,6 +201,7 @@ enum { * management */ ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity * led */ + ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ /* bits 24:31 of ap->flags are reserved for LLD specific flags */