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 586CE196C7C; Tue, 26 Aug 2025 13:17:43 +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=1756214263; cv=none; b=JB8QBE4khBWzC2uT8JzG9rZzWuVbu9UmWsPwAmTy31FdOjm75L+hVykRB7u77fIvuw6ZXEKATdBmqXJAiBT5GgxuYGXBKs+SvsS3yWr4TxOM4jKZ16WWavhGHSv7ZrRBGOe4SK+QXGig3KV5j4SmGSVM2WIuoU+NbB6m/0gSk0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756214263; c=relaxed/simple; bh=l6Psrjm8K3yA8+nil4deEfb9NaejXiEfMUQv2nSryTQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bbTawz5TVXAAoeqMKy4hgutXa+VLfKQjUrLMyYQVaYZSqyOEOpRY+wuSC1WpBl5dJgiIvIqZe0oL1Mxv/bXKFvVo2pWx2kD/5U3+pewJz76wyOkgG0ufBJdffdQWcW5Mj9RP3lWGyyp3ql2sHqj1lLcJLpPhl+3tgvOdXIxUoEw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Z5M6+2hm; 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="Z5M6+2hm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0109C4CEF1; Tue, 26 Aug 2025 13:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756214263; bh=l6Psrjm8K3yA8+nil4deEfb9NaejXiEfMUQv2nSryTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z5M6+2hmhNNEAI3BKF9FPg/wslMZhKKd26l6iGbnIRimvp9pLv+cRk4/e/lxFhqWm Jcd+sotRdb1eqjHENFjbA7a+OJ0i9VLYVBKTtoV5BEbfBzz3+Y9kocyoYAXvZxznFX u6gMB6RpWYC3YdvAVGVaHZ4pEG0qW1hAjFMt6Yzk= 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.1 072/482] remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU Date: Tue, 26 Aug 2025 13:05:25 +0200 Message-ID: <20250826110932.614674335@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110930.769259449@linuxfoundation.org> References: <20250826110930.769259449@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.1-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 bbaba453383d..ff7acc326f09 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -750,8 +750,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