mirror_ubuntu-kernels/drivers/gpu/drm/msm
Douglas Anderson bfc12020e6 drm/msm/dp: Return IRQ_NONE for unhandled interrupts
If our interrupt handler gets called and we don't really handle the
interrupt then we should return IRQ_NONE. The current interrupt
handler didn't do this, so let's fix it.

NOTE: for some of the cases it's clear that we should return IRQ_NONE
and some cases it's clear that we should return IRQ_HANDLED. However,
there are a few that fall somewhere in between. Specifically, the
documentation for when to return IRQ_NONE vs. IRQ_HANDLED is probably
best spelled out in the commit message of commit d9e4ad5bad ("Document
that IRQ_NONE should be returned when IRQ not actually handled"). That
commit makes it clear that we should return IRQ_HANDLED if we've done
something to make the interrupt stop happening.

The case where it's unclear is, for instance, in dp_aux_isr() after
we've read the interrupt using dp_catalog_aux_get_irq() and confirmed
that "isr" is non-zero. The function dp_catalog_aux_get_irq() not only
reads the interrupts but it also "ack"s all the interrupts that are
returned. For an "unknown" interrupt this has a very good chance of
actually stopping the interrupt from happening. That would mean we've
identified that it's our device and done something to stop them from
happening and should return IRQ_HANDLED. Specifically, it should be
noted that most interrupts that need "ack"ing are ones that are
one-time events and doing an "ack" is enough to clear them. However,
since these interrupts are unknown then, by definition, it's unknown
if "ack"ing them is truly enough to clear them. It's possible that we
also need to remove the original source of the interrupt. In this
case, IRQ_NONE would be a better choice.

Given that returning an occasional IRQ_NONE isn't the absolute end of
the world, however, let's choose that course of action. The IRQ
framework will forgive a few IRQ_NONE returns now and again (and it
won't even log them, which is why we have to log them ourselves). This
means that if we _do_ end hitting an interrupt where "ack"ing isn't
enough the kernel will eventually detect the problem and shut our
device down.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/520660/
Link: https://lore.kernel.org/r/20230126170745.v2.2.I2d7aec2fadb9c237cd0090a47d6a8ba2054bf0f8@changeid
[DB: reformatted commit message to make checkpatch happy]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-04-06 20:29:44 +03:00
..
adreno drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error 2023-04-03 07:40:04 -07:00
disp drm/msm/atomic: Switch to vblank_start helper 2023-03-28 15:46:15 -07:00
dp drm/msm/dp: Return IRQ_NONE for unhandled interrupts 2023-04-06 20:29:44 +03:00
dsi drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
hdmi drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
Kconfig drm/msm/a6xx: add CONFIG_PM dependency 2023-03-25 11:27:20 -07:00
Makefile drm/msm/dp: rewrite dss_module_power to use bulk clock functions 2022-07-04 21:05:28 +03:00
msm_atomic_trace.h
msm_atomic_tracepoints.c
msm_atomic.c drm/msm: Check for NULL before calling prepare_commit() 2023-04-06 20:29:24 +03:00
msm_debugfs.c drm/msm/gpu: Add devfreq tuning debugfs 2023-01-16 10:40:18 -08:00
msm_debugfs.h
msm_drv.c drm/msm: Add wait-boost support 2023-03-28 15:46:15 -07:00
msm_drv.h Merge branch 'msm-next-lumag' into HEAD 2023-01-22 22:43:59 +02:00
msm_fb.c drm: Drop drm_framebuffer.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
msm_fbdev.c msm/fbdev: fix unused variable warning with clang. 2023-02-23 09:48:05 +10:00
msm_fence.c drm/msm: Add deadline based boost support 2023-03-28 15:46:15 -07:00
msm_fence.h drm/msm: Add deadline based boost support 2023-03-28 15:46:15 -07:00
msm_gem_prime.c drm/msm/gem: Rename to pin/unpin_pages 2022-08-27 09:32:44 -07:00
msm_gem_shrinker.c drm/msm: Enable unpin/eviction by default 2022-11-17 10:39:12 -08:00
msm_gem_submit.c drm/msm: Use idr_preload() 2023-03-25 16:31:44 -07:00
msm_gem_vma.c drm/msm: Decouple vma tracking from obj lock 2023-03-25 16:31:44 -07:00
msm_gem.c drm/msm: Add wait-boost support 2023-03-28 15:46:15 -07:00
msm_gem.h drm/msm/gem: Avoid obj lock in job_run() 2023-03-25 16:31:44 -07:00
msm_gpu_devfreq.c drm/msm/adreno: Use OPP for every GPU generation 2023-03-20 11:04:59 -07:00
msm_gpu_trace.h drm/msm/gem: Evict active GEM objects when necessary 2022-08-27 09:32:45 -07:00
msm_gpu_tracepoints.c
msm_gpu.c drm/msm/adreno: Use OPP for every GPU generation 2023-03-20 11:04:59 -07:00
msm_gpu.h drm/msm/gpu: Move BO allocation out of hw_init 2023-03-25 16:31:45 -07:00
msm_gpummu.c
msm_io_utils.c drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices 2022-09-18 09:38:02 -07:00
msm_iommu.c drm/msm/adreno: stall translation on fault for all GPU families 2023-03-28 15:49:09 -07:00
msm_kms.h drm/msm/atomic: Switch to vblank_start helper 2023-03-28 15:46:15 -07:00
msm_mdss.c drm/msm: mdss: add support for SM8550 2023-01-12 21:45:17 +02:00
msm_mmu.h drm/msm/adreno: stall translation on fault for all GPU families 2023-03-28 15:49:09 -07:00
msm_perf.c
msm_rd.c drm/msm/rd: Fix FIFO-full deadlock 2022-09-18 09:37:55 -07:00
msm_ringbuffer.c drm/msm/gem: Avoid obj lock in job_run() 2023-03-25 16:31:44 -07:00
msm_ringbuffer.h drm/msm: Hangcheck progress detection 2022-11-17 10:39:12 -08:00
msm_submitqueue.c drm/msm: Switch idr_lock to spinlock 2023-03-25 16:31:44 -07:00
NOTES