On 17.09.25 21:43, Nirmoy Das wrote:
The busy-waiting in `mdelay()` can cause CPU stalls and kernel timeouts
during boot.
Signed-off-by: Nirmoy Das <nirm...@nvidia.com>
Sending this as RFC as I am familiar with the code and not sure
I meant: I am not familiar with the code.
Adding more details:
Seeing below trace at boot time:
[ 49.908436] Workqueue: events work_for_cpu_fn
[ 49.908440] pstate: 83400009 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS
BTYPE=--)
[ 49.908443] pc : __delay+0x6c/0x118
[ 49.908449] lr : __delay+0x74/0x118
[ 49.908455] sp : ffff8000848af830
[ 49.908460] x29: ffff8000848af830 x28: ffffc42fa1fb2d70 x27:
ffff8001288c03d5
[ 49.908468] x26: 00000000000000ff x25: ffff000080a2e980 x24:
000000000000009d
[ 49.908472] x23: 0000000000418958 x22: ffffffd0004105a0 x21:
0000002fffc08100
[ 49.908475] x20: ffffc42fe7b1b348 x19: 00000000000f4247 x18:
ffff8000848c0088
[ 49.908478] x17: 0000000000000000 x16: ffffc42fe72655c8 x15:
0000000000000000
[ 49.908482] x14: 0000000000000000 x13: 20706f6f6c20726f x12:
6620676e69747261
[ 49.908485] x11: 747320646964655f x10: 0000000000000000 x9 :
ffffc42fe72654ec
[ 49.908489] x8 : 0000000000000000 x7 : 0000000000000000 x6 :
0000000000000000
[ 49.908492] x5 : 00000000000000ff x4 : 0000000000000000 x3 :
0000000000000000
[ 49.908496] x2 : 0000000000000000 x1 : 0000000000000000 x0 :
00000000000485c0
[ 49.908500] Call trace:
[ 49.908501] __delay+0x6c/0x118
[ 49.908504] __const_udelay+0x30/0x58
[ 49.908506] ast_astdp_read_edid+0x690/0xc68 [ast]
[ 49.908510] ast_astdp_connector_helper_get_modes+0x90/0x158 [ast]
[ 49.908515] drm_helper_probe_single_connector_modes+0x1ac/0x628
[ 49.908522] drm_client_modeset_probe+0x22c/0x1558
[ 49.908528] __drm_fb_helper_initial_config_and_unlock+0x60/0x550
[ 49.908530] drm_fb_helper_initial_config+0x4c/0x88
[ 49.908532] drm_fbdev_generic_client_hotplug+0xa4/0x110
[ 49.908535] drm_client_register+0x64/0xd0
[ 49.908540] drm_fbdev_generic_setup+0x134/0x1e0
[ 49.908545] ast_pci_probe+0x310/0x898 [ast]
[ 49.908548] local_pci_probe+0x4c/0xe0
[ 49.908552] work_for_cpu_fn+0x28/0x58
[ 49.908554] process_one_work+0x17c/0x448
[ 49.908556] worker_thread+0x360/0x480
[ 49.908557] kthread+0x11c/0x128
[ 49.908562] ret_from_fork+0x10/0x20
This also cause timeouts in other drivers because of this long udelay.
Regards,
Nirmoy
if this transition is safe.
---
drivers/gpu/drm/ast/ast_dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c
index 19c04687b0fe1..8e650a02c5287 100644
--- a/drivers/gpu/drm/ast/ast_dp.c
+++ b/drivers/gpu/drm/ast/ast_dp.c
@@ -134,7 +134,7 @@ static int ast_astdp_read_edid_block(void *data, u8 *buf,
unsigned int block, si
* 3. The Delays are often longer a lot when system
resume from S3/S4.
*/
if (j)
- mdelay(j + 1);
+ msleep(j + 1);
/* Wait for EDID offset to show up in mirror register */
vgacrd7 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd7);
--
2.43.0