Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1026761rda; Sun, 22 Oct 2023 23:01:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGHlh5+r4t8+b1Qcf2yZnryCpkyEOteFBGWd8FbJkWuFTW5JnftdTYmjBKD8JzcAWMts/e X-Received: by 2002:a05:6a20:8e0e:b0:17d:dda5:3685 with SMTP id y14-20020a056a208e0e00b0017ddda53685mr5739083pzj.27.1698040918804; Sun, 22 Oct 2023 23:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698040918; cv=none; d=google.com; s=arc-20160816; b=r4CeClH+KEudCVfhTYHlF9vSLiTbp5n/Tsl/fr5m6r8WdFfucinCRWbxas/kAZ/Esu xGtNyurvXepgxwBR3o3z76Nl+FD5Hl8b8qbs6rcx8KDytRst4BtKnWMg/91WfnCLBXn4 1t3VOdeb355X5U6V9RHNiPo7AiIcADO77ndLFGcI+M3gdFXT43nsPDNXeQmbKJOd91hz wAdYAPfSJxXDZ/m3P7vKkKC1lF/d+WFtuz8Q7kO0f7OS7zEpYZFB8DXEYZTapUWIZPNH vTO7jC5lf3elx36QkzDZvajVJ3BdBHEfc8svNfixhFsykDL6Dws6RM2xuY4zifDeuT6T /7aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Cv15uiequPHsJVyJI0xD5cCNL07pE6hRG7EicxlA4k0=; fh=Lb71MmuUX1xDC+z9kYTPPFXIbE7Vf90VIwRz567vpLc=; b=s5eC0O1UhqWf08cilG2xxZfCtTGSaMW2KMj0M5kVT728RW8Nn75Z1uV604ghYXdorJ EQZMtuB4xutQs00t7rkZt8ptfdR57/0NHNXwZ9jtCKgDDWX4eNet+ja9I89XpT78x6WV 4fSW+Yb0kC3PSuE4dfdG5sIRcyPhH4mB47Q6XEP7m3eEwn0pR+uOT/r58ppN4/aUvE8p dHLIG2gvv9mNeR0a/zxBk8mZyFsjaP3ofBx69Jdxn5PBlOYueEopBzL4NoVtf37DssSg LnD0PWZMCr7UPowSKAvt312fWCpO3Clm3bpj6dDRAmPP6y/sdfrORVK7KzFEC9mLhvzQ vqTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=R5xDm01F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 26-20020a17090a005a00b0027d29e618f7si5985969pjb.78.2023.10.22.23.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=R5xDm01F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B49E58088A49; Sun, 22 Oct 2023 23:01:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbjJWGBk (ORCPT + 99 others); Mon, 23 Oct 2023 02:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjJWGBj (ORCPT ); Mon, 23 Oct 2023 02:01:39 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CA251A4 for ; Sun, 22 Oct 2023 23:01:37 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c509d5ab43so44388301fa.0 for ; Sun, 22 Oct 2023 23:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1698040895; x=1698645695; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Cv15uiequPHsJVyJI0xD5cCNL07pE6hRG7EicxlA4k0=; b=R5xDm01FD9QSos3gHqebQXThOj1mPnLHh/eXlW6Y3nGgDKbn0G/0AZmHhpwRiXePc2 iPMItRLDKnc52TgYnpxFf95nhMBJiyw4OAWVG48CRGipZJJ8m5rQwZSwsXN8nfuQOpnD Viwv96b5qbxzDHy1nq8aMQxUwpwks/OQtGCGolL6x7Ub9EQAYxdorAlyqNP40IMYsS2x C2Q1yLLOjkWq0hp+dXoWYzYsS41K8ZJaB2cOmjFTjCfARE5RR9Z+gZBGGaHh1e1pnf94 vfk28SshOPqzPOrzwPmgiPbiCR9MsMic7F5vvutAb682r8gLP47ENWacQLfzsKboGoFr UyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698040895; x=1698645695; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Cv15uiequPHsJVyJI0xD5cCNL07pE6hRG7EicxlA4k0=; b=d+1ltuUysj/gPJPDxb/tlBA4rXKm0MxmNJz/pjQ2hlHfstbaigrX648CgXQQkHHhFB VnNKOGIsYhscNEwTdBIFJwlBiLtFACyvyFTmF/Q45Q84M9reEOblviUEHr44uB+1/cl5 0YOmYUyfSerSAr6goALAQby7zVqg1ZxK14EZlMvzOppx0rbol//6mfabhdFSU6fxIGD4 h31OonnCFAzfRi8iUERibSRIrVemQVO485W5X8UYjSa9aspCWq0bFScZKtD3YOywwh/p kPD34PTWPbAKtLQ3tqngs0yz7UGNBJSnwl92Ci06LqQHte7M4iEzljcw7mnHs5hJeffP xUkg== X-Gm-Message-State: AOJu0Yxkpq9V72e4+2diNbubNQfjkUJb5nMYEWf5SBGzlSZPit998oI2 Gp7eY138BoAEPJB0Saa40CKCAA== X-Received: by 2002:a2e:b8c7:0:b0:2c5:968:6daf with SMTP id s7-20020a2eb8c7000000b002c509686dafmr6677819ljp.39.1698040895278; Sun, 22 Oct 2023 23:01:35 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.185]) by smtp.gmail.com with ESMTPSA id u13-20020a05600c19cd00b004068e09a70bsm8579309wmq.31.2023.10.22.23.01.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Oct 2023 23:01:34 -0700 (PDT) Message-ID: <635cea61-861b-4af3-a4ee-ed048456e200@tuxon.dev> Date: Mon, 23 Oct 2023 09:01:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ARM: at91: pm: set soc_pm.data.mode in at91_pm_secure_init() Content-Language: en-US To: thomas.perrot@bootlin.com, Russell King , Nicolas Ferre , Alexandre Belloni Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clement.leger@bootlin.com References: <20231020130219.1255937-1-thomas.perrot@bootlin.com> From: claudiu beznea In-Reply-To: <20231020130219.1255937-1-thomas.perrot@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:01:56 -0700 (PDT) Hi, Thomas, On 20.10.2023 16:02, thomas.perrot@bootlin.com wrote: > From: Thomas Perrot > > In non secure mode, soc_pm.data.mode is set when entering pm in > at91_pm_begin(). This value is used (not only) to determine if the system > is going into slow clock mode (at91_suspend_entering_slow_clock()). This > function is called from various drivers to check this and act accordingly. > If not set, the driver might enter an incorrect suspend mode. When using > secure suspend mode, at91_pm_begin() is not called and thus > soc_pm.data.mode is not set. Since when using secure suspend, only one > suspend mode is supported, set this value directly in > at91_pm_secure_init(). > > Signed-off-by: Clément Léger > Signed-off-by: Thomas Perrot > --- > arch/arm/mach-at91/pm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c > index 1a26af0fabc7..345b91dc6627 100644 > --- a/arch/arm/mach-at91/pm.c > +++ b/arch/arm/mach-at91/pm.c > @@ -1103,6 +1103,7 @@ static void __init at91_pm_secure_init(void) > if (res.a0 == 0) { > pr_info("AT91: Secure PM: suspend mode set to %s\n", > pm_modes[suspend_mode].pattern); > + soc_pm.data.mode = suspend_mode; > return; > } > > @@ -1112,6 +1113,7 @@ static void __init at91_pm_secure_init(void) > res = sam_smccc_call(SAMA5_SMC_SIP_GET_SUSPEND_MODE, 0, 0); > if (res.a0 == 0) { > pr_warn("AT91: Secure PM: failed to get default mode\n"); > + soc_pm.data.mode = -1; As this variable's type is unsigned int setting it -1 will make at91_suspend_entering_slow_clock() return true all the time. Is this what you intend? Thank you, Claudiu Beznea > return; > } > > @@ -1119,6 +1121,7 @@ static void __init at91_pm_secure_init(void) > pm_modes[suspend_mode].pattern); > > soc_pm.data.suspend_mode = res.a1; > + soc_pm.data.mode = soc_pm.data.suspend_mode; > } > static const struct of_device_id atmel_shdwc_ids[] = { > { .compatible = "atmel,sama5d2-shdwc" },