summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2024-01-31 11:57:49 +0100
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2024-02-14 14:05:26 +0000
commit67b6c2999005d53a64d97ac79538e3d6d23db2c0 (patch)
tree036af74e51f2e72eb7aa6b137f8d982f6c9407ac
parent5baa4a474ec80fc3207b4fd12834777078cd7115 (diff)
drm: imx8: fix hdmi firmware load boot error
When the FW is already loaded and running on the uCPU access to IRAM/DRAM from the Cortex A core is no longer granted. Trying to load the FW to IRAM/DRAM results in a asynchronous abort. Fix this by loading the FW only if the uCPU is still in reset. If the reset is deasserted assume that the FW is already loaded and do nothing. Note that asserting the reset and enabling access to IRAM/DRAM by writing '7' to APB_CTRL seems to be not enough to allow (re) writing the FW. The error was triggered by enabling both LVDS and HDMI. This resulted in cdns_mhdp_imx_probe being called twice, returning EPROBE_DEFER on the first invocation and then on the second invocation the FW is already loaded and the uCPU started. [ 7.407427] SError Interrupt on CPU0, code 0x00000000bf000002 -- SError [ 7.407443] CPU: 0 PID: 200 Comm: kworker/u10:4 Tainted: G C O 5.15.129-6.4.0-devel+git.3311382cb124 #1 [ 7.407452] Hardware name: Toradex Apalis iMX8QP V1.1 on Apalis Evaluation Board (DT) [ 7.407458] Workqueue: events_unbound deferred_probe_work_func [ 7.407478] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 7.407486] pc : mutex_unlock+0x44/0x70 [ 7.407498] lr : cdns_mhdp_bus_write+0xa4/0x100 [cdns_mhdp_drmcore] [ 7.407536] sp : ffff80000b19b910 [ 7.407539] x29: ffff80000b19b910 x28: ffff00000324e550 x27: ffff00001b2df700 [ 7.407549] x26: 0000000000000000 x25: ffff80000109f1c0 x24: ffff000003a2a120 [ 7.407558] x23: ffff000003a28080 x22: 0000000022222211 x21: ffff000003a28d88 [ 7.407567] x20: 0000000000000004 x19: ffff000003a28080 x18: 0000000000000001 [ 7.407576] x17: 3038363236353a32 x16: 3a64706e65673a64 x15: 00007de44ad2f95c [ 7.407584] x14: 0000000000000008 x13: 0000000000000008 x12: 0000000000000000 [ 7.407593] x11: 0000000000000001 x10: 00000000000009e0 x9 : ffff80000b19b810 [ 7.407601] x8 : ffff000002801880 x7 : ffff00007fb0a440 x6 : 0000000000000000 [ 7.407610] x5 : 0000000000220000 x4 : 0000000000000000 x3 : ffff000003a28d88 [ 7.407618] x2 : 0000000000000000 x1 : ffff000002800e40 x0 : ffff000002800e40 [ 7.407629] Kernel panic - not syncing: Asynchronous SError Interrupt [ 7.407634] CPU: 0 PID: 200 Comm: kworker/u10:4 Tainted: G C O 5.15.129-6.4.0-devel+git.3311382cb124 #1 [ 7.407641] Hardware name: Toradex Apalis iMX8QP V1.1 on Apalis Evaluation Board (DT) [ 7.407644] Workqueue: events_unbound deferred_probe_work_func [ 7.407652] Call trace: [ 7.407654] dump_backtrace+0x0/0x1e0 [ 7.407667] show_stack+0x18/0x40 [ 7.407674] dump_stack_lvl+0x68/0x84 [ 7.407683] dump_stack+0x18/0x34 [ 7.407690] panic+0x188/0x348 [ 7.407696] add_taint+0x0/0xc0 [ 7.407706] arm64_serror_panic+0x6c/0x7c [ 7.407711] do_serror+0x58/0x5c [ 7.407716] el1h_64_error_handler+0x30/0x50 [ 7.407722] el1h_64_error+0x78/0x7c [ 7.407728] mutex_unlock+0x44/0x70 [ 7.407734] cdns_mhdp_firmware_write_section+0x74/0xa0 [cdns_mhdp_imx] [ 7.407749] cdns_mhdp_firmware_init_imx8qm+0xac/0x1c0 [cdns_mhdp_imx] [ 7.407759] __cdns_hdmi_probe+0x174/0x37c [cdns_mhdp_drmcore] [ 7.407786] cdns_hdmi_bind+0x28/0x90 [cdns_mhdp_drmcore] [ 7.407810] cdns_mhdp_imx_bind+0xe4/0x170 [cdns_mhdp_imx] [ 7.407821] component_bind_all+0x124/0x284 [ 7.407829] imx_drm_bind+0x15c/0x20c [ 7.407837] try_to_bring_up_master+0x228/0x314 [ 7.407843] __component_add+0xa0/0x18c [ 7.407849] component_add+0x14/0x20 [ 7.407855] cdns_mhdp_imx_probe+0x1c/0x30 [cdns_mhdp_imx] [ 7.407865] platform_probe+0x68/0xe0 [ 7.407872] really_probe+0xbc/0x46c [ 7.407877] __driver_probe_device+0x104/0x160 [ 7.407883] driver_probe_device+0x40/0x120 [ 7.407888] __device_attach_driver+0xbc/0x160 [ 7.407894] bus_for_each_drv+0x78/0xd0 [ 7.407903] __device_attach+0xa8/0x1e4 [ 7.407909] device_initial_probe+0x14/0x20 [ 7.407914] bus_probe_device+0x98/0xa0 [ 7.407920] deferred_probe_work_func+0x94/0xe4 [ 7.407925] process_one_work+0x1d0/0x374 [ 7.407932] worker_thread+0x13c/0x490 [ 7.407937] kthread+0x150/0x160 [ 7.407945] ret_from_fork+0x10/0x20 [ 7.407954] SMP: stopping secondary CPUs [ 7.411611] Kernel Offset: disabled [ 7.411613] CPU features: 0x4,000820b1,20000846 [ 7.411618] Memory Limit: none Upstream-Status: Inappropriate [other] Upstream does not have a driver for the cadence HDMI IP. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
index 20fc9f90a0ae..9fce234951b0 100644
--- a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
+++ b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
@@ -570,6 +570,12 @@ static int cdns_mhdp_firmware_load(struct imx_mhdp_device *imx_mhdp)
if (!imx_mhdp->firmware_name)
goto out;
+ /* test if ucpu is already running and if so skip fw loading */
+ if (!cdns_mhdp_bus_read(&imx_mhdp->mhdp, APB_CTRL)) {
+ DRM_INFO("HDMI uCPU already running, skipping FW load.\n");
+ goto out;
+ }
+
if (!imx_mhdp->fw) {
ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOUEVENT,
imx_mhdp->firmware_name,