mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
mt76: mt7921: Fix out of order process by invalid event pkt
[ Upstream commitcd3f387371] The acceptable event report should inlcude original CMD-ID. Otherwise, drop unexpected result from fw. Fixes:1c099ab447("mt76: mt7921: add MCU support") Signed-off-by: Jimmy Hu <Jimmy.Hu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
75ed8ca355
commit
7f2d2c8d93
@@ -157,6 +157,7 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
|
||||
struct sk_buff *skb, int seq)
|
||||
{
|
||||
struct mt7921_mcu_rxd *rxd;
|
||||
int mcu_cmd = cmd & MCU_CMD_MASK;
|
||||
int ret = 0;
|
||||
|
||||
if (!skb) {
|
||||
@@ -194,6 +195,9 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
|
||||
skb_pull(skb, sizeof(*rxd));
|
||||
event = (struct mt7921_mcu_uni_event *)skb->data;
|
||||
ret = le32_to_cpu(event->status);
|
||||
/* skip invalid event */
|
||||
if (mcu_cmd != event->cid)
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
case MCU_CMD_REG_READ: {
|
||||
|
||||
Reference in New Issue
Block a user