Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1076267rdb; Fri, 20 Oct 2023 07:52:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKnKrXx1ZeXXs1/Zlcsqj/1TPhCvj9RBV8tTrT5hKIUYz7G2d0/ZJZCL7vQD7sywYu+1Sc X-Received: by 2002:a05:6a21:9988:b0:13f:c40c:379 with SMTP id ve8-20020a056a21998800b0013fc40c0379mr2428975pzb.13.1697813529458; Fri, 20 Oct 2023 07:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697813529; cv=none; d=google.com; s=arc-20160816; b=TW08KycBbHB1B1QTKs74I/nGItZBKKlpiVGhvrUYvksuKG/Z5zUB8NlHRoquh1Kd3q uYRZNvuEYSxaXIzgpjUglGZNR/mVxop4KTVMmz/VjcmKbfQgkAuF/zySmm1Eu1DBQeUW RkhYyAgTyRNkK2++EzxfBVKiDJplQ+F1XeiqvH4xNgtDpKjm/o5ijvOY5pGdw9ZCxy3A 8DrQ4o1aIVWEqv6TyMvUEOzQU+oneldurBJMpyeqkHj70Lo1C4ewWf2HXomxvYh1JQqz 90ncc60Oo4egesgISb+FAHuJ4ZsmT/fOC5MaYqCGIB69t339JBE5GL4RD8m2bOWxXVd4 S5GQ== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=F3OUoSbU4upTlP3qLMLPXWm6DFRDSgS8ChPeZ+Z7FKc=; fh=xRsNFNR9ul9SQRwvPLgLfNYzPJ6C5m09c/f35fUY3cs=; b=ILG47CU20xuvGVhvsEHbTg76NKxV9wIOfQnMbZIfnZ3tmiE7MUUx6Yo7bMLNx9zeCK vtNqeceLLq1uAx5PQ4EHJIXbyAHYUtgTLEt6nhCJxFBmJokD9T4g5ga3LLSAHlUAUckX 3qDBBNUSG6Sm+jNxjZ9z0ip53GocUzPYb9ayR4pHF7sKUiChyV1i3GWvLVfZoTFU0WAR j9g/k4xD3DGa10kNz1fFHKUcIm/kgrv//XELvwIPZ/SZoB5LU6EDxj5y4Wh5wfoLlAhB BKO+cdL+g33icA02bmVrul80rOzm+gE1awPWOOZGbDMh58fzNycD9Su9BjIv5stSEXG5 jm9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=WFYQVW+9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b6-20020a056a000cc600b00690d8405fe2si2235379pfv.60.2023.10.20.07.52.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 07:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=WFYQVW+9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2820880A8B62; Fri, 20 Oct 2023 07:51:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377545AbjJTOvW (ORCPT + 99 others); Fri, 20 Oct 2023 10:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377599AbjJTOvV (ORCPT ); Fri, 20 Oct 2023 10:51:21 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C7CAD5D for ; Fri, 20 Oct 2023 07:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1697813478; x=1729349478; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ZNx7aKNxR1JCdM0GYnzARAWZKmT7PvTlnU+feFxDyT4=; b=WFYQVW+9tPkOkY1gqtttrvBwgVulFXL2YT8LDj18Egc9lmRi852V7zcD WVfODf0rz1VUmeumJOpD2tdr+PF/peL8ju5jTF2aK6Xv0HmZwg0d6DbZL mEgp5EdN6LnoHGfZn8suNyjfc4kytjr+DiN3LWMeY4ikKf35X2wvxF4DF zRTeB7I69+PyWd9POLAy/y8wwAGLD9crPvKoBZqYGCjL5sxWLpKNX0QY6 gS0V+/cyC+Iie+qFBweFj/6Z2i2nY1RSWy7unKrMbaWadKQMhuHrPHz9G u0BQtBTEFjfCY9UDK5IIgban4ruHA3L3hMxJ3rx92ybwcCnR3Drvztj0t w==; X-CSE-ConnectionGUID: ocJDPVuyT8exT4se+Y40Zg== X-CSE-MsgGUID: S1v/16qyQ5i12ueTSkBl9Q== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="241093098" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 20 Oct 2023 07:51:17 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 20 Oct 2023 07:50:55 -0700 Received: from [10.159.245.205] (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 20 Oct 2023 07:50:54 -0700 Message-ID: <30ea0614-3384-46a7-9a0e-8a96b97c985d@microchip.com> Date: Fri, 20 Oct 2023 16:50:27 +0200 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, fr-FR To: , Russell King , Alexandre Belloni , Claudiu Beznea CC: , , References: <20231020130219.1255937-1-thomas.perrot@bootlin.com> From: Nicolas Ferre Organization: microchip In-Reply-To: <20231020130219.1255937-1-thomas.perrot@bootlin.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 07:51:26 -0700 (PDT) On 20/10/2023 at 15:02, thomas.perrot@bootlin.com wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > 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 Acked-by: Nicolas Ferre Thanks, best regards, Nicolas > --- > 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 >