diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2024-08-21 23:42:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-08-23 16:24:24 +0300 |
commit | 8af174ea863c72f25ce31cee3baad8a301c0cf0f (patch) | |
tree | 5bbe8ab33100fbda128c752fdb0e80a452f363ef /drivers/bluetooth | |
parent | 82b8000c28b56b014ce52a1f1581bef4af148681 (diff) | |
download | linux-8af174ea863c72f25ce31cee3baad8a301c0cf0f.tar.xz |
net: mana: Fix race of mana_hwc_post_rx_wqe and new hwc response
The mana_hwc_rx_event_handler() / mana_hwc_handle_resp() calls
complete(&ctx->comp_event) before posting the wqe back. It's
possible that other callers, like mana_create_txq(), start the
next round of mana_hwc_send_request() before the posting of wqe.
And if the HW is fast enough to respond, it can hit no_wqe error
on the HW channel, then the response message is lost. The mana
driver may fail to create queues and open, because of waiting for
the HW response and timed out.
Sample dmesg:
[ 528.610840] mana 39d4:00:02.0: HWC: Request timed out!
[ 528.614452] mana 39d4:00:02.0: Failed to send mana message: -110, 0x0
[ 528.618326] mana 39d4:00:02.0 enP14804s2: Failed to create WQ object: -110
To fix it, move posting of rx wqe before complete(&ctx->comp_event).
Cc: stable@vger.kernel.org
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/bluetooth')
0 files changed, 0 insertions, 0 deletions