Skip to content

Commit

Permalink
mt76x2: add a polling delay in mt76x2_mac_stop routine
Browse files Browse the repository at this point in the history
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 <lorenzo.bianconi@redhat.com>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed May 10, 2018
1 parent b2ecc52 commit fd58b28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mt76x2_init.c
Expand Up @@ -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;
Expand Down

0 comments on commit fd58b28

Please sign in to comment.