Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()
On Thu, Feb 7, 2019 at 12:27 AM Mathias Nyman wrote: > > On 07.02.2019 02:03, Andrey Smirnov wrote: > > Xhci_handshake() implements the algorithm already captured by > > readl_poll_timeout(). Convert the former to use the latter to avoid > > repetition. > > readl_poll_timeout() doesn't really work here as it might sleep. > > iopoll.h: > > /** > * readx_poll_timeout - Periodically poll an address until a condition is > met or a timeout occurs > * > ... > * Returns 0 on success and -ETIMEDOUT upon a timeout. In either > * case, the last read value at @addr is stored in @val. Must not > * be called from atomic context if sleep_us or timeout_us are used. > > -Mathias Shoot, missed this part. Will change to readl_poll_timeout_atomic() in v2. Thanks, Andrey Smirnov
Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()
Hi, Mathias Nyman writes: > On 07.02.2019 02:03, Andrey Smirnov wrote: >> Xhci_handshake() implements the algorithm already captured by >> readl_poll_timeout(). Convert the former to use the latter to avoid >> repetition. > > readl_poll_timeout() doesn't really work here as it might sleep. > > iopoll.h: > > /** > * readx_poll_timeout - Periodically poll an address until a condition is > met or a timeout occurs > * > ... > > * Returns 0 on success and -ETIMEDOUT upon a timeout. In either > * case, the last read value at @addr is stored in @val. Must not > * be called from atomic context if sleep_us or timeout_us are used. readl_poll_timeout_atomic()? -- balbi signature.asc Description: PGP signature
Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()
On 07.02.2019 02:03, Andrey Smirnov wrote: Xhci_handshake() implements the algorithm already captured by readl_poll_timeout(). Convert the former to use the latter to avoid repetition. readl_poll_timeout() doesn't really work here as it might sleep. iopoll.h: /** * readx_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs * ... * Returns 0 on success and -ETIMEDOUT upon a timeout. In either * case, the last read value at @addr is stored in @val. Must not * be called from atomic context if sleep_us or timeout_us are used. -Mathias