drm/mediatek: dp: Enable event interrupt only when bridge attached
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 25 Jul 2023 07:32:29 +0000 (09:32 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 9 Aug 2023 23:17:59 +0000 (23:17 +0000)
commit779b8d20ca6fe62fe45da726c86ed1a1368cf313
tree8b23178e584c9aa92eb6974f0a05a34b2d6c3fa7
parentc3b9d21ef501ebba53c402beaf3a78572214b188
drm/mediatek: dp: Enable event interrupt only when bridge attached

It is useless and error-prone to enable the DisplayPort event interrupt
before finishing to probe and install the driver, as the DP training
cannot happen before the entire pipeline is correctly set up, as the
interrupt handler also requires the full hardware to be initialized by
mtk_dp_bridge_attach().

Anyway, depending in which state the controller is left from the
bootloader, this may cause an interrupt storm and consequently hang
the kernel during boot, so, avoid enabling the interrupt until we
reach a clean state by adding the IRQ_NOAUTOEN flag before requesting
it at probe time and manage the enablement of the ISR in the .attach()
and .detach() handlers for the DP bridge.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230725073234.55892-7-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_dp.c