Re: [PATCH v4 drm-dp 3/8] drm/hisilicon/hibmc: Add dp serdes cfg in dp process

From: Dmitry Baryshkov
Date: Wed Mar 05 2025 - 15:18:10 EST


On Wed, Mar 05, 2025 at 07:26:42PM +0800, Yongbang Shi wrote:
> From: Baihan Li <libaihan@xxxxxxxxxx>
>
> Add dp serdes cfg in link training process, and related adapting
> and modificating. Change some init values about training,
> because we want completely to negotiation process, so we start with
> the maximum rate and the electrical characteristic level is 0.

In the commit message there should be a mention, why are you also
changing hibmc_kms_init().

>
> Signed-off-by: Baihan Li <libaihan@xxxxxxxxxx>
> Signed-off-by: Yongbang Shi <shiyongbang@xxxxxxxxxx>
> ---
> ChangeLog:
> v3 -> v4:
> - add comments for if-statement of dp_init(), suggested by Dmitry Baryshkov.
> v2 -> v3:
> - change commit to an imperative sentence, suggested by Dmitry Baryshkov.
> - put HIBMC_DP_HOST_SERDES_CTRL in dp_serdes.h, suggested by Dmitry Baryshkov.
> v1 -> v2:
> - splittting the patch and add more detailed the changes in the commit message, suggested by Dmitry Baryshkov.
> ---
> 1 | 0
> .../gpu/drm/hisilicon/hibmc/dp/dp_config.h | 1 +
> drivers/gpu/drm/hisilicon/hibmc/dp/dp_hw.c | 5 ++-
> drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.c | 32 ++++++++++++++++---
> drivers/gpu/drm/hisilicon/hibmc/dp/dp_reg.h | 5 +++
> .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 12 +++----
> 6 files changed, 43 insertions(+), 12 deletions(-)
> create mode 100644 1
>

[...]

> @@ -121,9 +119,11 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
> return ret;
> }
>
> - /* if DP existed, init DP */
> - if ((readl(priv->mmio + HIBMC_DP_HOST_SERDES_CTRL) &
> - HIBMC_DP_HOST_SERDES_CTRL_MASK) == HIBMC_DP_HOST_SERDES_CTRL_VAL) {
> + /* if the serdes reg is readable and is not equal to 0,
> + * DP existed, and init DP.
> + */

Nit: A typical format for block comments is:

/*
* Something Something Something
*/

Please follow it.

> + ret = readl(priv->mmio + HIBMC_DP_HOST_SERDES_CTRL);
> + if (ret) {
> ret = hibmc_dp_init(priv);
> if (ret)
> drm_err(dev, "failed to init dp: %d\n", ret);
> --
> 2.33.0
>

--
With best wishes
Dmitry