diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-07-01 12:37:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-07-01 16:50:59 -0700 |
commit | a52c4352aef85538d194a9714fe742b18e6fb80f (patch) | |
tree | f1253f0887e9da1d9e8f77cdc3ad8facd62aebf7 /drivers/staging/greybus | |
parent | e420721b47ef5b0d521584d4efc89ff64bd0cd74 (diff) | |
download | op-kernel-dev-a52c4352aef85538d194a9714fe742b18e6fb80f.zip op-kernel-dev-a52c4352aef85538d194a9714fe742b18e6fb80f.tar.gz |
greybus: operation: allow atomic request submissions
Add gfp mask argument to gb_operation_request_send in order to allow
submissions from atomic context.
Note that responses are currently always sent from non-atomic context as
incoming requests are processed in a work queue.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/operation.c | 12 | ||||
-rw-r--r-- | drivers/staging/greybus/operation.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 4019b03..eee315c 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -129,7 +129,7 @@ gb_operation_find(struct gb_connection *connection, u16 operation_id) return found ? operation : NULL; } -static int gb_message_send(struct gb_message *message) +static int gb_message_send(struct gb_message *message, gfp_t gfp) { struct gb_connection *connection = message->operation->connection; @@ -563,7 +563,8 @@ static void gb_operation_sync_callback(struct gb_operation *operation) * dropping the initial reference to the operation. */ int gb_operation_request_send(struct gb_operation *operation, - gb_operation_callback callback) + gb_operation_callback callback, + gfp_t gfp) { struct gb_connection *connection = operation->connection; struct gb_operation_msg_hdr *header; @@ -601,7 +602,7 @@ int gb_operation_request_send(struct gb_operation *operation, /* All set, send the request */ gb_operation_result_set(operation, -EINPROGRESS); - ret = gb_message_send(operation->request); + ret = gb_message_send(operation->request, gfp); if (ret) gb_operation_put(operation); @@ -620,7 +621,8 @@ int gb_operation_request_send_sync(struct gb_operation *operation) int ret; unsigned long timeout; - ret = gb_operation_request_send(operation, gb_operation_sync_callback); + ret = gb_operation_request_send(operation, gb_operation_sync_callback, + GFP_KERNEL); if (ret) return ret; @@ -677,7 +679,7 @@ int gb_operation_response_send(struct gb_operation *operation, int errno) /* Fill in the response header and send it */ operation->response->header->result = gb_operation_errno_map(errno); - ret = gb_message_send(operation->response); + ret = gb_message_send(operation->response, GFP_KERNEL); if (ret) gb_operation_put(operation); diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h index 3956648..4063223 100644 --- a/drivers/staging/greybus/operation.h +++ b/drivers/staging/greybus/operation.h @@ -147,7 +147,8 @@ bool gb_operation_response_alloc(struct gb_operation *operation, size_t response_size); int gb_operation_request_send(struct gb_operation *operation, - gb_operation_callback callback); + gb_operation_callback callback, + gfp_t gfp); int gb_operation_request_send_sync(struct gb_operation *operation); int gb_operation_response_send(struct gb_operation *operation, int errno); |