Hi Wayne, Mario,
48b8c06b05ad ("drm/amd/display: Route connector DDC over AUX for native
DP sinks") in amd-staging-drm-next is v2 of this patch, not v3 [1].
v3 added a NULL check on ddc_service->link. Without it, the existing
KUnit test dm_test_i2c_xfer_no_ddc_pin(), whose ddc_service has no link,
dereferences a NULL link and panics the UML kernel. sashiko-bot pointed
this out on v2 [2]. It reproduces on amd-staging-drm-next 8dd68a79583a:
RIP: 0033:amdgpu_dm_i2c_xfer+0x52/0x210
Kernel panic - not syncing: Segfault with no mm
...
dm_test_i2c_xfer_no_ddc_pin+0xaf/0x1e0
Only 670 of the 1931 amdgpu_dm tests get to run.
I don't think picking up v3 instead is the answer, though. From reading
the code, sashiko-bot's DP++ concern on v3 [3] looks right:
link->aux_mode is only written in detect_link_and_local_sink() after
detect_dp(), and nothing clears it on unplug. After a native DP monitor
is swapped for a passive DP++ HDMI adapter, the adapter ID read in
dp_passive_dongle_detection() would go over AUX. v2 doesn't have that
problem, because link_disconnect_sink() clears local_sink before
detect_dp().
In the driver, a non-OEM adapter always has ddc_service->link set
(amdgpu_dm_create_i2c() already dereferences it), so I think only the
test needs fixing. I can send a test-only patch that gives the test a
zeroed dc_link. With it, all three i2c_xfer tests pass and the suite
runs to the end again. Mario, if you'd rather fold it into a driver
follow-up, I'm happy to test that instead.
[1]
https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/
Thanks,
Eren