From 0a094b11f3c0392f0ff7cde57ee1f2db9dea4fc5 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Thu, 15 Apr 2021 17:50:02 +0200 Subject: [PATCH] mt76: improve mcu error logging Dump mcu command code in hex and related prefix to help debugging Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- mt7603/mcu.c | 5 ++--- mt7615/mcu.c | 4 ++-- mt76x02_mcu.c | 5 ++--- mt7915/mcu.c | 2 +- mt7921/mcu.c | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mt7603/mcu.c b/mt7603/mcu.c index 96b6c891..6abfe6b1 100644 --- a/mt7603/mcu.c +++ b/mt7603/mcu.c @@ -21,9 +21,8 @@ mt7603_mcu_parse_response(struct mt76_dev *mdev, int cmd, struct mt7603_mcu_rxd *rxd; if (!skb) { - dev_err(mdev->dev, - "MCU message %d (seq %d) timed out\n", - cmd, seq); + dev_err(mdev->dev, "MCU message %02x (seq %d) timed out\n", + abs(cmd), seq); dev->mcu_hang = MT7603_WATCHDOG_TIMEOUT; return -ETIMEDOUT; } diff --git a/mt7615/mcu.c b/mt7615/mcu.c index 2e113fd4..be976fe9 100644 --- a/mt7615/mcu.c +++ b/mt7615/mcu.c @@ -175,8 +175,8 @@ int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd, int ret = 0; if (!skb) { - dev_err(mdev->dev, "Message %ld (seq %d) timeout\n", - cmd & MCU_CMD_MASK, seq); + dev_err(mdev->dev, "Message %08x (seq %d) timeout\n", + cmd, seq); return -ETIMEDOUT; } diff --git a/mt76x02_mcu.c b/mt76x02_mcu.c index 4aa5c36a..75978820 100644 --- a/mt76x02_mcu.c +++ b/mt76x02_mcu.c @@ -17,9 +17,8 @@ int mt76x02_mcu_parse_response(struct mt76_dev *mdev, int cmd, u32 *rxfce; if (!skb) { - dev_err(mdev->dev, - "MCU message %d (seq %d) timed out\n", cmd, - seq); + dev_err(mdev->dev, "MCU message %02x (seq %d) timed out\n", + abs(cmd), seq); dev->mcu_timeout = 1; return -ETIMEDOUT; } diff --git a/mt7915/mcu.c b/mt7915/mcu.c index 3f9d26ba..4ad652a2 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -217,7 +217,7 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd, int ret = 0; if (!skb) { - dev_err(mdev->dev, "Message %d (seq %d) timeout\n", + dev_err(mdev->dev, "Message %08x (seq %d) timeout\n", cmd, seq); return -ETIMEDOUT; } diff --git a/mt7921/mcu.c b/mt7921/mcu.c index 1f231088..a3609299 100644 --- a/mt7921/mcu.c +++ b/mt7921/mcu.c @@ -160,7 +160,7 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd, int ret = 0; if (!skb) { - dev_err(mdev->dev, "Message %d (seq %d) timeout\n", + dev_err(mdev->dev, "Message %08x (seq %d) timeout\n", cmd, seq); return -ETIMEDOUT; }