Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp317411imm; Mon, 2 Jul 2018 12:03:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdKXsUm4RL843HKt5F4M+TxrVgSNDdRWqLwgbK9KwPjZOrmfZ/oj4A6jPorNWJg3HpFkvIw X-Received: by 2002:a17:902:5857:: with SMTP id f23-v6mr19336376plj.206.1530558221834; Mon, 02 Jul 2018 12:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530558221; cv=none; d=google.com; s=arc-20160816; b=IY6uCdeGcDYDKHhVioZVcXuNOoXgZ5YZSFi+KRBsdZhyYlU7+0+pKbBSkNnLukf5Uh zHeSXt+zz1/TRE0pCSU1s9k7SI1kvCVUBmQwZGE6GW7ce/zXSRg/R7VQMygV4prYDqOd oltj3+KaVjc0f/hpudz6KF1KqOZdux3L1YehWJZM64GPs/QmeKpP80Hjctm+Z/Kn2rH9 3uFP6sDwGBFZUuTIrAwJG/ZwVXbr/sZub6CUKhhba/Ch/Xlxoh4ecpwzd862XJgQScnM rpBUOuDfpZdQa09ez25+u4EwNqhp1oH23Ys4uIIsOVVrhdaEnm4OwWkOA/fSy6ygQlwV oSyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4qrUt50ASb2P6z/3JrexbBQPSTfA+LJiZMoj9tiWlco=; b=iZGqW/fMrB9x60V6bAlam0/kfNN2LwHij8iqYEo8lLwtbQZL7kCqg/yrBgkpNDpaEv /AZTWyg8if69zVJHTDmmMLcFmVgxb8LHE6ru3R0Tb9r6Aar9H1yFU7RA8YyAKHeOOO+I 7JBMrEiYbuWHvtdZHgbjH5za1iU0NR+gqGYjEs7CpOq92Tc8X0iI7XdgvRWaSgkrto3d RbROIE+EJOZH46fmwxFCdB79VE7ChGtqeQLhKeen5rk5fivwI0+5H0L6JEU6PvURNp15 3xvNv4YRanvpot/JCrmLKFPYRBGwe3Y8UAr5qE9HOx8I4wE9D+48g/kmo2uVO3NdWpmh zSoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf6-v6si15907952plb.44.2018.07.02.12.03.26; Mon, 02 Jul 2018 12:03:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932120AbeGBTCI (ORCPT + 99 others); Mon, 2 Jul 2018 15:02:08 -0400 Received: from mga07.intel.com ([134.134.136.100]:50141 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbeGBTCG (ORCPT ); Mon, 2 Jul 2018 15:02:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2018 12:02:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,299,1526367600"; d="scan'208";a="54584843" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by orsmga006.jf.intel.com with ESMTP; 02 Jul 2018 12:02:05 -0700 From: Srinivas Pandruvada To: tj@kernel.org, hdegoede@redhat.com Cc: rjw@rjwysocki.net, alan.cox@intel.com, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH 1/2] ata: libahci: Correct setting of DEVSLP register Date: Mon, 2 Jul 2018 12:01:53 -0700 Message-Id: <20180702190154.6864-2-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702190154.6864-1-srinivas.pandruvada@linux.intel.com> References: <20180702190154.6864-1-srinivas.pandruvada@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have seen that on some platforms, SATA device never show any DEVSLP residency. This prevent power gating of SATA IP, which prevent system to transition to low power mode in systems with SLP_S0 aka modern standby systems. The PHY logic is off only in DEVSLP not in slumber. Reference: https://www.intel.com/content/dam/www/public/us/en/documents/datasheets /332995-skylake-i-o-platform-datasheet-volume-1.pdf Section 28.7.6.1 Here driver is trying to do read-modify-write the devslp register. But not resetting the bits for which this driver will modify values (DITO, MDAT and DETO). So simply reset those bits before updating to new values. Signed-off-by: Srinivas Pandruvada Reviewed-by: Rafael J. Wysocki --- drivers/ata/libahci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 965842a08743..f6795d261869 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2159,6 +2159,8 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep) deto = 20; } + /* Make dito, mdat, deto bits to 0s */ + devslp &= ~GENMASK_ULL(24, 2); devslp |= ((dito << PORT_DEVSLP_DITO_OFFSET) | (mdat << PORT_DEVSLP_MDAT_OFFSET) | (deto << PORT_DEVSLP_DETO_OFFSET) | -- 2.17.1