1 From f67dbf74cc7bce6d85b7c4b5b917c30f2dfc2626 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 5 Jul 2021 10:32:30 +0200
4 Subject: [PATCH] drm/vc4: hdmi: Warn if we access the controller while
7 We've had many silent hangs where the kernel would look like it just
8 stalled due to the access to one of the HDMI registers while the
9 controller was disabled.
11 Add a warning if we're about to do that so that it's at least not silent
14 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
16 drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 6 ++++++
17 1 file changed, 6 insertions(+)
19 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
20 +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
22 #ifndef _VC4_HDMI_REGS_H_
23 #define _VC4_HDMI_REGS_H_
25 +#include <linux/pm_runtime.h>
29 #define VC4_HDMI_PACKET_STRIDE 0x24
30 @@ -412,6 +414,8 @@ static inline u32 vc4_hdmi_read(struct v
31 const struct vc4_hdmi_variant *variant = hdmi->variant;
34 + WARN_ON(!pm_runtime_active(&hdmi->pdev->dev));
36 if (reg >= variant->num_registers) {
37 dev_warn(&hdmi->pdev->dev,
38 "Invalid register ID %u\n", reg);
39 @@ -438,6 +442,8 @@ static inline void vc4_hdmi_write(struct
40 const struct vc4_hdmi_variant *variant = hdmi->variant;
43 + WARN_ON(!pm_runtime_active(&hdmi->pdev->dev));
45 if (reg >= variant->num_registers) {
46 dev_warn(&hdmi->pdev->dev,
47 "Invalid register ID %u\n", reg);