Skip to content

Commit 0cd1002

Browse files
gregkhkevinalavik
authored andcommitted
greybus: es1-ap-usb: document the lack of callback for the outgoing bulk urbs
We don't need a callback for bulk out urbs to do anything except put the urb back in the pool. Document why we do this and what is involved. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
1 parent a0af2c0 commit 0cd1002

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/staging/greybus/es1-ap-usb.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,31 @@ static void cport_out_callback(struct urb *urb)
418418

419419
/* If urb is not NULL, then we need to free this urb */
420420
usb_free_urb(urb);
421+
422+
/*
423+
* Yes, you are right, we aren't telling anyone that the urb finished.
424+
* "That's crazy! How does this all even work?" you might be saying.
425+
* The "magic" is the idea that greybus works on the "operation" level,
426+
* not the "send a buffer" level. All operations are "round-trip" with
427+
* a response from the device that the operation finished, or it will
428+
* time out. Because of that, we don't care that this urb finished, or
429+
* failed, or did anything else, as higher levels of the protocol stack
430+
* will handle completions and timeouts and the rest.
431+
*
432+
* This protocol is "needed" due to some hardware restrictions on the
433+
* current generation of Unipro controllers. Think about it for a
434+
* minute, this is a USB driver, talking to a Unipro bridge, impediance
435+
* mismatch is huge, yet the Unipro controller are even more
436+
* underpowered than this little USB controller. We rely on the round
437+
* trip to keep stalls in the Unipro controllers from happening so that
438+
* we can keep data flowing properly, no matter how slow it might be.
439+
*
440+
* Once again, a wonderful bus protocol cut down in its prime by a naive
441+
* controller chip. We dream of the day we have a "real" HCD for
442+
* Unipro. Until then, we suck it up and make the hardware work, as
443+
* that's the job of the firmware and kernel.
444+
* </rant>
445+
*/
421446
}
422447

423448
/*

0 commit comments

Comments
 (0)