From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0D8C433E0 for ; Tue, 4 Aug 2020 11:43:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3185020738 for ; Tue, 4 Aug 2020 11:43:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CNhBV7eO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3185020738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V/hbdi2MiMVjTnMwrVWbR0MynXxRchDLywabF3hNTgw=; b=CNhBV7eOhZIwYUUMSLXKVEI1r 8Ajj+6vYZ8y23lzkWIrtsVQu2wbrLG3MbL4qjBHBlJ+4FbtzzMl7rUFkeyrzgtTNfXmTSe2aIgaOu m7KYELLyB1VfQ+c2dy3rHfcXfCoN7Zqyzm0ZqmuSJaZj8hMrqbYfOqtN9daerKzCk/960L4r9GlPN bCvrM/kedfVF9aCQ7///Ju/yaJbN8UdGDZb2HVvYskseQ5daHOUATb/S5J1ZLSHQSMVpbsqiYB6vd VcXAbgDr4YVN1E1t6zmlsMzPoZ2nX3emricUEkNTm5G7rrqhhg5zGu2cCdTnJSLr+WpEZ+tl/TQHt MSpQrA8rQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2vKy-00079Y-3b; Tue, 04 Aug 2020 11:42:32 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2vKu-00078x-Mh for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2020 11:42:30 +0000 Received: from localhost (lfbn-lyo-1-1932-79.w90-66.abo.wanadoo.fr [90.66.108.79]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0F74B100004; Tue, 4 Aug 2020 11:42:23 +0000 (UTC) Date: Tue, 4 Aug 2020 13:42:23 +0200 From: Alexandre Belloni To: Claudiu Beznea Subject: Re: [PATCH v2 2/3] ARM: at91: pm: add per soc validation of pm modes Message-ID: <20200804114223.GC7836@piout.net> References: <1596539258-20719-1-git-send-email-claudiu.beznea@microchip.com> <1596539258-20719-3-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1596539258-20719-3-git-send-email-claudiu.beznea@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200804_074228_838569_F905C2E9 X-CRM114-Status: GOOD ( 14.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-arm-kernel@lists.infradead.org, wenyou.yang@atmel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, On 04/08/2020 14:07:37+0300, Claudiu Beznea wrote: > void __init at91rm9200_pm_init(void) > { > + static const int modes[] __initconst = { You don't need that to be static as it is now local to the function. > + AT91_PM_STANDBY, AT91_PM_ULP0 > + }; > + > if (!IS_ENABLED(CONFIG_SOC_AT91RM9200)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); For rm9200 and at91sam9, I would not allow changing the pm_modes and simply enforce standby_mode = AT91_PM_STANDBY and suspend_mode = AT91_PM_ULP0. I don't think you have any user that ever changed that behaviour also that avoids increasing the boot time for those slow SoCs. > at91_dt_ramc(); > > /* > @@ -838,9 +888,14 @@ void __init at91rm9200_pm_init(void) > > void __init sam9x60_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, AT91_PM_ULP1, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_SAM9X60)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_pm_modes_init(); > at91_dt_ramc(); > at91_pm_init(at91sam9x60_idle); > @@ -851,14 +906,19 @@ void __init sam9x60_pm_init(void) > > void __init at91sam9_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_AT91SAM9)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_dt_ramc(); > at91_pm_init(at91sam9_idle); > } > > -void __init sama5_pm_init(void) > +static void __init sama5_pm(void) > { > if (!IS_ENABLED(CONFIG_SOC_SAMA5)) > return; > @@ -867,13 +927,32 @@ void __init sama5_pm_init(void) > at91_pm_init(NULL); > } > > +void __init sama5_pm_init(void) > +{ > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, > + }; > + > + if (!IS_ENABLED(CONFIG_SOC_SAMA5)) > + return; > + > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > + sama5_pm(); > +} > + > void __init sama5d2_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, AT91_PM_ULP1, > + AT91_PM_BACKUP, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_SAMA5D2)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_pm_modes_init(); > - sama5_pm_init(); > + sama5_pm(); I would call those two directly: at91_dt_ramc(); at91_pm_init(NULL); instead of having a function that doesn't do much. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BD68C433DF for ; Tue, 4 Aug 2020 11:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35C0020738 for ; Tue, 4 Aug 2020 11:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730148AbgHDLm2 (ORCPT ); Tue, 4 Aug 2020 07:42:28 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:42973 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728028AbgHDLm1 (ORCPT ); Tue, 4 Aug 2020 07:42:27 -0400 Received: from localhost (lfbn-lyo-1-1932-79.w90-66.abo.wanadoo.fr [90.66.108.79]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0F74B100004; Tue, 4 Aug 2020 11:42:23 +0000 (UTC) Date: Tue, 4 Aug 2020 13:42:23 +0200 From: Alexandre Belloni To: Claudiu Beznea Cc: nicolas.ferre@microchip.com, ludovic.desroches@microchip.com, wenyou.yang@atmel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] ARM: at91: pm: add per soc validation of pm modes Message-ID: <20200804114223.GC7836@piout.net> References: <1596539258-20719-1-git-send-email-claudiu.beznea@microchip.com> <1596539258-20719-3-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596539258-20719-3-git-send-email-claudiu.beznea@microchip.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 04/08/2020 14:07:37+0300, Claudiu Beznea wrote: > void __init at91rm9200_pm_init(void) > { > + static const int modes[] __initconst = { You don't need that to be static as it is now local to the function. > + AT91_PM_STANDBY, AT91_PM_ULP0 > + }; > + > if (!IS_ENABLED(CONFIG_SOC_AT91RM9200)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); For rm9200 and at91sam9, I would not allow changing the pm_modes and simply enforce standby_mode = AT91_PM_STANDBY and suspend_mode = AT91_PM_ULP0. I don't think you have any user that ever changed that behaviour also that avoids increasing the boot time for those slow SoCs. > at91_dt_ramc(); > > /* > @@ -838,9 +888,14 @@ void __init at91rm9200_pm_init(void) > > void __init sam9x60_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, AT91_PM_ULP1, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_SAM9X60)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_pm_modes_init(); > at91_dt_ramc(); > at91_pm_init(at91sam9x60_idle); > @@ -851,14 +906,19 @@ void __init sam9x60_pm_init(void) > > void __init at91sam9_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_AT91SAM9)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_dt_ramc(); > at91_pm_init(at91sam9_idle); > } > > -void __init sama5_pm_init(void) > +static void __init sama5_pm(void) > { > if (!IS_ENABLED(CONFIG_SOC_SAMA5)) > return; > @@ -867,13 +927,32 @@ void __init sama5_pm_init(void) > at91_pm_init(NULL); > } > > +void __init sama5_pm_init(void) > +{ > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, > + }; > + > + if (!IS_ENABLED(CONFIG_SOC_SAMA5)) > + return; > + > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > + sama5_pm(); > +} > + > void __init sama5d2_pm_init(void) > { > + static const int modes[] __initconst = { > + AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, AT91_PM_ULP1, > + AT91_PM_BACKUP, > + }; > + > if (!IS_ENABLED(CONFIG_SOC_SAMA5D2)) > return; > > + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); > at91_pm_modes_init(); > - sama5_pm_init(); > + sama5_pm(); I would call those two directly: at91_dt_ramc(); at91_pm_init(NULL); instead of having a function that doesn't do much. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com