From patchwork Wed Nov 28 09:19:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1004286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qAgX7TIc"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 434ZqR2LH9z9s2P; Wed, 28 Nov 2018 20:19:47 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1gRw0U-0000Z0-ID; Wed, 28 Nov 2018 09:19:42 +0000 Received: from mail-pl1-f194.google.com ([209.85.214.194]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1gRw0S-0000YD-D9 for kernel-team@lists.ubuntu.com; Wed, 28 Nov 2018 09:19:40 +0000 Received: by mail-pl1-f194.google.com with SMTP id e5so17088411plb.5 for ; Wed, 28 Nov 2018 01:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=7h6o05F9UhN2m1MCgGuDoJM796K3rxZtM6XyGQpjTAQ=; b=qAgX7TIcU4Ww0iEXOd8jyqqzcL8X+o12VnPC3kq1gCp4d0ITRfWGiNzMgqAEA67ozn 3i5K0lYd/hTpp9Nl4mSm+AFg5U62ZJJvnWXejj0OnMy26E9kmCnV46f7XGPz54lUIOaH CwFMEKNJm1TfLY+8kVgL0Ob7UfAOq31mi/t3LZy9aRoL/d/PBQ2omT9v9cN82667OBJS rLpzZ3bQN/+cI+297ckAZtCele42jIUXABtFmPDSuRLLsdILGtj0GAFW4Tf76RhxgJgR IGzDR07vlmfx1b+QbLkxYmFaxb4+oq1+0EsHltlA64OFEBhTPws3F/GY8VyytQyfUtLC 98mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=7h6o05F9UhN2m1MCgGuDoJM796K3rxZtM6XyGQpjTAQ=; b=HWK1Rf0sqK0/s7MfR5R+lW0ggtaU36lqpq32BZN1YAuQVdcjHy9oVUcoqTjCe0Ep7s d/9fQgdktodtsJlWUVwVECgHR/ds7so72fyFxgxpqTJ6ykjmcg2zCZeVgLsE+czlmvqK PoELzt+ot8QY6CupVOCtEiSYmLT077pLORaqm+/MnH76sPwj5JDRrIie5msiUQQTz/HW OWkbGabbFHdX8ptH8EAPsAVLmUalPN703xIVY+BCi/BPYuhC+AiFgd6YD/ORx0RFBhb2 zf1uhIPOIOs5AVkBiLnv8NFZAJGrlBlr+p9aavfswiAW/rby4I2ml2wKFj8tUHp25x+f hI6g== X-Gm-Message-State: AA+aEWYZM7Oek1Kaf0aRi1DPxjUSZ34uOxh3z1Ck0MreX8HeLyFR0ni2 PsIpgmw6hbj2HYhukwgUz/oDxJGF X-Google-Smtp-Source: AFSGD/WVzbVXhchtoUJFbS6jaNE2pZCwTGv0hfJThAgUSTKs97jbqnivLhdjarNkX2fMenDncrNX9Q== X-Received: by 2002:a17:902:4623:: with SMTP id o32-v6mr36013037pld.187.1543396778581; Wed, 28 Nov 2018 01:19:38 -0800 (PST) Received: from localhost (114-32-69-186.HINET-IP.hinet.net. [114.32.69.186]) by smtp.gmail.com with ESMTPSA id v2sm7399543pgs.0.2018.11.28.01.19.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 01:19:37 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/4][SRU][OEM-B] ata: libahci: Correct setting of DEVSLP register Date: Wed, 28 Nov 2018 17:19:22 +0800 Message-Id: <20181128091932.18316-2-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181128091932.18316-1-acelan.kao@canonical.com> References: <20181128091932.18316-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Srinivas Pandruvada BugLink: https://bugs.launchpad.net/bugs/1781533 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 Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo (cherry picked from commit 2dbb3ec29a6c069035857a2fc4c24e80e5dfe3cc) Signed-off-by: AceLan Kao --- drivers/ata/libahci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index edaba13edeb9..0a2938e4c834 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2149,6 +2149,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) |