From patchwork Mon Jul 18 21:54:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Gehnert X-Patchwork-Id: 1657737 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=MbYkiLwy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LmwkJ1Bf7z9sFr for ; Tue, 19 Jul 2022 07:55:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=suAmnrA1sbAolOsxr/qroXddwNnmjyU7B8Pj7APM2fA=; b=MbYkiLwyYQNYbx IsroEjlDLuJ7e2hJrI0JUI1bFx5SUMtOQjJW99U/lLyivPkCo7xFEpZJJEAhmNhzOiyC50spVJcNO wvz1aYO2qDULwNasOLJq4+rxZK1TPHtHC0uRwlSAkKkBJfq51i4QEJ/rmxjKwBbnHwPCkzgT0PbqA IQH2I1M++suWADGnmCu4kKkncGsJTKpvRF5kp0EemOhH3TXj7yyo07KSWJ3DBf2fGXmmPTDDTdxvY LeAV7F3Ph5SazePfoRa3RBa5x1jwON9BfI+jPtov/rofOy4Jaorzaox+Md7vEMKXRY7RNzkD2Fzsf HbcpauEmUSqUxCegpiTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDYhe-001lpU-5k; Mon, 18 Jul 2022 21:54:58 +0000 Received: from mail.tpi.com ([50.126.108.186]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDYhb-001lew-2I for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 21:54:56 +0000 Received: from sushi.tpi.com (sushi.tpi.com [10.0.0.212]) by mail.tpi.com (Postfix) with ESMTPA id E451347ECA5F; Mon, 18 Jul 2022 14:54:47 -0700 (PDT) From: Dean Gehnert To: Cc: Dean Gehnert , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: imx6: suspend: Use the size of imx6_suspend() function for fncpy() Date: Mon, 18 Jul 2022 14:54:26 -0700 Message-Id: <20220718215426.21501-1-deang@tpi.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_145455_142309_70A838AF X-CRM114-Status: GOOD ( 12.19 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Use the size of the imx6_suspend() function for fncpy() instead of the hard coded size of 'MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)'. Only need to copy the size of the imx6_suspend() function and no [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Use the size of the imx6_suspend() function for fncpy() instead of the hard coded size of 'MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)'. Only need to copy the size of the imx6_suspend() function and not extra code space beyond the function. Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Fixes: df595746fa69 ("ARM: imx: add suspend in ocram support for i.mx6q") Signed-off-by: Dean Gehnert --- arch/arm/mach-imx/common.h | 2 ++ arch/arm/mach-imx/pm-imx6.c | 2 +- arch/arm/mach-imx/suspend-imx6.S | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 13f3068e9845..c73152786ead 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -96,10 +96,12 @@ int imx_cpu_kill(unsigned int cpu); void imx53_suspend(void __iomem *ocram_vbase); extern const u32 imx53_suspend_sz; void imx6_suspend(void __iomem *ocram_vbase); +extern const u32 imx6_suspend_sz; #else static inline void imx53_suspend(void __iomem *ocram_vbase) {} static const u32 imx53_suspend_sz; static inline void imx6_suspend(void __iomem *ocram_vbase) {} +static const u32 imx6_suspend_sz; #endif void v7_cpu_resume(void); diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 045b9fdd342d..d467ca05b95f 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) imx6_suspend_in_ocram_fn = fncpy( suspend_ocram_base + sizeof(*pm_info), &imx6_suspend, - MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); + imx6_suspend_sz); __arm_iomem_set_ro(suspend_ocram_base, MX6Q_SUSPEND_OCRAM_SIZE); diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index e06f946b75b9..ee19ac288a90 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -328,3 +328,6 @@ resume: ret lr ENDPROC(imx6_suspend) + +ENTRY(imx6_suspend_sz) + .word . - imx6_suspend