Skip to content

Commit

Permalink
usb: isp1760: do not sleep in field register poll
Browse files Browse the repository at this point in the history
commit 41f6731 upstream.

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@oracle.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210727100516.4190681-3-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
rmsilva authored and gregkh committed Sep 30, 2021
1 parent 9872ff6 commit b557040
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/isp1760/isp1760-hcd.c
Expand Up @@ -251,7 +251,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,
Expand All @@ -263,7 +263,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,
Expand All @@ -275,7 +275,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)
Expand Down

0 comments on commit b557040

Please sign in to comment.