Re: [PATCH v2] drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

2023-09-04 Thread Thomas Zimmermann

Hi

Am 04.09.23 um 09:26 schrieb Hans de Goede:

Hi,

On 9/4/23 04:14, Jinjie Ruan wrote:

The timeout arg of usb_bulk_msg() is ms already, which has been converted
to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage
by removing the redundant msecs_to_jiffies() in the macros.

And as Hans suggested, also remove msecs_to_jiffies() for the IDLE_TIMEOUT
macro to make it consistent here and so change IDLE_TIMEOUT to
msecs_to_jiffies(IDLE_TIMEOUT) where it is used.

Fixes: e4f86e437164 ("drm: Add Grain Media GM12U320 driver v2")
Signed-off-by: Jinjie Ruan 
Suggested-by: Hans de Goede 
---
v2:
- Remove the msecs_to_jiffies() also for IDLE_TIMEOUT.
- Update the fix tag.
- Update the commit message.


Thanks, patch looks good to me:

Reviewed-by: Hans de Goede 

Note I don't gave time to merge this myself atm.

If one of the drm-misc maintainers can pick this up that would
be great.


I'll take care of it.

Best regards
Thomas



Regards,

Hans




---
  drivers/gpu/drm/tiny/gm12u320.c | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index c5bb683e440c..0187539ff5ea 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -70,10 +70,10 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more 
silent)");
  #define READ_STATUS_SIZE  13
  #define MISC_VALUE_SIZE   4
  
-#define CMD_TIMEOUT			msecs_to_jiffies(200)

-#define DATA_TIMEOUT   msecs_to_jiffies(1000)
-#define IDLE_TIMEOUT   msecs_to_jiffies(2000)
-#define FIRST_FRAME_TIMEOUTmsecs_to_jiffies(2000)
+#define CMD_TIMEOUT200
+#define DATA_TIMEOUT   1000
+#define IDLE_TIMEOUT   2000
+#define FIRST_FRAME_TIMEOUT2000
  
  #define MISC_REQ_GET_SET_ECO_A		0xff

  #define MISC_REQ_GET_SET_ECO_B0x35
@@ -389,7 +389,7 @@ static void gm12u320_fb_update_work(struct work_struct 
*work)
 * switches back to showing its logo.
 */
queue_delayed_work(system_long_wq, >fb_update.work,
-  IDLE_TIMEOUT);
+  msecs_to_jiffies(IDLE_TIMEOUT));
  
  	return;

  err:




--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


OpenPGP_signature
Description: OpenPGP digital signature


Re: [PATCH v2] drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

2023-09-04 Thread Hans de Goede
Hi,

On 9/4/23 04:14, Jinjie Ruan wrote:
> The timeout arg of usb_bulk_msg() is ms already, which has been converted
> to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage
> by removing the redundant msecs_to_jiffies() in the macros.
> 
> And as Hans suggested, also remove msecs_to_jiffies() for the IDLE_TIMEOUT
> macro to make it consistent here and so change IDLE_TIMEOUT to
> msecs_to_jiffies(IDLE_TIMEOUT) where it is used.
> 
> Fixes: e4f86e437164 ("drm: Add Grain Media GM12U320 driver v2")
> Signed-off-by: Jinjie Ruan 
> Suggested-by: Hans de Goede 
> ---
> v2:
> - Remove the msecs_to_jiffies() also for IDLE_TIMEOUT.
> - Update the fix tag.
> - Update the commit message.

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede 

Note I don't gave time to merge this myself atm.

If one of the drm-misc maintainers can pick this up that would
be great.

Regards,

Hans



> ---
>  drivers/gpu/drm/tiny/gm12u320.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
> index c5bb683e440c..0187539ff5ea 100644
> --- a/drivers/gpu/drm/tiny/gm12u320.c
> +++ b/drivers/gpu/drm/tiny/gm12u320.c
> @@ -70,10 +70,10 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less 
> bright, more silent)");
>  #define READ_STATUS_SIZE 13
>  #define MISC_VALUE_SIZE  4
>  
> -#define CMD_TIMEOUT  msecs_to_jiffies(200)
> -#define DATA_TIMEOUT msecs_to_jiffies(1000)
> -#define IDLE_TIMEOUT msecs_to_jiffies(2000)
> -#define FIRST_FRAME_TIMEOUT  msecs_to_jiffies(2000)
> +#define CMD_TIMEOUT  200
> +#define DATA_TIMEOUT 1000
> +#define IDLE_TIMEOUT 2000
> +#define FIRST_FRAME_TIMEOUT  2000
>  
>  #define MISC_REQ_GET_SET_ECO_A   0xff
>  #define MISC_REQ_GET_SET_ECO_B   0x35
> @@ -389,7 +389,7 @@ static void gm12u320_fb_update_work(struct work_struct 
> *work)
>* switches back to showing its logo.
>*/
>   queue_delayed_work(system_long_wq, >fb_update.work,
> -IDLE_TIMEOUT);
> +msecs_to_jiffies(IDLE_TIMEOUT));
>  
>   return;
>  err:



[PATCH v2] drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

2023-09-03 Thread Jinjie Ruan
The timeout arg of usb_bulk_msg() is ms already, which has been converted
to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage
by removing the redundant msecs_to_jiffies() in the macros.

And as Hans suggested, also remove msecs_to_jiffies() for the IDLE_TIMEOUT
macro to make it consistent here and so change IDLE_TIMEOUT to
msecs_to_jiffies(IDLE_TIMEOUT) where it is used.

Fixes: e4f86e437164 ("drm: Add Grain Media GM12U320 driver v2")
Signed-off-by: Jinjie Ruan 
Suggested-by: Hans de Goede 
---
v2:
- Remove the msecs_to_jiffies() also for IDLE_TIMEOUT.
- Update the fix tag.
- Update the commit message.
---
 drivers/gpu/drm/tiny/gm12u320.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index c5bb683e440c..0187539ff5ea 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -70,10 +70,10 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, 
more silent)");
 #define READ_STATUS_SIZE   13
 #define MISC_VALUE_SIZE4
 
-#define CMD_TIMEOUTmsecs_to_jiffies(200)
-#define DATA_TIMEOUT   msecs_to_jiffies(1000)
-#define IDLE_TIMEOUT   msecs_to_jiffies(2000)
-#define FIRST_FRAME_TIMEOUTmsecs_to_jiffies(2000)
+#define CMD_TIMEOUT200
+#define DATA_TIMEOUT   1000
+#define IDLE_TIMEOUT   2000
+#define FIRST_FRAME_TIMEOUT2000
 
 #define MISC_REQ_GET_SET_ECO_A 0xff
 #define MISC_REQ_GET_SET_ECO_B 0x35
@@ -389,7 +389,7 @@ static void gm12u320_fb_update_work(struct work_struct 
*work)
 * switches back to showing its logo.
 */
queue_delayed_work(system_long_wq, >fb_update.work,
-  IDLE_TIMEOUT);
+  msecs_to_jiffies(IDLE_TIMEOUT));
 
return;
 err:
-- 
2.34.1