Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1002727rdb; Fri, 20 Oct 2023 06:03:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH65HsRvkdnqVIKSdhpMKWS6lnj1ZB1GFfIn7VC6i4Cn0aaEplXYVt0bKpa/aBLm8EzLUl0 X-Received: by 2002:a17:903:18c:b0:1c9:d46e:d523 with SMTP id z12-20020a170903018c00b001c9d46ed523mr2252457plg.7.1697806995109; Fri, 20 Oct 2023 06:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697806995; cv=none; d=google.com; s=arc-20160816; b=J9GZEZdpNuEV57sOM05eL4xykE5YS0NtDH9fFgHLoAS+FrQ+YyHkSKxGanQhqf0Qgm dQSrznVML46SzQ1fnS7E/BpX6ROgmwfIX0mET7mSWHdjtOE2NmIG25jIIEZetxkXlQ1G a+thza28pHCPLQf3ffw9Aw2Sns0zgGVS+QXOCJZxZ9xoivK8vT6d/q/TpGhMv1zXuKib +nywVFtSOA7apGqtJ4JgYssanR1cO54FR0hxpNTwBqGgkreveOuQK1jokKI+HlPpe5QF UhlHtqN785lhbv2U1FWRY5wf1I/GwEyqul+rROUEKh8/KrE8kpPzhqbkj+Jb1tNBLJtm KC1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aJ6lRyFte6SRxSGEWtH+fbG11URdig+4dlQW94H/x40=; fh=XZ7GaZszX93a3SOkcv84cEZ3Lb1YRmXCnrmXBhPmEBk=; b=gZeQtyfiGU9XPv0oh4y5nx8bpHuooehd1JoXkIcDsUsFh26uqXSLdz+muWphUXlEyx gD5Fn3cG6M/pZV7iB1Ixtr6eqkQ3acxUp/OKtapsAJRFNSsq7oUkshAdHvdYYfnmgUqS rbRcHSP9LC2MQXt4RrVjvQbqnkDBcyGH4gz29JwCB4vjZv1UpJ2ck/OzWDYJYS+LmUYl MfEGH7A/+NPIQSNwfbP5XXEWeOoj+TG6/68nlQWsmpUY+EiOWFNJGJQIKP5GaiIMas1e /4Q4BCeMF8XAq2kHcBtmxi50Gflra5AIWOiRTRR6qPdfjpZpLdSVxhVolvoHDsznQR8h OPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DZFiaH9L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id n2-20020a170902d2c200b001b8ac52a19esi1911186plc.436.2023.10.20.06.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 06:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DZFiaH9L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8029C82FCE9F; Fri, 20 Oct 2023 06:02:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377332AbjJTNCl (ORCPT + 99 others); Fri, 20 Oct 2023 09:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377017AbjJTNCj (ORCPT ); Fri, 20 Oct 2023 09:02:39 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BBF9F for ; Fri, 20 Oct 2023 06:02:37 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 053FB1C0003; Fri, 20 Oct 2023 13:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697806955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aJ6lRyFte6SRxSGEWtH+fbG11URdig+4dlQW94H/x40=; b=DZFiaH9LfsR73LdWPiZxQehtQXehHaOPqtXb9iG+kDPTFhhm8/pS8En77JZZuo/UDf/haU 4IAAk+ea9lRKa3CrSszt+/gEM+z1o12tnjyxDmvZH5VAZzBbsMmOcGPQL56aB1zYRMgHW+ QUxdZBc2x3/R8LNakSRiqthHKWgzQzPtG86VqAmeDZLE0YMh9jmchi7vKeOwP0SOLkpYLZ p6mHh7nm9gcsomijwcbkeesbPfwOYZguFbSCJr/AM73QSe68tQ4iO4+g0QuRr8o/jT++NH xg86+j5lcjls9zHYdqMbtxntOkO34LD7llugO9MFemyBPkhJhb/5NhTQMi5ytg== From: thomas.perrot@bootlin.com To: Russell King , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clement.leger@bootlin.com, Thomas Perrot Subject: [PATCH] ARM: at91: pm: set soc_pm.data.mode in at91_pm_secure_init() Date: Fri, 20 Oct 2023 15:02:19 +0200 Message-ID: <20231020130219.1255937-1-thomas.perrot@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.perrot@bootlin.com 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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 06:02:50 -0700 (PDT) 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; 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" }, -- 2.41.0