diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c index 5acf5a75e44b..21fe4fdd4103 100644 --- a/drivers/staging/greybus/es1-ap-usb.c +++ b/drivers/staging/greybus/es1-ap-usb.c @@ -274,10 +274,11 @@ static void svc_in_callback(struct urb *urb) int status = check_urb_status(urb); int retval; - if (status == -EAGAIN) + if (status) { + if (status != -EAGAIN) + dev_err(dev, "urb svc in error %d (dropped)\n", status); goto exit; - if (status) - return; + } /* We have a message, create a new message structure, add it to the * list, and wake up our thread that will process the messages. @@ -300,10 +301,12 @@ static void cport_in_callback(struct urb *urb) u8 cport; u8 *data; - if (status == -EAGAIN) + if (status) { + if (status != -EAGAIN) + dev_err(dev, "urb cport in error %d (dropped)\n", + status); goto exit; - if (status) - return; + } /* The size has to be at least one, for the cport id */ if (!urb->actual_length) { @@ -337,6 +340,9 @@ static void cport_out_callback(struct urb *urb) unsigned long flags; int i; + /* Record whether the transfer was successful */ + gbuf->status = check_urb_status(urb); + /* * See if this was an urb in our pool, if so mark it "free", otherwise * we need to free it ourselves. diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 348ee7c27a07..9b435af27cca 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -54,6 +54,7 @@ struct gbuf *greybus_alloc_gbuf(struct gb_connection *connection, gbuf->outbound = outbound; gbuf->complete = complete; gbuf->context = context; + gbuf->status = -EBADR; /* Initial value--means "never set" */ /* Host controller specific allocation for the actual buffer */ retval = connection->hd->driver->alloc_gbuf_data(gbuf, size, gfp_mask); @@ -98,6 +99,8 @@ int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask) { struct greybus_host_device *hd = gbuf->connection->hd; + gbuf->status = -EINPROGRESS; + return hd->driver->submit_gbuf(gbuf, gfp_mask); } diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index a49d92957c6b..4d19eec790f0 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -424,6 +424,7 @@ void gb_connection_operation_recv(struct gb_connection *connection, } gb_operation_remove(operation); gbuf = operation->response; + gbuf->status = GB_OP_SUCCESS; /* If we got here we're good */ if (size > gbuf->transfer_buffer_length) { gb_connection_err(connection, "recv buffer too small"); return;