[PATCH 1/5] usb: dwc2: Make dwc2_wait_bit_set wait all bits in mask

Sascha Hauer s.hauer at pengutronix.de
Mon Mar 15 08:51:47 GMT 2021


On Fri, Mar 12, 2021 at 05:24:28PM +0100, Jules Maselbas wrote:
> The dwc2_wait_bit_set() wasn't waiting for all bits in the mask to be
> set but was waiting for only one bit set a mask.
> This is not the expected behavior as stated in the function's comment.
> 
> The function dwc2_wait_bit_set() is always called with a mask of only
> one bit.
> 
> Signed-off-by: Jules Maselbas <jmaselbas at kalray.eu>
> ---
>  drivers/usb/dwc2/core.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 780efb262..fa9d6ae95 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -532,7 +532,7 @@ static inline int dwc2_wait_bit_set(struct dwc2 *dwc2, u32 offset, u32 mask,
>  			    u32 timeout)
>  {
>  	return wait_on_timeout(timeout * USECOND,
> -			dwc2_readl(dwc2, offset) & mask);
> +			(dwc2_readl(dwc2, offset) & mask) == mask);
>  }
>  
>  /**
> -- 
> 2.17.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list