]> asedeno.scripts.mit.edu Git - linux.git/commit
greybus: update gbuf status for completion handlers
authorAlex Elder <elder@linaro.org>
Fri, 17 Oct 2014 10:18:22 +0000 (05:18 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:15:25 +0000 (18:15 +0200)
commitbedfdf30565ef533b578d90a9dae5483347c8ea1
tree11cbac913038a56c69047c688fc36a4c89d5e3a8
parentd75286852bb3bd575bd8707f80ca0b362a7ae5a6
greybus: update gbuf status for completion handlers

Currently, if a USB urb completes with an error, that error status
is not transferred back to the gbuf that it's associated with.  For
inbound data there's not a lot we can do about an error, but for
outbound data, this means there is no notification to the submitter
that something went wrong.

For outbound data copy the urb status directly back to the gbuf as
its status.  Follow USB's lead and set the status to -EINPROGRESS
while a gbuf is "in flight."  Assign a gbuf an initial status value
of -EBADR to help identify use of never-set status values.

When an inbound urb fails (SVC or CPort), currently the urb is just
leaked, more or less (i.e., we lose an urb posted to receive
incoming data).  Change that so such an error is reported, but
then re-submitted.

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