Skip to content

Commit

Permalink
mt76: mt7915: fix MT_PCIE1_MAC_INT_ENABLE reg being used for mt7916
Browse files Browse the repository at this point in the history
mt7915_mac_restart was not checking if mdev is mt7915, causing it to
use the wrong register to start/stop interrupt for hif2 device.

Signed-off-by: rany <ranygh@riseup.net>
  • Loading branch information
rany2 committed May 22, 2023
1 parent 670c26e commit 7cb022d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions mt7915/mac.c
Expand Up @@ -1383,8 +1383,12 @@ mt7915_mac_restart(struct mt7915_dev *dev)

if (dev_is_pci(mdev->dev)) {
mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0x0);
if (dev->hif2)
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0x0);
if (dev->hif2) {
if (is_mt7915(mdev))
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0x0);
else
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE_MT7916, 0x0);
}
}

set_bit(MT76_RESET, &dev->mphy.state);
Expand Down Expand Up @@ -1434,8 +1438,12 @@ mt7915_mac_restart(struct mt7915_dev *dev)
}
if (dev_is_pci(mdev->dev)) {
mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
if (dev->hif2)
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff);
if (dev->hif2) {
if (is_mt7915(mdev))
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff);
else
mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE_MT7916, 0xff);
}
}

/* load firmware */
Expand Down

0 comments on commit 7cb022d

Please sign in to comment.