Lines Matching +full:wait +full:- +full:state
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright 2013-2017 IBM Corp.
16 #include <linux/wait.h>
31 enum opal_async_token_state state; member
44 int i, token = -EBUSY; in __opal_async_get_token()
49 if (opal_async_tokens[i].state == ASYNC_TOKEN_UNALLOCATED) { in __opal_async_get_token()
50 opal_async_tokens[i].state = ASYNC_TOKEN_ALLOCATED; in __opal_async_get_token()
70 /* Wait until a token is available */ in opal_async_get_token_interruptible()
72 return -ERESTARTSYS; in opal_async_get_token_interruptible()
90 return -EINVAL; in __opal_async_release_token()
94 switch (opal_async_tokens[token].state) { in __opal_async_release_token()
97 opal_async_tokens[token].state = ASYNC_TOKEN_UNALLOCATED; in __opal_async_release_token()
101 * DISPATCHED and ABANDONED tokens must wait for OPAL to respond. in __opal_async_release_token()
106 opal_async_tokens[token].state = ASYNC_TOKEN_ABANDONED; in __opal_async_release_token()
132 return -EINVAL; in opal_async_wait_response()
137 return -EINVAL; in opal_async_wait_response()
144 * Wakeup the poller before we wait for events to speed things in opal_async_wait_response()
149 wait_event(opal_async_wait, opal_async_tokens[token].state in opal_async_wait_response()
164 return -EINVAL; in opal_async_wait_response_interruptible()
169 return -EINVAL; in opal_async_wait_response_interruptible()
178 * Only change if the token is ALLOCATED - it may have been in opal_async_wait_response_interruptible()
188 if (opal_async_tokens[token].state == ASYNC_TOKEN_ALLOCATED) { in opal_async_wait_response_interruptible()
190 if (opal_async_tokens[token].state == ASYNC_TOKEN_ALLOCATED) in opal_async_wait_response_interruptible()
191 opal_async_tokens[token].state = ASYNC_TOKEN_DISPATCHED; in opal_async_wait_response_interruptible()
196 * Wakeup the poller before we wait for events to speed things in opal_async_wait_response_interruptible()
202 opal_async_tokens[token].state == in opal_async_wait_response_interruptible()
216 enum opal_async_token_state state; in opal_async_comp_event() local
223 token = be64_to_cpu(comp_msg->params[0]); in opal_async_comp_event()
225 state = opal_async_tokens[token].state; in opal_async_comp_event()
226 opal_async_tokens[token].state = ASYNC_TOKEN_COMPLETED; in opal_async_comp_event()
229 if (state == ASYNC_TOKEN_ABANDONED) { in opal_async_comp_event()
255 err = -ENOENT; in opal_async_comp_init()
259 async = of_get_property(opal_node, "opal-msg-async-num", NULL); in opal_async_comp_init()
261 pr_err("%s: %pOF has no opal-msg-async-num\n", in opal_async_comp_init()
263 err = -ENOENT; in opal_async_comp_init()
271 err = -ENOMEM; in opal_async_comp_init()