From patchwork Tue Jan 16 07:32:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 861310 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="smj41emI"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3zLMQ70Fqvz9s7g; Tue, 16 Jan 2018 18:33:03 +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 1ebLju-0001wM-Ju; Tue, 16 Jan 2018 07:32:58 +0000 Received: from mail-pg0-f68.google.com ([74.125.83.68]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ebLjt-0001un-Ei for kernel-team@lists.ubuntu.com; Tue, 16 Jan 2018 07:32:57 +0000 Received: by mail-pg0-f68.google.com with SMTP id i196so9081406pgd.0 for ; Mon, 15 Jan 2018 23:32:57 -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=bDmLIlrtpc+OmPmwL+flGWZHCO/ajATNlf8dNdXZEW0=; b=smj41emIzUFZfTxciNChqfYbz/D8rgcsmHP6eBVZIJXne44Rfjmr5uvBtMljxyxgWV JrZqmYyD6mtFRrUZfV2/Q/ottfUscJY/hK4k/8yiCZ04jP7GP9o/C95tnvIRmIvLorTV aYqH5+eLIzieY6J0Die9SZXDZTO5U9Ent/XLU6zN+oI/Br4fq/2w2gx3LsG6uKmelWUt DZ8j+P8X795mfZfzHv1x5IDxJ6kF6xWIz7+u1prb6Qp2DVpnuLmFDckp4RbxWgQ09jWS SqwUIpJ2YLfbksGU6lY1niyLPLaNDm5I4cdc11LjnaawV/0xUcK6Tc4z++Ezb/It6+LS G5nA== 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=bDmLIlrtpc+OmPmwL+flGWZHCO/ajATNlf8dNdXZEW0=; b=KyanJIT/XaNpQpXaFOojca7KK5EBTZsLhA+Y6PQQem7wdS0w5Xf3LHt5ek1exgeJkL YOBeEUBqW6xDq6sshxerqJ0ottOtAJbCoK3X71DLKo6tb3LpJmbLyZxy+yt/0WRJDx02 X9Hj0hoRiVWFjiSbFonXWy8w9CFlvyICY1y8t5gS3uNm18YwiXQmpPdmRnBzP8f9U6PK jUJd67PRz2Z+gJ1Maj77znKCLzdA4pn+MnV3Hxq9q934+SzXzQ6rtc+UHWJxnAg7rx9W OPLeaMfj4jP1Wf0zsu/4xpZzRULfNGKMK/WAyHTL8PlUfzsDPPtOA0c5GKSeVxi75Vqy pNIA== X-Gm-Message-State: AKGB3mLOBcPc40J3tYOds1jSKQp2Pe7ZTNTGdP1EkYQinZk1lEJDtLhp yEKpkySVM8eIngx4LUS3SXzERAUf X-Google-Smtp-Source: ACJfBovlYw/PiTiZSBomBPEOs1A4PN9teLgshYTJd/LHZ9FD/6QFZbv9Jl9umHt9hU4Mp0cxWBcGsA== X-Received: by 10.99.143.5 with SMTP id n5mr30745532pgd.14.1516087975678; Mon, 15 Jan 2018 23:32:55 -0800 (PST) Received: from localhost ([175.41.48.77]) by smtp.gmail.com with ESMTPSA id v24sm2128143pgc.82.2018.01.15.23.32.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jan 2018 23:32:54 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH] mfd: Fix RTS5227 (and others) powermanagement Date: Tue, 16 Jan 2018 15:32:49 +0800 Message-Id: <1516087969-24690-2-git-send-email-acelan.kao@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516087969-24690-1-git-send-email-acelan.kao@canonical.com> References: <1516087969-24690-1-git-send-email-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: Hans de Goede BugLink: https://bugs.launchpad.net/bugs/1743516 Commit 8275b77a1513 ("mfd: rts5249: Add support for RTS5250S power saving") adds powersaving support for device-ids 5249 524a and 525a. But as a side effect it breaks ASPM support for all the other device-ids, causing e.g. the Haswell CPU on a Lenovo T440s to not go into a higher c-state then PC3, while previously it would go to PC7, causing the machine to idle at 7.4W instead of 6.6W! The problem here is the new option.dev_aspm_mode field, which only gets explicitly initialized in the new code for the device-ids 5249 524a and 525a. Leaving the dev_aspm_mode 0 for the other device-ids. The default dev_aspm_mode 0 is mapped to DEV_ASPM_DISABLE, but the old behavior of calling rtsx_pci_enable_aspm() when idle and rtsx_pci_disable_aspm() when busy happens when dev_aspm_mode == DEV_ASPM_DYNAMIC. This commit changes the enum so that 0 = DEV_ASPM_DYNAMIC matching the old default behavior, fixing the pm regression with the other device-ids. Fixes: 8275b77a1513 ("mfd: rts5249: Add support for RTS5250S power saving") Signed-off-by: Hans de Goede Acked-by: Rui Feng Signed-off-by: Lee Jones (backported from commit b860b419d970f286294fbfb2b21a4028fd8ee442) Signed-off-by: AceLan Kao Acked-by: Anthony Wong --- include/linux/rtsx_pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rtsx_pci.h b/include/linux/rtsx_pci.h index a44670e..478acf6 100644 --- a/include/linux/rtsx_pci.h +++ b/include/linux/rtsx_pci.h @@ -1121,10 +1121,10 @@ enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN}; #define LTR_L1SS_PWR_GATE_CHECK_CARD_EN BIT(6) enum dev_aspm_mode { - DEV_ASPM_DISABLE = 0, DEV_ASPM_DYNAMIC, DEV_ASPM_BACKDOOR, DEV_ASPM_STATIC, + DEV_ASPM_DISABLE, }; /*