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 1752E221726; Tue, 26 Aug 2025 12:54:07 +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=1756212847; cv=none; b=Dcu3vKqty8Ua3LevkH7OwzBlwNN18FvVboStyUWZCMaDHYoXBJXeWJPf68mjwIIAYZ+hMlQg3/yMpjhaBKrmh5tJgs0BArUKrDwjveC5TpO79922uaU8MajbbBsebXHsDczTTJDqJzlrDRj4Hv5LT0B3NffYV/paoBscHdT+JdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756212847; c=relaxed/simple; bh=MwgnKaC8qUJwie9RTcW7dW+abjp95hXTg03jC6aEGd8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aHdLD04WPtk6dW0HfhiU3mEOckGDM2mDCi59BdcG4VPJFYjUdBDrtw5TrR2ZcVYZ2cEvyh1vWdlzXTWjs94TVi7BnMUgOlJMo8YdWU7avjEjIvioJPgX9TxsobGoD7A0qHp74wbHBPosERJK1srNAeM+MWFVLYHFt1AbRxAL3dU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=glNQte6s; 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="glNQte6s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CB59C4CEF1; Tue, 26 Aug 2025 12:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756212847; bh=MwgnKaC8qUJwie9RTcW7dW+abjp95hXTg03jC6aEGd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glNQte6stE+DVLu4kKtQwBtsS7yikxVtPBjNXy0Bt3Pw27y80BPNEf3zkbBCR22Vz 4W0n1xB5/NE0ZxuiBeza6dxjD6a/qDlgz3DrHtNZnaOroi3mP6S+ONGgitgIvZ2X/g 4yKJ75QWGoZfBeapG8tcK2bK5/07vmXo03i9GMVQ= 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.6 093/587] remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU Date: Tue, 26 Aug 2025 13:04:02 +0200 Message-ID: <20250826110955.303308652@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110952.942403671@linuxfoundation.org> References: <20250826110952.942403671@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.6-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 610a69928dff..251f9840d85b 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1088,8 +1088,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