mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "Peng Liu (刘鹏)" <Peng.Liu@mediatek.com>,
	"Mac Shen (沈俊)" <Mac.Shen@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
	"LIANKUN YANG (杨连坤)" <Liankun.Yang@mediatek.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"msp@baylibre.com" <msp@baylibre.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"dmitry.osipenko@collabora.com" <dmitry.osipenko@collabora.com>,
	"Rex-BC Chen (陳柏辰)" <Rex-BC.Chen@mediatek.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v1 1/1] drm/mediatek: Add return value check when reading DPCD
Date: Tue, 22 Oct 2024 10:05:04 +0000	[thread overview]
Message-ID: <7d712b16109d3a2c8a5704ad8988f961b71a40b2.camel@mediatek.com> (raw)
In-Reply-To: <20240930092000.5385-1-liankun.yang@mediatek.com>

Hi, Liankun:

On Mon, 2024-09-30 at 17:17 +0800, Liankun Yang wrote:
> Returns the number of bytes transferred (1) on success.
> Check the return value to confirm that AUX communication is successful.
> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")

Fixes: d9e6ea02fc3f ("drm/mediatek: dp: Add MT8195 External DisplayPort support")

Regards,
CK

> 
> Signed-off-by: Liankun Yang <liankun.yang@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index d8796a904eca..3cab65345d1e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2018,6 +2018,7 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
>  	enum drm_connector_status ret = connector_status_disconnected;
>  	bool enabled = mtk_dp->enabled;
>  	u8 sink_count = 0;
> +	size_t value;
>  
>  	if (!mtk_dp->train_info.cable_plugged_in)
>  		return ret;
> @@ -2032,7 +2033,12 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
>  	 * function, we just need to check the HPD connection to check
>  	 * whether we connect to a sink device.
>  	 */
> -	drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> +	value = drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> +	if (value < 0) {
> +		drm_err(mtk_dp->drm_dev, "Failed to read DP Sink Count: %zd\n", value);
> +		return ret;
> +	}
> +
>  	if (DP_GET_SINK_COUNT(sink_count))
>  		ret = connector_status_connected;
>  

      reply	other threads:[~2024-10-22 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  9:17 Liankun Yang
2024-10-22 10:05 ` CK Hu (胡俊光) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d712b16109d3a2c8a5704ad8988f961b71a40b2.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=Liankun.Yang@mediatek.com \
    --cc=Mac.Shen@mediatek.com \
    --cc=Peng.Liu@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Rex-BC.Chen@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jitao.shi@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=msp@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®