mt76: mt7915: fix polling firmware-own status
authorFelix Fietkau <nbd@nbd.name>
Mon, 23 Nov 2020 13:06:50 +0000 (14:06 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 3 Feb 2022 12:57:56 +0000 (13:57 +0100)
Check the register status bit instead of the trigger bit

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7915/regs.h

index 0911b6f973b5aa8ac95bebcb4efb2b9beee19649..35728f1659506fa609382fef9b0de9aef8656d47 100644 (file)
@@ -2697,7 +2697,7 @@ static int mt7915_driver_own(struct mt7915_dev *dev)
 {
        mt76_wr(dev, MT_TOP_LPCR_HOST_BAND0, MT_TOP_LPCR_HOST_DRV_OWN);
        if (!mt76_poll_msec(dev, MT_TOP_LPCR_HOST_BAND0,
-                           MT_TOP_LPCR_HOST_FW_OWN, 0, 500)) {
+                           MT_TOP_LPCR_HOST_FW_OWN_STAT, 0, 500)) {
                dev_err(dev->mt76.dev, "Timeout for driver own\n");
                return -EIO;
        }
index 59693535b098c697062d962739632fd3727f31fc..ff71f5629c1759aa4b9aba045b54105aedfdfbff 100644 (file)
 #define MT_TOP_LPCR_HOST_BAND0         MT_TOP(0x10)
 #define MT_TOP_LPCR_HOST_FW_OWN                BIT(0)
 #define MT_TOP_LPCR_HOST_DRV_OWN       BIT(1)
+#define MT_TOP_LPCR_HOST_FW_OWN_STAT   BIT(2)
 
 #define MT_TOP_MISC                    MT_TOP(0xf0)
 #define MT_TOP_MISC_FW_STATE           GENMASK(2, 0)