• David Brownell's avatar
    musb_hdrc: Cannot stall an endpoint 0 control transfer from a data stage cal lback function · 5dd8c56c
    David Brownell authored
    Gadget drivers are supposed to be able to cause EP0 protocol stalls by
    issuing an appropriate request from the callback issued when the DATA
    stage completes ... not only from the setup() callback or from some
    thread that decides how to handle the request.
    
    This fix is based on a patch from Geoffrey Tam <geoffrey@evertz.com>,
    and addresses that by updating the endpoint state AFTER the callback
    is issued, providing the correct IRQ-acking CSR to the halt() so it
    can just mask in the SEND_STALL bit, and ensuring that only the CSR
    is still written only once even on this new code path.
    
    Also includes a few small cleanups:  avoid "this" variable name, and
    pack device bitfields more efficiently (wasting less space).
    
    Allegedly helps file_storage on Davinci.
    5dd8c56c
musb_core.h 13.9 KB