All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
@ 2021-11-18 19:30 ` Hsin-Yi Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Hsin-Yi Wang @ 2021-11-18 19:30 UTC (permalink / raw)
  To: Robert Foss, Laurent Pinchart
  Cc: Andrzej Hajda, Neil Armstrong, Jonas Karlman, Jernej Skrabec,
	David Airlie, Daniel Vetter, Pi-Hsun Shih, Xin Ji, Sam Ravnborg,
	Hsin-Yi Wang, dri-devel, linux-kernel, linux

edid_read() was assumed to return 0 on success. After
7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
the function will return > 0 for successful case, representing the i2c
read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
break condition accordingly.

Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
---
v2: Fix type error.
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 1a871f6b6822ee..3a18f1dabcfd51 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 	int count, blocks_num;
 	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
 	u8 i, j;
-	u8 g_edid_break = 0;
+	int g_edid_break = 0;
 	int ret;
 	struct device *dev = &ctx->client->dev;
 
@@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 				g_edid_break = edid_read(ctx, offset,
 							 pblock_buf);
 
-				if (g_edid_break)
+				if (g_edid_break < 0)
 					break;
 
 				memcpy(&pedid_blocks_buf[offset],
-- 
2.34.0.rc2.393.gf8c9666880-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
@ 2021-11-18 19:30 ` Hsin-Yi Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Hsin-Yi Wang @ 2021-11-18 19:30 UTC (permalink / raw)
  To: Robert Foss, Laurent Pinchart
  Cc: Pi-Hsun Shih, Jonas Karlman, David Airlie, Neil Armstrong,
	linux-kernel, Jernej Skrabec, Andrzej Hajda, dri-devel,
	Hsin-Yi Wang, Sam Ravnborg, Xin Ji, linux

edid_read() was assumed to return 0 on success. After
7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
the function will return > 0 for successful case, representing the i2c
read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
break condition accordingly.

Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
---
v2: Fix type error.
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 1a871f6b6822ee..3a18f1dabcfd51 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 	int count, blocks_num;
 	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
 	u8 i, j;
-	u8 g_edid_break = 0;
+	int g_edid_break = 0;
 	int ret;
 	struct device *dev = &ctx->client->dev;
 
@@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
 				g_edid_break = edid_read(ctx, offset,
 							 pblock_buf);
 
-				if (g_edid_break)
+				if (g_edid_break < 0)
 					break;
 
 				memcpy(&pedid_blocks_buf[offset],
-- 
2.34.0.rc2.393.gf8c9666880-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
  2021-11-18 19:30 ` Hsin-Yi Wang
@ 2021-11-19  1:54   ` Xin Ji
  -1 siblings, 0 replies; 6+ messages in thread
From: Xin Ji @ 2021-11-19  1:54 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Robert Foss, Laurent Pinchart, Andrzej Hajda, Neil Armstrong,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Pi-Hsun Shih, Xin Ji, Sam Ravnborg, Hsin-Yi Wang, dri-devel,
	linux-kernel, linux

On Fri, Nov 19, 2021 at 03:30:02AM +0800, Hsin-Yi Wang wrote:
> edid_read() was assumed to return 0 on success. After
> 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
> the function will return > 0 for successful case, representing the i2c
> read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
> break condition accordingly.
Hi Hsin-Yi, thanks for the patch!
Reviewed-by: Xin Ji <xji@analogixsemi.com>
> 
> Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Robert Foss <robert.foss@linaro.org>
> ---
> v2: Fix type error.
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 1a871f6b6822ee..3a18f1dabcfd51 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
>  	int count, blocks_num;
>  	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
>  	u8 i, j;
> -	u8 g_edid_break = 0;
> +	int g_edid_break = 0;
>  	int ret;
>  	struct device *dev = &ctx->client->dev;
>  
> @@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
>  				g_edid_break = edid_read(ctx, offset,
>  							 pblock_buf);
>  
> -				if (g_edid_break)
> +				if (g_edid_break < 0)
>  					break;
>  
>  				memcpy(&pedid_blocks_buf[offset],
> -- 
> 2.34.0.rc2.393.gf8c9666880-goog

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
@ 2021-11-19  1:54   ` Xin Ji
  0 siblings, 0 replies; 6+ messages in thread
From: Xin Ji @ 2021-11-19  1:54 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Pi-Hsun Shih, Jonas Karlman, David Airlie, Robert Foss,
	dri-devel, Neil Armstrong, linux-kernel, Jernej Skrabec,
	Andrzej Hajda, Laurent Pinchart, Hsin-Yi Wang, Sam Ravnborg,
	Xin Ji, linux

On Fri, Nov 19, 2021 at 03:30:02AM +0800, Hsin-Yi Wang wrote:
> edid_read() was assumed to return 0 on success. After
> 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
> the function will return > 0 for successful case, representing the i2c
> read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
> break condition accordingly.
Hi Hsin-Yi, thanks for the patch!
Reviewed-by: Xin Ji <xji@analogixsemi.com>
> 
> Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Robert Foss <robert.foss@linaro.org>
> ---
> v2: Fix type error.
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 1a871f6b6822ee..3a18f1dabcfd51 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
>  	int count, blocks_num;
>  	u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
>  	u8 i, j;
> -	u8 g_edid_break = 0;
> +	int g_edid_break = 0;
>  	int ret;
>  	struct device *dev = &ctx->client->dev;
>  
> @@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
>  				g_edid_break = edid_read(ctx, offset,
>  							 pblock_buf);
>  
> -				if (g_edid_break)
> +				if (g_edid_break < 0)
>  					break;
>  
>  				memcpy(&pedid_blocks_buf[offset],
> -- 
> 2.34.0.rc2.393.gf8c9666880-goog

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
  2021-11-19  1:54   ` Xin Ji
@ 2021-11-24 12:39     ` Robert Foss
  -1 siblings, 0 replies; 6+ messages in thread
From: Robert Foss @ 2021-11-24 12:39 UTC (permalink / raw)
  To: Xin Ji
  Cc: Pi-Hsun Shih, Jonas Karlman, David Airlie, dri-devel,
	Neil Armstrong, linux-kernel, Jernej Skrabec, Andrzej Hajda,
	Laurent Pinchart, Hsin-Yi Wang, Sam Ravnborg, linux

On Fri, 19 Nov 2021 at 02:55, Xin Ji <xji@analogixsemi.com> wrote:
>
> On Fri, Nov 19, 2021 at 03:30:02AM +0800, Hsin-Yi Wang wrote:
> > edid_read() was assumed to return 0 on success. After
> > 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
> > the function will return > 0 for successful case, representing the i2c
> > read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
> > break condition accordingly.
> Hi Hsin-Yi, thanks for the patch!
> Reviewed-by: Xin Ji <xji@analogixsemi.com>
> >
> > Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Robert Foss <robert.foss@linaro.org>
> > ---
> > v2: Fix type error.
> > ---
> >  drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 1a871f6b6822ee..3a18f1dabcfd51 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
> >       int count, blocks_num;
> >       u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
> >       u8 i, j;
> > -     u8 g_edid_break = 0;
> > +     int g_edid_break = 0;
> >       int ret;
> >       struct device *dev = &ctx->client->dev;
> >
> > @@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
> >                               g_edid_break = edid_read(ctx, offset,
> >                                                        pblock_buf);
> >
> > -                             if (g_edid_break)
> > +                             if (g_edid_break < 0)
> >                                       break;
> >
> >                               memcpy(&pedid_blocks_buf[offset],
> > --

Fixed commit id syntax of commit message in order to make checkpatch
--strict happy.

Applied to drm-misc-next.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
@ 2021-11-24 12:39     ` Robert Foss
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Foss @ 2021-11-24 12:39 UTC (permalink / raw)
  To: Xin Ji
  Cc: Hsin-Yi Wang, Laurent Pinchart, Andrzej Hajda, Neil Armstrong,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Pi-Hsun Shih, Sam Ravnborg, dri-devel, linux-kernel, linux

On Fri, 19 Nov 2021 at 02:55, Xin Ji <xji@analogixsemi.com> wrote:
>
> On Fri, Nov 19, 2021 at 03:30:02AM +0800, Hsin-Yi Wang wrote:
> > edid_read() was assumed to return 0 on success. After
> > 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"),
> > the function will return > 0 for successful case, representing the i2c
> > read bytes. Otherwise -EIO on failure cases. Update the g_edid_break
> > break condition accordingly.
> Hi Hsin-Yi, thanks for the patch!
> Reviewed-by: Xin Ji <xji@analogixsemi.com>
> >
> > Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()")
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Robert Foss <robert.foss@linaro.org>
> > ---
> > v2: Fix type error.
> > ---
> >  drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index 1a871f6b6822ee..3a18f1dabcfd51 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -795,7 +795,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
> >       int count, blocks_num;
> >       u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
> >       u8 i, j;
> > -     u8 g_edid_break = 0;
> > +     int g_edid_break = 0;
> >       int ret;
> >       struct device *dev = &ctx->client->dev;
> >
> > @@ -826,7 +826,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
> >                               g_edid_break = edid_read(ctx, offset,
> >                                                        pblock_buf);
> >
> > -                             if (g_edid_break)
> > +                             if (g_edid_break < 0)
> >                                       break;
> >
> >                               memcpy(&pedid_blocks_buf[offset],
> > --

Fixed commit id syntax of commit message in order to make checkpatch
--strict happy.

Applied to drm-misc-next.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-24 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 19:30 [PATCH v2] drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read() Hsin-Yi Wang
2021-11-18 19:30 ` Hsin-Yi Wang
2021-11-19  1:54 ` Xin Ji
2021-11-19  1:54   ` Xin Ji
2021-11-24 12:39   ` Robert Foss
2021-11-24 12:39     ` Robert Foss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.