1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/msm/dp
Douglas Anderson d03fcc1de0 drm/msm/dp: Avoid unpowered AUX xfers that caused crashes
If you happened to try to access `/dev/drm_dp_aux` devices provided by
the MSM DP AUX driver too early at bootup you could go boom. Let's
avoid that by only allowing AUX transfers when the controller is
powered up.

Specifically the crash that was seen (on Chrome OS 5.4 tree with
relevant backports):
  Kernel panic - not syncing: Asynchronous SError Interrupt
  CPU: 0 PID: 3131 Comm: fwupd Not tainted 5.4.144-16620-g28af11b73efb #1
  Hardware name: Google Lazor (rev3+) with KB Backlight (DT)
  Call trace:
   dump_backtrace+0x0/0x14c
   show_stack+0x20/0x2c
   dump_stack+0xac/0x124
   panic+0x150/0x390
   nmi_panic+0x80/0x94
   arm64_serror_panic+0x78/0x84
   do_serror+0x0/0x118
   do_serror+0xa4/0x118
   el1_error+0xbc/0x160
   dp_catalog_aux_write_data+0x1c/0x3c
   dp_aux_cmd_fifo_tx+0xf0/0x1b0
   dp_aux_transfer+0x1b0/0x2bc
   drm_dp_dpcd_access+0x8c/0x11c
   drm_dp_dpcd_read+0x64/0x10c
   auxdev_read_iter+0xd4/0x1c4

I did a little bit of tracing and found that:
* We register the AUX device very early at bootup.
* Power isn't actually turned on for my system until
  hpd_event_thread() -> dp_display_host_init() -> dp_power_init()
* You can see that dp_power_init() calls dp_aux_init() which is where
  we start allowing AUX channel requests to go through.

In general this patch is a bit of a bandaid but at least it gets us
out of the current state where userspace acting at the wrong time can
fully crash the system.
* I think the more proper fix (which requires quite a bit more
  changes) is to power stuff on while an AUX transfer is
  happening. This is like the solution we did for ti-sn65dsi86. This
  might be required for us to move to populating the panel via the
  DP-AUX bus.
* Another fix considered was to dynamically register / unregister. I
  tried that at <https://crrev.com/c/3169431/3> but it got
  ugly. Currently there's a bug where the pm_runtime() state isn't
  tracked properly and that causes us to just keep registering more
  and more.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20211109100403.1.I4e23470d681f7efe37e2e7f1a6466e15e9bb1d72@changeid
Signed-off-by: Rob Clark <robdclark@chromium.org>
2021-11-22 10:16:05 -08:00
..
dp_audio.c drm/msm/dp: initialize audio_comp when audio starts 2021-05-06 16:26:57 -07: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: Avoid unpowered AUX xfers that caused crashes 2021-11-22 10:16:05 -08:00
dp_aux.h drm/msm/dp: Handle aux timeouts, nacks, defers 2021-06-23 07:32:15 -07:00
dp_catalog.c drm/msm/dp: Store each subblock in the io region 2021-10-15 13:26:34 -07:00
dp_catalog.h drm/msm/dp: remove the repeated declaration 2021-06-23 07:33:53 -07:00
dp_ctrl.c drm/msm/dp: do not end dp link training until video is ready 2021-08-10 14:49:54 -07:00
dp_ctrl.h drm/msm: Convert to use resource-managed OPP API 2021-06-23 07:33:52 -07:00
dp_debug.c drm/msm/dp: Simplify the dp_debug debugfs show function 2021-10-15 16:48:19 -07: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/dp: Support up to 3 DP controllers 2021-10-18 14:28:30 -07:00
dp_display.h drm/msm/dp: Allow attaching a drm_panel 2021-10-18 14:28:30 -07:00
dp_drm.c drm/msm/dp: Allow attaching a drm_panel 2021-10-18 14:28:30 -07:00
dp_drm.h drm/msm/dp: add displayPort driver support 2020-09-15 10:54:34 -07:00
dp_hpd.c drm/msm/dp: Fix incorrect NULL check kbot warnings in DP driver 2021-04-07 11:05:44 -07:00
dp_hpd.h drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets 2020-09-15 10:54:34 -07:00
dp_link.c drm/msm/dp: add logs across DP driver for ease of debugging 2021-08-07 11:48:39 -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/msm/dp: Remove redundant initialization of variable bpp 2021-10-15 13:26:33 -07:00
dp_panel.h drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets 2020-09-15 10:54:34 -07:00
dp_parser.c drm/msm/dp: fix missing #include 2021-10-26 09:31:24 -07:00
dp_parser.h drm/msm/dp: Allow attaching a drm_panel 2021-10-18 14:28:30 -07:00
dp_power.c drm/msm/dp: add logs across DP driver for ease of debugging 2021-08-07 11:48:39 -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