From fd58b2829272b0c285168e8b790e9352a2a362dd Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Thu, 10 May 2018 16:06:09 +0200 Subject: [PATCH] mt76x2: add a polling delay in mt76x2_mac_stop routine Add a usleep_range in mt76x2_mac_stop routine in order to add a polling delay checking values of MT_MAC_STATUS and IBI_R12 registers Signed-off-by: Lorenzo Bianconi --- mt76x2_init.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mt76x2_init.c b/mt76x2_init.c index 85b7cfe7..fc48f8ce 100644 --- a/mt76x2_init.c +++ b/mt76x2_init.c @@ -377,12 +377,12 @@ void mt76x2_mac_stop(struct mt76x2_dev *dev, bool force) /* Wait for MAC to become idle */ for (i = 0; i < 300; i++) { - if (mt76_rr(dev, MT_MAC_STATUS) & - (MT_MAC_STATUS_RX | MT_MAC_STATUS_TX)) - continue; - - if (mt76_rr(dev, MT_BBP(IBI, 12))) + if ((mt76_rr(dev, MT_MAC_STATUS) & + (MT_MAC_STATUS_RX | MT_MAC_STATUS_TX)) || + mt76_rr(dev, MT_BBP(IBI, 12))) { + usleep_range(10, 20); continue; + } stopped = true; break;