wifi: mt76: mt7925: add flow to avoid chip bt function fail
authorQuan Zhou <quan.zhou@mediatek.com>
Fri, 29 Dec 2023 03:09:35 +0000 (11:09 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Feb 2024 08:55:17 +0000 (09:55 +0100)
A sub-process of Wifi L0.5 reset will make chip common partition
enter low power, and have chance lead to Bluetooth host-to-chip
command timeout, modify the software flow according to the chip's
design to solve the problem.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/pci.c
drivers/net/wireless/mediatek/mt76/mt792x_regs.h

index 1fd99a856541589b1f3859795e8b23bcc0c06cdf..74cfba7675beb78f787ea9ff10cb917ea73d061a 100644 (file)
@@ -386,6 +386,8 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
 
        dev_info(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
 
+       mt76_rmw_field(dev, MT_HW_EMI_CTL, MT_HW_EMI_CTL_SLPPROT_EN, 1);
+
        ret = mt792x_wfsys_reset(dev);
        if (ret)
                goto err_free_dev;
index a99af23e4b5649d5095b241e144d5e1870bd2677..d7f9b24cd665fe581e8da7e7ab62bb2cabfbe8f2 100644 (file)
 #define MT_HW_CHIPID                   0x70010200
 #define MT_HW_REV                      0x70010204
 
+#define MT_HW_EMI_CTL                  0x18011100
+#define MT_HW_EMI_CTL_SLPPROT_EN       BIT(1)
+
 #define MT_PCIE_MAC_BASE               0x10000
 #define MT_PCIE_MAC(ofs)               (MT_PCIE_MAC_BASE + (ofs))
 #define MT_PCIE_MAC_INT_ENABLE         MT_PCIE_MAC(0x188)