Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/msm/dp: msm_dp_display_write_source_oui() checks buf after
  failed read
--

commit c144d1e3106d36ea14e6fc6fcc64c82cc7aaf9c0
Author: Jens Glathe <[email protected]>

drm/msm/dp: write the Qualcomm source OUI before eDP link bring-up

This commit writes the Qualcomm source OUI to DP_SOURCE_OUI for eDP
sinks in msm_dp_display_prepare_link() before link training, reading the
register first to skip the write if it already matches.

> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c 
> b/drivers/gpu/drm/msm/dp/dp_display.c
> index 29032fb61443e..d4bf60e7cec2e 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -628,6 +628,32 @@ static int msm_dp_display_set_mode(struct msm_dp 
> *msm_dp_display,

[ ... ]

> +static void msm_dp_display_write_source_oui(struct msm_dp_display_private 
> *dp)
> +{
> +     /* Not const: drm_dp_dpcd_write_data() takes a non-const buffer */
> +     u8 qcom_oui[] = { 0x8c, 0xfd, 0xf0 };
> +     u8 buf[sizeof(qcom_oui)] = {};
> +
> +     if (drm_dp_dpcd_read_data(dp->aux, DP_SOURCE_OUI, buf, sizeof(buf)) < 0)
> +             drm_dbg_dp(dp->drm_dev, "failed to read the source OUI\n");
> +
> +     if (!memcmp(buf, qcom_oui, sizeof(qcom_oui)))
> +             return;

[Severity: Low]
Should this memcmp() be in an else if branch so it does not inspect buf
when drm_dp_dpcd_read_data() fails?

On a short AUX read, msm_dp_aux_cmd_fifo_rx() stores each byte from
REG_DP_AUX_DATA before breaking on i != actual_i.  Neither
drm_dp_dpcd_access() nor the fallback in drm_dp_dpcd_read_data() clears
the buffer on error, so a failed read can leave buf matching qcom_oui.

If that happens, msm_dp_display_write_source_oui() returns early and
skips writing DP_SOURCE_OUI, leaving the panel's DPCD backlight controls
unresponsive until the next link bring-up.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/20261205-dp_send_qcom_oui-v1-1-b0b2332dd...@oldschoolsolutions.biz?part=1

Reply via email to