From: Felix Fietkau Date: Wed, 6 Jan 2021 09:43:03 +0000 (+0100) Subject: mt76: mt7915: disable RED support in the WA firmware X-Git-Tag: accepted/tizen/unified/20230118.172025~7901^2~62^2~16^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1fd2cae2e484d27f435064781cc5cbd230b6934;p=platform%2Fkernel%2Flinux-rpi.git mt76: mt7915: disable RED support in the WA firmware It causes high CPU load on the WA core, which can lead to extra latency when using many stations. Dropping packets for long queues is managed by mac80211 fq_codel instead Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 59a5ef2..44cef96 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -314,6 +314,22 @@ exit: } static void +mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3) +{ + struct { + __le32 args[3]; + } req = { + .args = { + cpu_to_le32(a1), + cpu_to_le32(a2), + cpu_to_le32(a3), + }, + }; + + mt76_mcu_send_msg(&dev->mt76, cmd, &req, sizeof(req), true); +} + +static void mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) { if (vif->csa_active) @@ -2831,6 +2847,7 @@ int mt7915_mcu_init(struct mt7915_dev *dev) set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state); mt7915_mcu_fw_log_2_host(dev, 0); mt7915_mcu_set_mwds(dev, 1); + mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET), MCU_WA_PARAM_RED, 0, 0); return 0; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h index bd136ca..2d58414 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -239,6 +239,7 @@ enum { MCU_CMD_PATCH_START_REQ = 0x05, MCU_CMD_PATCH_FINISH_REQ = 0x07, MCU_CMD_PATCH_SEM_CONTROL = 0x10, + MCU_CMD_WA_PARAM = 0xC4, MCU_CMD_EXT_CID = 0xED, MCU_CMD_FW_SCATTER = 0xEE, MCU_CMD_RESTART_DL_REQ = 0xEF, @@ -277,6 +278,17 @@ enum { MCU_EXT_CMD_PHY_STAT_INFO = 0xad, }; +enum { + MCU_WA_PARAM_CMD_QUERY, + MCU_WA_PARAM_CMD_SET, + MCU_WA_PARAM_CMD_CAPABILITY, + MCU_WA_PARAM_CMD_DEBUG, +}; + +enum { + MCU_WA_PARAM_RED = 0x0e, +}; + #define MCU_CMD(_t) FIELD_PREP(__MCU_CMD_FIELD_ID, MCU_CMD_##_t) #define MCU_EXT_CMD(_t) (MCU_CMD(EXT_CID) | \ FIELD_PREP(__MCU_CMD_FIELD_EXT_ID, \ @@ -285,6 +297,9 @@ enum { #define MCU_WA_CMD(_t) (MCU_CMD(_t) | __MCU_CMD_FIELD_WA) #define MCU_WA_EXT_CMD(_t) (MCU_EXT_CMD(_t) | __MCU_CMD_FIELD_WA) +#define MCU_WA_PARAM_CMD(_t) (MCU_WA_CMD(WA_PARAM) | \ + FIELD_PREP(__MCU_CMD_FIELD_EXT_ID, \ + MCU_WA_PARAM_CMD_##_t)) enum { PATCH_SEM_RELEASE,