linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: nvec: replace short udelay with usleep_range
@ 2025-12-20  9:22 Preyas
  2025-12-20  9:49 ` Greg KH
  2025-12-20 10:09 ` David Laight
  0 siblings, 2 replies; 5+ messages in thread
From: Preyas @ 2025-12-20  9:22 UTC (permalink / raw)
  To: marvin24, gregkh
  Cc: ac100, linux-tegra, linux-staging, linux-kernel, Preyas Sharma

From: Preyas Sharma <preyas17@zohomail.in>

Signed-off-by: Preyas Sharma <preyas17@zohomail.in>
---
 drivers/staging/nvec/nvec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 263774e6a78c..6ffe5e8656d1 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -648,7 +648,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		break;
 	case 2:		/* first byte after command */
 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
-			udelay(33);
+			usleep_range(33, 66);
 			if (nvec->rx->data[0] != 0x01) {
 				dev_err(nvec->dev,
 					"Read without prior read command\n");
-- 
2.43.0


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

* Re: [PATCH] staging: nvec: replace short udelay with usleep_range
  2025-12-20  9:22 [PATCH] staging: nvec: replace short udelay with usleep_range Preyas
@ 2025-12-20  9:49 ` Greg KH
  2025-12-20 10:09 ` David Laight
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2025-12-20  9:49 UTC (permalink / raw)
  To: Preyas; +Cc: marvin24, ac100, linux-tegra, linux-staging, linux-kernel

On Sat, Dec 20, 2025 at 09:22:29AM +0000, Preyas wrote:
> From: Preyas Sharma <preyas17@zohomail.in>
> 
> Signed-off-by: Preyas Sharma <preyas17@zohomail.in>
> ---
>  drivers/staging/nvec/nvec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index 263774e6a78c..6ffe5e8656d1 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -648,7 +648,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>  		break;
>  	case 2:		/* first byte after command */
>  		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
> -			udelay(33);
> +			usleep_range(33, 66);
>  			if (nvec->rx->data[0] != 0x01) {
>  				dev_err(nvec->dev,
>  					"Read without prior read command\n");
> -- 
> 2.43.0
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/process/submitting-patches.rst for what is needed in
  order to properly describe the change.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

* [PATCH] staging: nvec: replace short udelay with usleep_range
@ 2025-12-20 10:08 Preyas
  2025-12-20 10:32 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Preyas @ 2025-12-20 10:08 UTC (permalink / raw)
  To: marvin24, gregkh; +Cc: linux-tegra, linux-staging, linux-kernel, Preyas Sharma

From: Preyas Sharma <preyas17@zohomail.in>

Hi,

Replace udelay(33) with usleep_range(33, 66) in the nvec IRQ handler.

This avoids busy-waiting while preserving the required delay for the
first byte after a command, and follows guidance for microsecond-range
waits.

Signed-off-by: Preyas Sharma <preyas17@zohomail.in>
---
 drivers/staging/nvec/nvec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 263774e6a78c..6ffe5e8656d1 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -648,7 +648,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		break;
 	case 2:		/* first byte after command */
 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
-			udelay(33);
+			usleep_range(33, 66);
 			if (nvec->rx->data[0] != 0x01) {
 				dev_err(nvec->dev,
 					"Read without prior read command\n");
-- 
2.43.0


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

* Re: [PATCH] staging: nvec: replace short udelay with usleep_range
  2025-12-20  9:22 [PATCH] staging: nvec: replace short udelay with usleep_range Preyas
  2025-12-20  9:49 ` Greg KH
@ 2025-12-20 10:09 ` David Laight
  1 sibling, 0 replies; 5+ messages in thread
From: David Laight @ 2025-12-20 10:09 UTC (permalink / raw)
  To: Preyas; +Cc: marvin24, gregkh, ac100, linux-tegra, linux-staging, linux-kernel

On Sat, 20 Dec 2025 09:22:29 +0000
Preyas <preyas17@zohomail.in> wrote:

> From: Preyas Sharma <preyas17@zohomail.in>
> 
> Signed-off-by: Preyas Sharma <preyas17@zohomail.in>
> ---
>  drivers/staging/nvec/nvec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index 263774e6a78c..6ffe5e8656d1 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -648,7 +648,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>  		break;
>  	case 2:		/* first byte after command */
>  		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
> -			udelay(33);
> +			usleep_range(33, 66);

Given its name the function looks like an ISR - where you can't sleep.
Spinning isn't a good idea either....

	David

>  			if (nvec->rx->data[0] != 0x01) {
>  				dev_err(nvec->dev,
>  					"Read without prior read command\n");


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

* Re: [PATCH] staging: nvec: replace short udelay with usleep_range
  2025-12-20 10:08 Preyas
@ 2025-12-20 10:32 ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2025-12-20 10:32 UTC (permalink / raw)
  To: Preyas; +Cc: marvin24, linux-tegra, linux-staging, linux-kernel

On Sat, Dec 20, 2025 at 10:08:20AM +0000, Preyas wrote:
> From: Preyas Sharma <preyas17@zohomail.in>
> 
> Hi,

This isn't needed in a changelog, please read the documentation for how
to write a good changelog text.

> Replace udelay(33) with usleep_range(33, 66) in the nvec IRQ handler.
> 
> This avoids busy-waiting while preserving the required delay for the
> first byte after a command, and follows guidance for microsecond-range
> waits.

What guidance?  And why 66?  Do you have the hardware to test this with?
And if you sleep, doesn't this get messed up?

Attempting to fix this checkpatch warning is almost always not a good
idea unless you have access to the hardware and the specs for it to
verify that this is an ok thing to do.

Please read the email archives for the many other times this has come
up for more details.

thanks,

greg k-h

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

end of thread, other threads:[~2025-12-20 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20  9:22 [PATCH] staging: nvec: replace short udelay with usleep_range Preyas
2025-12-20  9:49 ` Greg KH
2025-12-20 10:09 ` David Laight
  -- strict thread matches above, loose matches on Subject: below --
2025-12-20 10:08 Preyas
2025-12-20 10:32 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).