All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: fix a timeout loop
@ 2017-01-20 16:54 ` Tobias Jakobi
  2017-01-23  9:32   ` Inki Dae
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Jakobi @ 2017-01-20 16:54 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: Dan Carpenter, dri-devel

From: Dan Carpenter <dan.carpenter@oracle.com>

We were trying to print an error message if we timed out here, but the
loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
by changing from tries-- to --tries.

A for loop would actually be the most natural way to do this.  My fix
means we only loop 99 times instead of 100 but that's probably ok.

Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index edb20a3..fcc7e4f 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 	unsigned int tries = 100;
 
 	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
-	while (tries--) {
+	while (--tries) {
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;
-- 
2.7.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/exynos: fix a timeout loop
  2017-01-20 16:54 ` [PATCH] drm/exynos: fix a timeout loop Tobias Jakobi
@ 2017-01-23  9:32   ` Inki Dae
  2017-01-23  9:41     ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Inki Dae @ 2017-01-23  9:32 UTC (permalink / raw)
  To: Tobias Jakobi, linux-samsung-soc; +Cc: Dan Carpenter, dri-devel



2017년 01월 21일 01:54에 Tobias Jakobi 이(가) 쓴 글:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> 
> We were trying to print an error message if we timed out here, but the
> loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
> by changing from tries-- to --tries.

Sorry but I already know this patch from long ago but I'm not clear yet.
How the variable, tries, could have UNIT_MAX?

Seems something I'm missing.

Thanks.

> 
> A for loop would actually be the most natural way to do this.  My fix
> means we only loop 99 times instead of 100 but that's probably ok.
> 
> Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index edb20a3..fcc7e4f 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
>  	unsigned int tries = 100;
>  
>  	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
> -	while (tries--) {
> +	while (--tries) {
>  		/* waiting until VP_SRESET_PROCESSING is 0 */
>  		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
>  			break;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/exynos: fix a timeout loop
  2017-01-23  9:32   ` Inki Dae
@ 2017-01-23  9:41     ` Chris Wilson
  2017-01-24  0:07       ` Inki Dae
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2017-01-23  9:41 UTC (permalink / raw)
  To: Inki Dae; +Cc: Tobias Jakobi, linux-samsung-soc, dri-devel, Dan Carpenter

On Mon, Jan 23, 2017 at 06:32:16PM +0900, Inki Dae wrote:
> 
> 
> 2017년 01월 21일 01:54에 Tobias Jakobi 이(가) 쓴 글:
> > From: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > We were trying to print an error message if we timed out here, but the
> > loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
> > by changing from tries-- to --tries.
> 
> Sorry but I already know this patch from long ago but I'm not clear yet.
> How the variable, tries, could have UNIT_MAX?

The value of tries after the final loop is -1u. The WARN fires on a
succesful read on the final loop, instead of the complete failure.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/exynos: fix a timeout loop
  2017-01-23  9:41     ` Chris Wilson
@ 2017-01-24  0:07       ` Inki Dae
  0 siblings, 0 replies; 8+ messages in thread
From: Inki Dae @ 2017-01-24  0:07 UTC (permalink / raw)
  To: Chris Wilson, Tobias Jakobi, linux-samsung-soc, Dan Carpenter, dri-devel



2017년 01월 23일 18:41에 Chris Wilson 이(가) 쓴 글:
> On Mon, Jan 23, 2017 at 06:32:16PM +0900, Inki Dae wrote:
>>
>>
>> 2017년 01월 21일 01:54에 Tobias Jakobi 이(가) 쓴 글:
>>> From: Dan Carpenter <dan.carpenter@oracle.com>
>>>
>>> We were trying to print an error message if we timed out here, but the
>>> loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
>>> by changing from tries-- to --tries.
>>
>> Sorry but I already know this patch from long ago but I'm not clear yet.
>> How the variable, tries, could have UNIT_MAX?
> 
> The value of tries after the final loop is -1u. The WARN fires on a
> succesful read on the final loop, instead of the complete failure.

Ah, right. thanks.

> -Chris
> 

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

* Re: [patch] drm/exynos: fix a timeout loop
  2016-10-13 10:20 ` Dan Carpenter
@ 2016-10-13 11:05   ` Tobias Jakobi
  -1 siblings, 0 replies; 8+ messages in thread
From: Tobias Jakobi @ 2016-10-13 11:05 UTC (permalink / raw)
  To: Dan Carpenter, Inki Dae, Tobias Jakobi
  Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Kyungmin Park,
	Kukjin Kim, dri-devel

Hello Dan,

sorry for the blunder! Patch looks good to me.

Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>


With best wishes,
Tobias


Dan Carpenter wrote:
> We were trying to print an error message if we timed out here, but the
> loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
> by changing from tries-- to --tries.
> 
> A for loop would actually be the most natural way to do this.  My fix
> means we only loop 99 times instead of 100 but that's probably ok.
> 
> Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index edb20a3..fcc7e4f 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
>  	unsigned int tries = 100;
>  
>  	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
> -	while (tries--) {
> +	while (--tries) {
>  		/* waiting until VP_SRESET_PROCESSING is 0 */
>  		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
>  			break;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [patch] drm/exynos: fix a timeout loop
@ 2016-10-13 11:05   ` Tobias Jakobi
  0 siblings, 0 replies; 8+ messages in thread
From: Tobias Jakobi @ 2016-10-13 11:05 UTC (permalink / raw)
  To: Dan Carpenter, Inki Dae, Tobias Jakobi
  Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Kyungmin Park,
	Kukjin Kim, dri-devel

Hello Dan,

sorry for the blunder! Patch looks good to me.

Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>


With best wishes,
Tobias


Dan Carpenter wrote:
> We were trying to print an error message if we timed out here, but the
> loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
> by changing from tries-- to --tries.
> 
> A for loop would actually be the most natural way to do this.  My fix
> means we only loop 99 times instead of 100 but that's probably ok.
> 
> Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index edb20a3..fcc7e4f 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
>  	unsigned int tries = 100;
>  
>  	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
> -	while (tries--) {
> +	while (--tries) {
>  		/* waiting until VP_SRESET_PROCESSING is 0 */
>  		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
>  			break;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [patch] drm/exynos: fix a timeout loop
@ 2016-10-13 10:20 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2016-10-13 10:20 UTC (permalink / raw)
  To: Inki Dae, Tobias Jakobi
  Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Kyungmin Park,
	Kukjin Kim, dri-devel

We were trying to print an error message if we timed out here, but the
loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
by changing from tries-- to --tries.

A for loop would actually be the most natural way to do this.  My fix
means we only loop 99 times instead of 100 but that's probably ok.

Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index edb20a3..fcc7e4f 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 	unsigned int tries = 100;
 
 	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
-	while (tries--) {
+	while (--tries) {
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;

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

* [patch] drm/exynos: fix a timeout loop
@ 2016-10-13 10:20 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2016-10-13 10:20 UTC (permalink / raw)
  To: Inki Dae, Tobias Jakobi
  Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Kyungmin Park,
	Kukjin Kim, dri-devel

We were trying to print an error message if we timed out here, but the
loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
by changing from tries-- to --tries.

A for loop would actually be the most natural way to do this.  My fix
means we only loop 99 times instead of 100 but that's probably ok.

Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index edb20a3..fcc7e4f 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 	unsigned int tries = 100;
 
 	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
-	while (tries--) {
+	while (--tries) {
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-01-24  1:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170120165445epcas5p1a5fd54c6617006d8b4922d2c0269b17a@epcas5p1.samsung.com>
2017-01-20 16:54 ` [PATCH] drm/exynos: fix a timeout loop Tobias Jakobi
2017-01-23  9:32   ` Inki Dae
2017-01-23  9:41     ` Chris Wilson
2017-01-24  0:07       ` Inki Dae
2016-10-13 10:20 [patch] " Dan Carpenter
2016-10-13 10:20 ` Dan Carpenter
2016-10-13 11:05 ` Tobias Jakobi
2016-10-13 11:05   ` Tobias Jakobi

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.