Re: [PATCH 2/3] usb: isp1760: do not sleep in field register poll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,
forgot to ask you, can you please merge this one to stable #5.14.y?
At the time I was not sure if it was getting in final 5.14 or not.

It applies clean on top of 5.14.7.
And without it, it triggers BUG sleep in atomic checks.

upstream commit:
41f673183862a1 usb: isp1760: do not sleep in field register poll
https://lore.kernel.org/r/20210727100516.4190681-3-rui.silva@xxxxxxxxxx

fixes tag:
Fixes: 1da9e1c06873 ("usb: isp1760: move to regmap for register access")

Thanks in advance,
Cheers,
     Rui

On Tue Jul 27, 2021 at 11:05 AM WEST, Rui Miguel Silva wrote:

---- 8< ----------------------------------------------

> When polling for a setup or clear of a register field we were sleeping
> in atomic context but using a very tight sleep interval.
>
> Since the use cases for this poll mechanism are only in setup and
> stop paths, and in practice this poll is not used most of the times
> but needs to be there to comply to hardware setup times, remove the
> sleep time and make the poll loop tighter.
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Rui Miguel Silva <rui.silva@xxxxxxxxxx>
> ---
>  drivers/usb/isp1760/isp1760-hcd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
> index a745c4c2b773..a018394d54f8 100644
> --- a/drivers/usb/isp1760/isp1760-hcd.c
> +++ b/drivers/usb/isp1760/isp1760-hcd.c
> @@ -250,7 +250,7 @@ static int isp1760_hcd_set_and_wait(struct usb_hcd *hcd, u32 field,
>  	isp1760_hcd_set(hcd, field);
>  
>  	return regmap_field_read_poll_timeout(priv->fields[field], val,
> -					      val, 10, timeout_us);
> +					      val, 0, timeout_us);
>  }
>  
>  static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field,
> @@ -262,7 +262,7 @@ static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field,
>  	isp1760_hcd_set(hcd, field);
>  
>  	return regmap_field_read_poll_timeout(priv->fields[field], val,
> -					      !val, 10, timeout_us);
> +					      !val, 0, timeout_us);
>  }
>  
>  static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field,
> @@ -274,7 +274,7 @@ static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field,
>  	isp1760_hcd_clear(hcd, field);
>  
>  	return regmap_field_read_poll_timeout(priv->fields[field], val,
> -					      !val, 10, timeout_us);
> +					      !val, 0, timeout_us);
>  }
>  
>  static bool isp1760_hcd_is_set(struct usb_hcd *hcd, u32 field)
> -- 
> 2.32.0







[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux