[coreboot-gerrit] Patch merged into coreboot/master: 83da501 libpayload: xhci: Use Event Data TRBs for transfer event generation

gerrit at coreboot.org gerrit at coreboot.org
Mon Aug 11 18:26:02 CEST 2014


the following patch was just integrated into master:
commit 83da50173ce0547320f029bf3ff46df62c084aac
Author: Julius Werner <jwerner at chromium.org>
Date:   Fri Sep 27 12:45:11 2013 -0700

    libpayload: xhci: Use Event Data TRBs for transfer event generation
    
    The current XHCI code only sets IOC on the last TRB of a TD, and
    doesn't set ISP anywhere. On my Synopsys DesignWare3 controller, this
    won't generate an event at all when we have a short transfer that is not
    on the last TRB of a TD, resulting in event ring desync and everyone
    having a bad time. However, just setting ISP on other TRBs doesn't
    really make for a nice solution: we then need to do ugly special casing
    to fish out the spurious second transfer event you get for short
    packets, and we still need a way to figure out how many bytes were
    transferred. Since the Short Packet transfer event only reports
    untransferred bytes for the current TRB, we would have to manually walk
    the rest of the unprocessed TRB chain and add up the bytes. Check out
    U-Boot and the Linux kernel to see how complicated this looks in
    practice.
    
    Now what if we had a way to just tell the HC "I want an event at exactly
    *this* point in the TD, I want it to have the right completion code for
    the whole TD, and to contain the exact number of bytes written"? Enter
    the Event Data TRB: this little gizmo really does pretty much exactly
    what any sane XHCI driver would want, and I have no idea why it isn't
    used more often. It solves both the short packet event generation and
    counting the transferred bytes without requiring any special magic in
    software.
    
    Change-Id: Idab412d61edf30655ec69c80066bfffd80290403
    Signed-off-by: Julius Werner <jwerner at chromium.org>
    Reviewed-on: https://chromium-review.googlesource.com/170980
    Reviewed-by: Stefan Reinauer <reinauer at google.com>
    Reviewed-by: Kees Cook <keescook at chromium.org>
    (cherry picked from commit e512c8bcaa5b8e05cae3b9d04cd4947298de999d)
    Signed-off-by: Isaac Christensen <isaac.christensen at se-eng.com>
    Reviewed-on: http://review.coreboot.org/6516
    Tested-by: build bot (Jenkins)
    Reviewed-by: Ronald G. Minnich <rminnich at gmail.com>


See http://review.coreboot.org/6516 for details.

-gerrit



More information about the coreboot-gerrit mailing list