Commit cd3f3873 authored by Deren Wu's avatar Deren Wu Committed by Felix Fietkau

mt76: mt7921: Fix out of order process by invalid event pkt

The acceptable event report should inlcude original CMD-ID. Otherwise,
drop unexpected result from fw.

Fixes: 1c099ab4 ("mt76: mt7921: add MCU support")
Signed-off-by: default avatarJimmy Hu <Jimmy.Hu@mediatek.com>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent bad67a26
...@@ -157,6 +157,7 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd, ...@@ -157,6 +157,7 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
struct sk_buff *skb, int seq) struct sk_buff *skb, int seq)
{ {
struct mt7921_mcu_rxd *rxd; struct mt7921_mcu_rxd *rxd;
int mcu_cmd = cmd & MCU_CMD_MASK;
int ret = 0; int ret = 0;
if (!skb) { if (!skb) {
...@@ -194,6 +195,9 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd, ...@@ -194,6 +195,9 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
skb_pull(skb, sizeof(*rxd)); skb_pull(skb, sizeof(*rxd));
event = (struct mt7921_mcu_uni_event *)skb->data; event = (struct mt7921_mcu_uni_event *)skb->data;
ret = le32_to_cpu(event->status); ret = le32_to_cpu(event->status);
/* skip invalid event */
if (mcu_cmd != event->cid)
ret = -EAGAIN;
break; break;
} }
case MCU_CMD_REG_READ: { case MCU_CMD_REG_READ: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment