public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Chad Monroe <chad@monroe.io>
Cc: Felix Fietkau <nbd@nbd.name>,
	Johannes Berg <johannes.berg@intel.com>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mt76: mt7996: reset device after MCU message timeout
Date: Mon, 8 Dec 2025 15:18:33 +0100	[thread overview]
Message-ID: <aTbeOResfSpMk6hZ@lore-desk> (raw)
In-Reply-To: <27bebda195599b55d097f4586a034dddce5d2cc0.1765202889.git.chad@monroe.io>

[-- Attachment #1: Type: text/plain, Size: 2065 bytes --]

> Trigger a full reset after MCU message timeout.
> 
> Signed-off-by: Chad Monroe <chad@monroe.io>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 5 +++++
>  drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 9 +++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> index 2560e2f46e89..07b0a694c1bb 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> @@ -2736,6 +2736,11 @@ void mt7996_reset(struct mt7996_dev *dev)
>  		return;
>  	}
>  
> +	if ((READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA)) {

nit: you do not need double brackets here.

Regards,
Lorenzo

> +		set_bit(MT76_MCU_RESET, &dev->mphy.state);
> +		wake_up(&dev->mt76.mcu.wait);
> +	}
> +
>  	queue_work(dev->mt76.wq, &dev->reset_work);
>  	wake_up(&dev->reset_wait);
>  }
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> index 14a88ef79b6c..40ebda9a3f12 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> @@ -209,6 +209,7 @@ static int
>  mt7996_mcu_parse_response(struct mt76_dev *mdev, int cmd,
>  			  struct sk_buff *skb, int seq)
>  {
> +	struct mt7996_dev *dev = container_of(mdev, struct mt7996_dev, mt76);
>  	struct mt7996_mcu_rxd *rxd;
>  	struct mt7996_mcu_uni_event *event;
>  	int mcu_cmd = FIELD_GET(__MCU_CMD_FIELD_ID, cmd);
> @@ -217,6 +218,14 @@ mt7996_mcu_parse_response(struct mt76_dev *mdev, int cmd,
>  	if (!skb) {
>  		dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
>  			cmd, seq);
> +
> +		if (!test_and_set_bit(MT76_MCU_RESET, &dev->mphy.state)) {
> +			dev->recovery.restart = true;
> +			wake_up(&dev->mt76.mcu.wait);
> +			queue_work(dev->mt76.wq, &dev->reset_work);
> +			wake_up(&dev->reset_wait);
> +		}
> +
>  		return -ETIMEDOUT;
>  	}
>  
> -- 
> 2.47.3
> 
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-12-08 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 14:08 [PATCH] mt76: mt7996: reset device after MCU message timeout Chad Monroe
2025-12-08 14:18 ` Lorenzo Bianconi [this message]
2025-12-08 17:36   ` Chad Monroe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aTbeOResfSpMk6hZ@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=chad@monroe.io \
    --cc=evelyn.tsai@mediatek.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox