Skip to content

Commit

Permalink
mt76: mt7921: reduce mcu timeouts for suspend, offload and hif_ctrl msg
Browse files Browse the repository at this point in the history
Reduce mcu timeout for the following uni mcu commands:
- MCU_UNI_CMD_SUSPEND
- MCU_UNI_CMD_OFFLOAD
- MCU_UNI_CMD_HIF_CTRL

This is a preliminary patch to introduce chip reset support

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Lorenzo Bianconi authored and Felix Fietkau committed Apr 11, 2021
1 parent 7820183 commit a2a6cd5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,16 @@ mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
u32 val;
u8 seq;

/* TODO: make dynamic based on msg type */
mdev->mcu.timeout = 20 * HZ;
switch (cmd) {
case MCU_UNI_CMD_HIF_CTRL:
case MCU_UNI_CMD_SUSPEND:
case MCU_UNI_CMD_OFFLOAD:
mdev->mcu.timeout = HZ / 3;
break;
default:
mdev->mcu.timeout = 3 * HZ;
break;
}

seq = ++dev->mt76.mcu.msg_seq & 0xf;
if (!seq)
Expand Down

0 comments on commit a2a6cd5

Please sign in to comment.