• Maya Erez's avatar
    wil6210: fix race conditions between TX send and completion · eb26cff1
    Maya Erez authored
    There are 2 possible race conditions, both are solved by addition of
    memory barrier:
    1. wil_tx_complete reads the swhead to determine if the vring is
    empty. In case the swhead was updated before the descriptor update
    was performed in __wil_tx_vring/__wil_tx_vring_tso, the completion
    loop will not end and as the DU bit may still be set from a previous
    run, this skb can be handled as completed before it was sent, which
    will lead to double free of the same SKB.
    2. __wil_tx_vring/__wil_tx_vring_tso calculate the number of available
    descriptors according to the swtail. In case the swtail is updated
    before memset of ctx to zero is completed, we can handle this
    descriptor while later on ctx is zeroed.
    Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
    Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
    eb26cff1
txrx.c 51.9 KB