linux/drivers/gpu/drm/msm/dp
Kuogee Hsieh b7dcbca46d drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer
commit 1cba0d150f upstream.

There are 3 possible interrupt sources are handled by DP controller,
HPDstatus, Controller state changes and Aux read/write transaction.
At every irq, DP controller have to check isr status of every interrupt
sources and service the interrupt if its isr status bits shows interrupts
are pending. There is potential race condition may happen at current aux
isr handler implementation since it is always complete dp_aux_cmd_fifo_tx()
even irq is not for aux read or write transaction. This may cause aux read
transaction return premature if host aux data read is in the middle of
waiting for sink to complete transferring data to host while irq happen.
This will cause host's receiving buffer contains unexpected data. This
patch fixes this problem by checking aux isr and return immediately at
aux isr handler if there are no any isr status bits set.

Current there is a bug report regrading eDP edid corruption happen during
system booting up. After lengthy debugging to found that VIDEO_READY
interrupt was continuously firing during system booting up which cause
dp_aux_isr() to complete dp_aux_cmd_fifo_tx() prematurely to retrieve data
from aux hardware buffer which is not yet contains complete data transfer
from sink. This cause edid corruption.

Follows are the signature at kernel logs when problem happen,
EDID has corrupt header
panel-simple-dp-aux aux-aea0000.edp: Couldn't identify panel via EDID

Changes in v2:
-- do complete if (ret == IRQ_HANDLED) ay dp-aux_isr()
-- add more commit text

Changes in v3:
-- add Stephen suggested
-- dp_aux_isr() return IRQ_XXX back to caller
-- dp_ctrl_isr() return IRQ_XXX back to caller

Changes in v4:
-- split into two patches

Changes in v5:
-- delete empty line between tags

Changes in v6:
-- remove extra "that" and fixed line more than 75 char at commit text

Fixes: c943b4948b ("drm/msm/dp: add displayPort driver support")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/516121/
Link: https://lore.kernel.org/r/1672193785-11003-2-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-01-18 11:58:18 +01:00
..
dp_audio.c Merge tag 'drm-msm-next-2022-05-09' of https://gitlab.freedesktop.org/drm/msm into drm-next 2022-05-11 12:40:47 +10:00
dp_audio.h drm/msm/dp: add audio support for Display Port on MSM 2020-09-15 10:54:34 -07:00
dp_aux.c drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer 2023-01-18 11:58:18 +01:00
dp_aux.h Merge tag 'drm-msm-next-2022-05-09' of https://gitlab.freedesktop.org/drm/msm into drm-next 2022-05-11 12:40:47 +10:00
dp_catalog.c drm/msm/dp: correct 1.62G link rate at dp_catalog_ctrl_config_msa() 2022-09-18 09:38:04 -07:00
dp_catalog.h drm/msm/dp: wait for hpd high before aux transaction 2022-05-02 02:39:34 +03:00
dp_ctrl.c drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training 2022-09-30 16:57:53 +00:00
dp_ctrl.h drm/msm/dp: Remove pixel_rate from struct dp_ctrl 2022-09-18 09:38:04 -07:00
dp_debug.c drm/msm/dp: remove max_pclk_khz field from dp_panel/dp_display 2022-05-02 02:13:01 +03:00
dp_debug.h drm/msm/dp: Use the connector passed to dp_debug_get() 2021-10-15 16:40:09 -07:00
dp_display.c drm/msm: Use drm_mode_copy() 2022-12-31 13:33:01 +01:00
dp_display.h drm/msm/dp: Remove encoder pointer from struct msm_dp 2022-07-04 21:05:29 +03:00
dp_drm.c drm/msm/dp: add atomic_check to bridge ops 2022-09-30 16:57:53 +00:00
dp_drm.h drm/msm/dp: Remove encoder pointer from struct msm_dp 2022-07-04 21:05:29 +03:00
dp_hpd.c drm/msm/dp: Drop now unused hpd_high member 2021-11-29 16:19:58 -08:00
dp_hpd.h drm/msm/dp: Drop now unused hpd_high member 2021-11-29 16:19:58 -08:00
dp_link.c drm/msm/dp: Silence inconsistent indent warning 2022-09-18 09:38:04 -07:00
dp_link.h drm/msm/dp: DisplayPort PHY compliance tests fixup 2020-11-04 08:26:25 -08:00
dp_panel.c drm for 5.19-rc1 2022-05-25 16:18:27 -07:00
dp_panel.h drm for 5.19-rc1 2022-05-25 16:18:27 -07:00
dp_parser.c drm/msm/dp: fix bridge lifetime 2022-09-30 16:57:53 +00:00
dp_parser.h drm/msm/dp: fix bridge lifetime 2022-09-30 16:57:53 +00:00
dp_power.c Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
dp_power.h drm/msm/dp: Fixed couple of typos 2021-06-23 07:33:52 -07:00
dp_reg.h drm/msm/dp: return correct connection status after suspend 2020-11-10 12:38:58 -08:00