wcn36xx: Fix tx_status mechanism
authorLoic Poulain <loic.poulain@linaro.org>
Mon, 25 Oct 2021 13:12:18 +0000 (16:12 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 25 Oct 2021 13:24:14 +0000 (16:24 +0300)
commita9e79b116cc4d0057e912be8f40b2c2e5bdc7c43
tree2e822fc806eb83125510f0c7c8a9d7198cdba4a9
parentd3fd2c95c1c13ec217d43ebef3c61cfa00a6cd37
wcn36xx: Fix tx_status mechanism

This change fix the TX ack mechanism in various ways:

- For NO_ACK tagged packets, we don't need to wait for TX_ACK indication
and so are not subject to the single packet ack limitation. So we don't
have to stop the tx queue, and can call the tx status callback as soon
as DMA transfer has completed.

- Fix skb ownership/reference. Only start status indication timeout
once the DMA transfer has been completed. This avoids the skb to be
both referenced in the DMA tx ring and by the tx_ack_skb pointer,
preventing any use-after-free or double-free.

- This adds a sanity (paranoia?) check on the skb tx ack pointer.

- Resume TX queue if TX status tagged packet TX fails.

Cc: stable@vger.kernel.org
Fixes: fdf21cc37149 ("wcn36xx: Add TX ack support")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1634567281-28997-1-git-send-email-loic.poulain@linaro.org
drivers/net/wireless/ath/wcn36xx/dxe.c
drivers/net/wireless/ath/wcn36xx/txrx.c