scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler
authorNeil Armstrong <neil.armstrong@linaro.org>
Mon, 7 Apr 2025 10:17:05 +0000 (12:17 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 12 Apr 2025 01:23:12 +0000 (21:23 -0400)
commit3c7ac40d732232fec0ba31d0a5e3cc9c112fc2e7
treec36bda2e19ae91a2bb19aece5696431dd709b40d
parent2d6c7bcc6cca63238fce0a95874b053500a1112e
scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler

On systems with a large number request slots and unavailable MCQ ESI,
the current design of the interrupt handler can delay handling of other
subsystems interrupts causing display artifacts, GPU stalls or system
firmware requests timeouts.

Since the interrupt routine can take quite some time, it's preferable to
move it to a threaded handler and leave the hard interrupt handler wake
up the threaded interrupt routine, the interrupt line would be masked
until the processing is finished in the thread thanks to the
IRQS_ONESHOT flag.

When MCQ & ESI interrupts are enabled the I/O completions are now
directly handled in the "hard" interrupt routine to keep IOPs high since
queues handling is done in separate per-queue interrupt routines.

This fixes all encountered issued when running FIO tests on the Qualcomm
SM8650 platform.

Example of errors reported on a loaded system:
 [drm:dpu_encoder_frame_done_timeout:2706] [dpu error]enc32 frame done timeout
 msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1: hangcheck detected gpu lockup rb 2!
 msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1:     completed fence: 74285
 msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1:     submitted fence: 74286
 Error sending AMC RPMH requests (-110)

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250407-topic-ufs-use-threaded-irq-v3-3-08bee980f71e@linaro.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c