Hi James, Chenyu,

This fixes the dm_test_i2c_xfer_no_ddc_pin() crash I reported on
11-18 against commit 48b8c06b05ad ("drm/amd/display: Route connector
DDC over AUX for native DP sinks"):
https://lore.kernel.org/all/QU464501lRPW3X8es-jXBFOvvwqS3eKR3HRS33U6x6o5eYC6h5AKV7f3ZXRCaU7-sEcupJMHereqyDUsUSG_fsOMNwvGO_CcZRKsz1AgObk=@protonmail.com/

I think  moving the check to the top also turns off the AUX routing on
links that have no DDC pin. ddc_service_construct() leaves ddc_pin
NULL for USB4 DPIA links and for force_to_use_aux links (no_ddc_pin
on ASICs with dp_connector_no_native_i2c, i.e. DCN 4.2b and DCN 6.0).
Those connectors still get the hw i2c adapter as their "ddc" bus, and
AUX is the only way to reach the sink. With this patch, DDC/CI through
that bus fails with -EIO there again, and that's the case
48b8c06b05ad was written for (fwupd). I found this by reading the
code and haven't tested it on DPIA hardware.

Mario's v4 fixes the crash without  that side effect: it checks
ddc_service->link before using it and keeps the routing. It also
carries my test fix, which gives the test a zeroed dc_link:
https://lore.kernel.org/all/[email protected]/

Could this patch be dropped in favour of v4, or changed to check
ddc_service->link instead? If it stays as it is, could you please add
the tags below? These are some of my first kernel contributions, so
the credit would mean a lot to me.

Fixes: 48b8c06b05ad ("drm/amd/display: Route connector DDC over AUX for native 
DP sinks")
Reported-by: Eren Özen <[email protected]>
Closes: 
https://lore.kernel.org/all/QU464501lRPW3X8es-jXBFOvvwqS3eKR3HRS33U6x6o5eYC6h5AKV7f3ZXRCaU7-sEcupJMHereqyDUsUSG_fsOMNwvGO_CcZRKsz1AgObk=@protonmail.com/

Thanks,
Eren

Reply via email to