diff mbox series

[v2] drm/mediatek/dp: fix mtk_dp_aux_transfer return value

Message ID 20240417103819.990512-1-wmacek@chromium.org (mailing list archive)
State New, archived
Headers show
Series [v2] drm/mediatek/dp: fix mtk_dp_aux_transfer return value | expand

Commit Message

Wojciech Macek April 17, 2024, 10:38 a.m. UTC
In case there is no DP device attached to the port the
transfer function should return IO error, similar to what
other drivers do.
In case EAGAIN is returned then any read from /dev/drm_dp_aux
device ends up in an infinite loop as the upper layers
constantly repeats the transfer request.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Wojciech Macek <wmacek@chromium.org>
---
Changelog v2-v1:
 - added "Fixes" tag
 - corrected e-mail address

V1: https://patchwork.kernel.org/project/linux-mediatek/patch/20240402071113.3135903-1-wmacek@chromium.org/
 drivers/gpu/drm/mediatek/mtk_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno April 17, 2024, 1:52 p.m. UTC | #1
Il 17/04/24 12:38, Wojciech Macek ha scritto:
> In case there is no DP device attached to the port the
> transfer function should return IO error, similar to what
> other drivers do.
> In case EAGAIN is returned then any read from /dev/drm_dp_aux
> device ends up in an infinite loop as the upper layers
> constantly repeats the transfer request.
> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
> Signed-off-by: Wojciech Macek <wmacek@chromium.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
CK Hu (胡俊光) April 18, 2024, 2:01 a.m. UTC | #2
Hi, Wojciech:

On Wed, 2024-04-17 at 10:38 +0000, Wojciech Macek wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  In case there is no DP device attached to the port the
> transfer function should return IO error, similar to what
> other drivers do.
> In case EAGAIN is returned then any read from /dev/drm_dp_aux
> device ends up in an infinite loop as the upper layers
> constantly repeats the transfer request.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort
> driver")
> Signed-off-by: Wojciech Macek <wmacek@chromium.org>
> ---
> Changelog v2-v1:
>  - added "Fixes" tag
>  - corrected e-mail address
> 
> V1: 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240402071113.3135903-1-wmacek@chromium.org/__;!!CTRNKA9wMg0ARbw!kBY_x5kGvdau3baCVwGwRuKojhHVIEW8Hvbw385x2pXi_1pCGMCntptpmOnEPoMbwA0dgA4JTxwfy6o$
>  
>  drivers/gpu/drm/mediatek/mtk_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c
> b/drivers/gpu/drm/mediatek/mtk_dp.c
> index 0ba72102636a..536366956447 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2104,7 +2104,7 @@ static ssize_t mtk_dp_aux_transfer(struct
> drm_dp_aux *mtk_aux,
>  
>  	if (mtk_dp->bridge.type != DRM_MODE_CONNECTOR_eDP &&
>  	    !mtk_dp->train_info.cable_plugged_in) {
> -		ret = -EAGAIN;
> +		ret = -EIO;
>  		goto err;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 0ba72102636a..536366956447 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2104,7 +2104,7 @@  static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
 
 	if (mtk_dp->bridge.type != DRM_MODE_CONNECTOR_eDP &&
 	    !mtk_dp->train_info.cable_plugged_in) {
-		ret = -EAGAIN;
+		ret = -EIO;
 		goto err;
 	}