From: Sean Wang <objelf@xxxxxxxxx> Just follow up vendor driver to retry a few times obtaining patch semaphore when the event is PATCH_NOT_DL_SEM_FAIL. That usually happens in Bluetooth and Wifi driver contends to download patch simultaneously. Co-developed-by: YN Chen <YN.Chen@xxxxxxxxxxxx> Signed-off-by: YN Chen <YN.Chen@xxxxxxxxxxxx> Signed-off-by: Sean Wang <sean.wang@xxxxxxxxxxxx> --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 2b17bd1c2a32..c990ccd6f472 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -1945,14 +1945,21 @@ static int mt7615_load_patch(struct mt7615_dev *dev, u32 addr, const char *name) { const struct mt7615_patch_hdr *hdr; const struct firmware *fw = NULL; - int len, ret, sem; + int len, ret, sem, c = 50; +retry: sem = mt7615_mcu_patch_sem_ctrl(dev, 1); switch (sem) { case PATCH_IS_DL: return 0; case PATCH_NOT_DL_SEM_SUCCESS: break; + case PATCH_NOT_DL_SEM_FAIL: + if (is_mt7663(&dev->mt76) && c--) { + msleep(100); + goto retry; + } + fallthrough; default: dev_err(dev->mt76.dev, "Failed to get patch semaphore\n"); return -EAGAIN; -- 2.25.1