From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16BA727B355; Mon, 18 Aug 2025 12:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755521737; cv=none; b=td8Es8RpRGKhmdotU/YxW+Di+yNslaOehOHkLxWPwdz4SRa/kIzDC9zHDA2keIr8mxepivWdCEvqRSfoYouQuOOGFECoQdapBvd5SLIvQC9htDuEITpQELDgyarXqsQlFKpZ/bAYfseWNUMa/9b1dTsW/4TPOVUB3m4LKtl6zzI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755521737; c=relaxed/simple; bh=P8UduvbrluisphzXh0HiyCR4AYpPJwJ5UWnQ8WxR+Ig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qb9UmBbbyvnVuivbADDcjYrAR8V5kqbDlektN8X3upC2O+LVlJphENxA3rMsiT5N+wjOaDjrfr3+9mAxY0FvNrO6b6HGYiRVNeO9UUctV2kNinewwQDd6kE7tBdFT4gAckPyr73LKnzXPvMue8bxOX75WLVihYdc4dtwtriaFvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SWalwWfd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SWalwWfd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45123C113D0; Mon, 18 Aug 2025 12:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755521736; bh=P8UduvbrluisphzXh0HiyCR4AYpPJwJ5UWnQ8WxR+Ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWalwWfdSklkYuyOG7eXEXOGmklx0X9Wn1tZvPGCQEEPkKrwKBlLkDUoQBrmIGZVN bQ1UsPoPvB0CsNNg4oIkvpx/ZBKwAa3IImpfQx99mW8OJwhUxpgwQNhaqiUWCDlKzL Z9MccyLCx0MyLWk0JfvK9zRPk7iCvLY3CbK6/sNs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peng Fan , Ulf Hansson , Hiago De Franco , Mathieu Poirier , Sasha Levin Subject: [PATCH 6.12 106/444] remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU Date: Mon, 18 Aug 2025 14:42:12 +0200 Message-ID: <20250818124452.913004215@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hiago De Franco [ Upstream commit 496deecb020d14ba89ba7084fbc3024f91687023 ] For the i.MX8X and i.MX8 family SoCs, when the Cortex-M core is powered up and started by the Cortex-A core using the bootloader (e.g., via the U-Boot bootaux command), both M-core and Linux run within the same SCFW (System Controller Firmware) partition. With that, Linux has permission to control the M-core. But once the M-core is started by the bootloader, the SCFW automatically enables its clock and sets the clock rate. If Linux later attempts to enable the same clock via clk_prepare_enable(), the SCFW returns a 'LOCKED' error, as the clock is already configured by the SCFW. This causes the probe function in imx_rproc.c to fail, leading to the M-core power domain being shut down while the core is still running. This results in a fault from the SCU (System Controller Unit) and triggers a system reset. To address this issue, ignore handling the clk for i.MX8X and i.MX8 M-core, as SCFW already takes care of enabling and configuring the clock. Suggested-by: Peng Fan Reviewed-by: Ulf Hansson Reviewed-by: Peng Fan Signed-off-by: Hiago De Franco Acked-by: Mathieu Poirier Link: https://lore.kernel.org/r/20250629172512.14857-3-hiagofranco@gmail.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/remoteproc/imx_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 800015ff7ff9..cc3f5b7fe9dd 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1029,8 +1029,8 @@ static int imx_rproc_clk_enable(struct imx_rproc *priv) struct device *dev = priv->dev; int ret; - /* Remote core is not under control of Linux */ - if (dcfg->method == IMX_RPROC_NONE) + /* Remote core is not under control of Linux or it is managed by SCU API */ + if (dcfg->method == IMX_RPROC_NONE || dcfg->method == IMX_RPROC_SCU_API) return 0; priv->clk = devm_clk_get(dev, NULL); -- 2.39.5