]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: handle data send errors in workqueue
authorAlex Elder <elder@linaro.org>
Sat, 22 Nov 2014 01:29:14 +0000 (19:29 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 22 Nov 2014 03:36:42 +0000 (19:36 -0800)
The data sent callback can execute in atomic context.  If an error
occurred, we shouldn't be completing the operation right then and
there.  Instead, hand it off to the operation workqueue to complete
the operation.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c

index 4e4fa8b0123cea6d510f54bfc5666368c5164787..9ad714eb773cd3ff957b19e48bc3360a6e92f71f 100644 (file)
@@ -506,9 +506,8 @@ greybus_data_sent(struct greybus_host_device *hd, void *header, int status)
        /* XXX Right now we assume we're an outgoing request */
        message = gb_hd_message_find(hd, header);
        operation = message->operation;
-       gb_connection_err(operation->connection, "send error %d\n", status);
        operation->errno = status;
-       gb_operation_complete(operation);
+       queue_work(gb_operation_workqueue, &operation->work);
 }
 EXPORT_SYMBOL_GPL(greybus_data_sent);