Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp837335imj; Fri, 15 Feb 2019 07:37:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IZwW9abC6hw5sRjtmxNrXfNXIdLy8QjpZoOirCgWZdveTxAZKcIj8BdukPrnJSzhgzzaN1/ X-Received: by 2002:a17:902:8212:: with SMTP id x18mr10813008pln.217.1550245058022; Fri, 15 Feb 2019 07:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550245058; cv=none; d=google.com; s=arc-20160816; b=D1CIKteNjlMaEwnzfLJkEYXN5V69isDrDStgZ7mEZOMu0qL1XDfkjzHxwaZh7Hd5GT 8M/WWMh+hOkYfnP74rjjxeOKIMzqKoFrjhruC7RbuH3k0hEkrRpNhs/rb61Kd2poYHaN Ng/aLGFxfyiQ7j0J5+bo5L59fZ9cYQoo86f3BJFxeJAbTWZdBXHFVyCTHM6RmeqcObb1 TL2USBvHZ+mcYW1dy5irScAvXpDv4pgympEK1gRA3TLD4Hko3b9OdtwVvZuIf6hvFqDq EeDSVY7hC4YtKfAqpnMzuyCWJJvGC/R5FDDhaXukAi4mGnkxXUKncYRzNKZiD6sIh4ix czuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KZwdBdXj+6/7xoeWytQeMbd4oICIIcE3oliGzGSC/DE=; b=N9aM4yC7vHD4vAJeTfnFYtI3CI7rnRy7h9Lq7t2pdMbE+ZpNiE8tVAK2UZxVR3Xx2X 0PCvIDBzbmPH3uFKyJG0LAPnNN+BgE3APJZHvs6r1pP2Vr0qAlS7AQ/szjoWeb7t/Jwc /P2bjN7xDdCDft0wcTRZy2QYiL2FDd7ZQzmyww6tQGMKbPcxAI9jaus/QqIsHU4MKxm6 Eje1h3Yq5dD91bjWCMhydVRQMSsUlPN8CTMj/b4IvxeY9MFQws97BlBXYVJPxJFg7mao 6XZBqgDpuwRJVkFQP6qG2yDUWcQ+qLMWqqu23INFcoRQz9Ilsp0Jo2r4/pCKeBFQkJnu wWaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TXYVnDJT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si5747394pfc.189.2019.02.15.07.37.22; Fri, 15 Feb 2019 07:37:38 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TXYVnDJT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404464AbfBOInd (ORCPT + 99 others); Fri, 15 Feb 2019 03:43:33 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:40756 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404378AbfBOInd (ORCPT ); Fri, 15 Feb 2019 03:43:33 -0500 Received: by mail-ot1-f66.google.com with SMTP id s5so15285668oth.7; Fri, 15 Feb 2019 00:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KZwdBdXj+6/7xoeWytQeMbd4oICIIcE3oliGzGSC/DE=; b=TXYVnDJTyUa6KDvZbx+s0Xv/SAagFIowNo4MZPsOj0nTDkQMG8pz6dhWVAsAy16f23 kzs4Ibcf0LVln7XBnPiv5ishrp8KI6uZwYcXSfaQwphgjCkWublnpTzSI//NZY4PfiIU vl+VGyfb9c94GOmPin4awvo9H1PWuTKWda59TRboWk9rn1vduBr4aaDBR6c2IGevPJ9Q iUZAtYZmLT4O74Db/wR7ATgDUL2N/HOgczC5uY7IfV07ieGNFy8FCT/Rx8WUiOWGzIq3 GgXeNX7AXyQHliGc7AAVSfNMOGWCRNmDA88f9CuscVTSCaxTNEz52Odtoaf2e50NftaX z9ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KZwdBdXj+6/7xoeWytQeMbd4oICIIcE3oliGzGSC/DE=; b=rrlfcSfhxGxGgb5yMU7fjkULKixSaryXx5GKbyyin8muaPS6s53nZJJBBOL7Ycyfg/ uL1S4z3Ea+lPjT4pOOdMt+0MrwVtMBPvIn39p/ZzRsw0dv99ZD4vQs5XGtoIm+BnyuZm RqMMclc06HaxBgG0ZJYkMnPLlbdAS3vrFWYFAJzPiU5tf6gSJ75mqKME404+aZR56i6h L84LujJq5cHmhUajAvCg4mD76Y617wNPQjPv0CjPgVOGU/6mKkPgD8cVB3zuFuXZQoAA fFXSIGcXuyE58WcHIPemXe6Q6GpN2qjFiqmja1ZJVFMxzCyxE4UA4RvTQeRDPyD1maM1 M+tg== X-Gm-Message-State: AHQUAuYHoA6U9sPLsB0RASq4E9IStjZfaJEJcVVG9Nn4dewe8VsgScWv PIRNha01GFP+imi/ijdMeBl5VfCg8FA20yMm8C2UPWcj X-Received: by 2002:a9d:6195:: with SMTP id g21mr4959436otk.76.1550220211817; Fri, 15 Feb 2019 00:43:31 -0800 (PST) MIME-Version: 1.0 References: <20190213214052.2427-1-linux.amoon@gmail.com> <20190213214052.2427-3-linux.amoon@gmail.com> In-Reply-To: From: Anand Moon Date: Fri, 15 Feb 2019 14:13:21 +0530 Message-ID: Subject: Re: [RFC 2/2] soc: samsung: pmu: Add the PMU data of exynos4412 to support low-power state To: Krzysztof Kozlowski Cc: devicetree , linux-arm-kernel , "linux-samsung-soc@vger.kernel.org" , Linux Kernel , Rob Herring , Kukjin Kim , Marek Szyprowski , Tomasz Figa , Chanwoo Choi , Pankaj Dubey Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On Fri, 15 Feb 2019 at 13:03, Krzysztof Kozlowski wrote: > > On Thu, 14 Feb 2019 at 19:37, Anand Moon wrote: > > > > Hi Krzysztof, > > > > Thanks for your review comments. > > > > On Thu, 14 Feb 2019 at 18:29, Krzysztof Kozlowski wrote: > > > > > > On Wed, 13 Feb 2019 at 22:41, Anand Moon wrote: > > > > > > > > This patch adds configration for PMU (Power Management Unit) state > > > > tuning for exynos4412 SoC in order to enter low-power mode during > > > > suspend power modes and help resume from suspend state. > > > > > > The U3 and Trats2 already enter STOP/S2R so please describe what > > > exactly you change. > > > > > > > Fixes: bfce552d0b1 ("drivers: soc: Add support for Exynos PMU driver") > > > > > > How it fixes it? What was broken in that commit? > > > > * I was not aware on their is common framework for suspend and resume > > other than setting this here.I only look in to some the other exynos > > pmu architecture > > and referring 3.10.x kernel to model my changes.* > > Suspend in general should be working already so adding this code just > because is not a valid reason. Please specify what is not working > first. > Please accept *my apology* for not studying the code changes required. Sorry for wasting your precious time in review. My only intention with this patch was to correctly initialize some PMU parameters. which might be wrong. so lets drop this. > > > > > > > Cc: Marek Szyprowski > > > > Cc: Krzysztof Kozlowski > > > > Cc: Chanwoo Choi > > > > Signed-off-by: Anand Moon > > > > --- > > > > > > > > Changes from previous patch. > > > > New patch to this series to support suspend and resume state > > > > > > > > Changes have been tested on microSD card but fails to resume on cMMC. > > > > It need to be investigated and more debuging > > > > --- > > > > drivers/soc/samsung/exynos4-pmu.c | 83 +++++++++++++++++++++ > > > > include/linux/soc/samsung/exynos-regs-pmu.h | 21 ++++++ > > > > 2 files changed, 104 insertions(+) > > > > > > > > diff --git a/drivers/soc/samsung/exynos4-pmu.c b/drivers/soc/samsung/exynos4-pmu.c > > > > index a7cdbf1aac0c..d261a0d2371e 100644 > > > > --- a/drivers/soc/samsung/exynos4-pmu.c > > > > +++ b/drivers/soc/samsung/exynos4-pmu.c > > > > @@ -200,10 +200,93 @@ static const struct exynos_pmu_conf exynos4412_pmu_config[] = { > > > > { PMU_TABLE_END,}, > > > > }; > > > > > > > > +static unsigned int const exynos4412_list_feed[] = { > > > > + EXYNOS4_ARM_CORE0_OPTION, > > > > + EXYNOS4_ARM_CORE1_OPTION, > > > > + EXYNOS4_ARM_CORE2_OPTION, > > > > + EXYNOS4_ARM_CORE3_OPTION, > > > > + EXYNOS4_ARM_COMMON_OPTION, > > > > + EXYNOS4_CAM_OPTION, > > > > + EXYNOS4_TV_OPTION, > > > > + EXYNOS4_MFC_OPTION, > > > > + EXYNOS4_G3D_OPTION, > > > > + EXYNOS4_LCD0_OPTION, > > > > + EXYNOS4_ISP_OPTION, > > > > + EXYNOS4_MAUDIO_OPTION, > > > > + EXYNOS4_GPS_OPTION, > > > > + EXYNOS4_GPS_ALIVE_OPTION, > > > > +}; > > > > + > > > > +static void exynos4412_pmu_central_seq(bool enable) > > > > > > You name the argument as "enable" but during initialization and > > > system running you pass here false. It confuses me. What do you enable > > > here? > > > > > > > Yep your are correct need to drop this function as already done in > > common frame work. > > > > > > +{ > > > > + unsigned int value; > > > > + > > > > + value = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION); > > > > + if (enable) > > > > + value &= ~S5P_CENTRAL_LOWPWR_CFG; > > > > + else > > > > + value |= S5P_CENTRAL_LOWPWR_CFG; > > > > + pmu_raw_writel(value, S5P_CENTRAL_SEQ_CONFIGURATION); > > > > > > You duplicate exynos_pm_central_suspend() without removing the original code. > > > > > > > + > > > > + value = pmu_raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION_COREBLK); > > > > + if (enable) > > > > + value &= ~S5P_CENTRAL_LOWPWR_CFG; > > > > + else > > > > + value |= S5P_CENTRAL_LOWPWR_CFG; > > > > > > As manual says - set this register only if you disable C2C. Our entire > > > low power configuration for STOP mode is for C2C enabled case so you > > > add inconsistent configuration. > > > > Ok Sorry I overlook this code change. > > > > Enable system power down. Set only CENTRAL_SEQ_CONFIGURATION register > > if you disable C2C. > > Set both CENTRAL_SEQ_CONFIGURATION and > > CENTRAL_SEQ_CONFIGURATION_COREBLK registers if you enable C2C. > > > > > > + pmu_raw_writel(value, S5P_CENTRAL_SEQ_CONFIGURATION_COREBLK); > > > > +} > > > > + > > > > +static void exynos4412_pmu_init(void) > > > > +{ > > > > + unsigned int value; > > > > + int i; > > > > + > > > > + /* Enable USE_STANDBY_WFI for all CORE */ > > > > + pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION); > > > > > > This does not look related to improving suspend... it looks unrelated. > > > > > > > Ok yes your are correct all ready done in comment frame work. > > > > "Execute WFI/WFE for all CPU cores. As soon as all the CPU cores in > > Exynos 4412 SCP enter STANDBY mode" > > > > + > > > > + /* Decides whether to use retention capability */ > > > > + value = pmu_raw_readl(S5P_ARM_L2_0_OPTION); > > > > + value &= ~EXYNOS_L2_USE_RETENTION; > > > > + pmu_raw_writel(value, S5P_ARM_L2_0_OPTION); > > > > + > > > > + value = pmu_raw_readl(S5P_ARM_L2_1_OPTION); > > > > + value &= ~EXYNOS_L2_USE_RETENTION; > > > > + pmu_raw_writel(value, S5P_ARM_L2_1_OPTION); > > > > + > > > > + /* Set PSHOLD port for output high */ > > > > + value = pmu_raw_readl(S5P_PS_HOLD_CONTROL); > > > > + value |= S5P_PS_HOLD_OUTPUT_HIGH; > > > > + pmu_raw_writel(value, S5P_PS_HOLD_CONTROL); > > > > + > > > > + /* Enable signal for PSHOLD port */ > > > > + value = pmu_raw_readl(S5P_PS_HOLD_CONTROL); > > > > + value |= S5P_PS_HOLD_EN; > > > > + pmu_raw_writel(value, S5P_PS_HOLD_CONTROL); > > > > + > > > > > > The same - not related. > > > > PS_HOLD_CONTROL need to be set under following set > > Hardware reset Reset > > Watchdog timer reset Keep its value > > Software reset Keep its value > > Warm reset Keep its value > > Wakeup reset Keep its value > > Which is not related to suspend... > > > > > > > > > > + /* Enable only SC_FEEDBACK */ > > > > + for (i = 0; i < ARRAY_SIZE(exynos4412_list_feed); i++) { > > > > + value = pmu_raw_readl(exynos4412_list_feed[i]); > > > > + value &= ~(EXYNOS_USE_SC_COUNTER); > > > > + value |= EXYNOS_USE_SC_FEEDBACK; > > > > + pmu_raw_writel(value, exynos4412_list_feed[i]); > > > > > > Why do you prefer to use feedback instead of counter? > > > > > > > Their is a note below if we use this setting. > > NOTE: Either one of USE_SC_FEEDBACK and USE_SC_COUNTER should be activated. > > This is not the answer to my question at all. > > Best regards, > Krzysztof Once again sorry for wasting your time. I know I have the improve a lot of things. Best Regards -Anand