20 Nov
2023
20 Nov
'23
6:19 p.m.
On Mon, Nov 20, 2023 at 04:16:38PM +0000, Charles Keepax wrote:
On Mon, Nov 20, 2023 at 03:54:14PM +0000, Mark Brown wrote:
It seems like a clear code bug if this is ever called with an unknown completion, I'd expect a WARN_ON_ONCE() there. The lack of a delay is potentially going to affect how any error handling works which doesn't feel ideal though the users look fine right now.
I guess perhaps another option might be to not stick so strictly to the wait_for_completion_timeout API. This function could return an -EINVAL here and a -ETIMEDOUT for a timeout then the callers could be updated accordingly.
Yes, that'd help with clarity in terms of the interface - the completion API is a bit non-standard here.