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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 BCEB2C433ED for ; Wed, 31 Mar 2021 14:46:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 5732061003 for ; Wed, 31 Mar 2021 14:46:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5732061003 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=desiato.20200630; 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=XU0GxH9nVEYvG4YgRSZFjXJh8hyzKHcauR6cQapn1ME=; b=prAUn6fSSVfTh354sFQPpMgY0 ZkGOa0hgtsrU26DcVR1OtFdZNWYwXmj/0Ge+8hEuPupm3U64exjyOwiPgX+D5kNIajXbZ+pQjusZt STLu/SZ/Ctg0lvkxa1Ca+EFFxefveORU1lyQszDO5sztL6G0yJfqjjtWTuENs4HzI7PPhO8s0yoPv WNvudxWiRWy1VhltJ4bA6ArkkbtTKgLqNiIBg3yN5sslWXyOFjuEr/NIzzcVis/cDWlbdX2FlBeJd r3EqaPWKUdcjD8xPWd8ZYWYN6BQiGgJr5nYGOnjiKo5iN3Wfnaq2Bt8ou0C8g2MPlmmtFbvJxkjWb fSokgIPPQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRc4u-006pHi-2c; Wed, 31 Mar 2021 14:44:16 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRc4o-006pH6-ER for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 14:44:13 +0000 Received: from localhost (lfbn-lyo-1-1679-174.w90-65.abo.wanadoo.fr [90.65.110.174]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 94CBE240012; Wed, 31 Mar 2021 14:44:05 +0000 (UTC) Date: Wed, 31 Mar 2021 16:44:04 +0200 From: Alexandre Belloni To: Claudiu Beznea Subject: Re: [PATCH 01/24] ARM: at91: pm: move pm_bu to soc_pm data structure Message-ID: References: <20210331105908.23027-1-claudiu.beznea@microchip.com> <20210331105908.23027-2-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210331105908.23027-2-claudiu.beznea@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_154410_541290_2EC1F34A X-CRM114-Status: GOOD ( 18.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, ludovic.desroches@microchip.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org 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 On 31/03/2021 13:58:45+0300, Claudiu Beznea wrote: > Move pm_bu to soc_pm data structure. > > Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni > --- > arch/arm/mach-at91/pm.c | 34 +++++++++++++++++++++------------- > 1 file changed, 21 insertions(+), 13 deletions(-) > > diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c > index 90dcdfe3b3d0..e13ceef7ac9a 100644 > --- a/arch/arm/mach-at91/pm.c > +++ b/arch/arm/mach-at91/pm.c > @@ -27,10 +27,25 @@ > #include "generic.h" > #include "pm.h" > > +/** > + * struct at91_pm_bu - AT91 power management backup unit data structure > + * @suspended: true if suspended to backup mode > + * @reserved: reserved > + * @canary: canary data for memory checking after exit from backup mode > + * @resume: resume API > + */ > +struct at91_pm_bu { > + int suspended; > + unsigned long reserved; > + phys_addr_t canary; > + phys_addr_t resume; > +}; > + > struct at91_soc_pm { > int (*config_shdwc_ws)(void __iomem *shdwc, u32 *mode, u32 *polarity); > int (*config_pmc_ws)(void __iomem *pmc, u32 mode, u32 polarity); > const struct of_device_id *ws_ids; > + struct at91_pm_bu *bu; > struct at91_pm_data data; > }; > > @@ -71,13 +86,6 @@ static int at91_pm_valid_state(suspend_state_t state) > > static int canary = 0xA5A5A5A5; > > -static struct at91_pm_bu { > - int suspended; > - unsigned long reserved; > - phys_addr_t canary; > - phys_addr_t resume; > -} *pm_bu; > - > struct wakeup_source_info { > unsigned int pmc_fsmr_bit; > unsigned int shdwc_mr_bit; > @@ -288,7 +296,7 @@ static int at91_suspend_finish(unsigned long val) > static void at91_pm_suspend(suspend_state_t state) > { > if (soc_pm.data.mode == AT91_PM_BACKUP) { > - pm_bu->suspended = 1; > + soc_pm.bu->suspended = 1; > > cpu_suspend(0, at91_suspend_finish); > > @@ -657,16 +665,16 @@ static int __init at91_pm_backup_init(void) > goto securam_fail; > } > > - pm_bu = (void *)gen_pool_alloc(sram_pool, sizeof(struct at91_pm_bu)); > - if (!pm_bu) { > + soc_pm.bu = (void *)gen_pool_alloc(sram_pool, sizeof(struct at91_pm_bu)); > + if (!soc_pm.bu) { > pr_warn("%s: unable to alloc securam!\n", __func__); > ret = -ENOMEM; > goto securam_fail; > } > > - pm_bu->suspended = 0; > - pm_bu->canary = __pa_symbol(&canary); > - pm_bu->resume = __pa_symbol(cpu_resume); > + soc_pm.bu->suspended = 0; > + soc_pm.bu->canary = __pa_symbol(&canary); > + soc_pm.bu->resume = __pa_symbol(cpu_resume); > > return 0; > > -- > 2.25.1 > -- Alexandre Belloni, co-owner and COO, 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