Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vc4: hdmi: Warn if we access the controller while disabled

We've had many silent hangs where the kernel would look like it just
stalled due to the access to one of the HDMI registers while the
controller was disabled.

Add a warning if we're about to do that so that it's at least not silent
anymore.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-7-maxime@cerno.tech

+6
+6
drivers/gpu/drm/vc4/vc4_hdmi_regs.h
··· 1 1 #ifndef _VC4_HDMI_REGS_H_ 2 2 #define _VC4_HDMI_REGS_H_ 3 3 4 + #include <linux/pm_runtime.h> 5 + 4 6 #include "vc4_hdmi.h" 5 7 6 8 #define VC4_HDMI_PACKET_STRIDE 0x24 ··· 414 412 const struct vc4_hdmi_variant *variant = hdmi->variant; 415 413 void __iomem *base; 416 414 415 + WARN_ON(!pm_runtime_active(&hdmi->pdev->dev)); 416 + 417 417 if (reg >= variant->num_registers) { 418 418 dev_warn(&hdmi->pdev->dev, 419 419 "Invalid register ID %u\n", reg); ··· 441 437 const struct vc4_hdmi_register *field; 442 438 const struct vc4_hdmi_variant *variant = hdmi->variant; 443 439 void __iomem *base; 440 + 441 + WARN_ON(!pm_runtime_active(&hdmi->pdev->dev)); 444 442 445 443 if (reg >= variant->num_registers) { 446 444 dev_warn(&hdmi->pdev->dev,