linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 07/14] wifi: mt76: mt7915: decrease timeout for commonly issued MCU commands
Date: Mon, 30 Dec 2024 20:41:55 +0100	[thread overview]
Message-ID: <20241230194202.95065-7-nbd@nbd.name> (raw)
In-Reply-To: <20241230194202.95065-1-nbd@nbd.name>

This allows faster recovery from firmware issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 6efa1c95e953..7115394f6bd6 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -194,6 +194,25 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	return ret;
 }
 
+static void
+mt7915_mcu_set_timeout(struct mt76_dev *mdev, int cmd)
+{
+	if ((cmd & __MCU_CMD_FIELD_ID) != MCU_CMD_EXT_CID)
+		return;
+
+	switch (FIELD_GET(__MCU_CMD_FIELD_EXT_ID, cmd)) {
+	case MCU_EXT_CMD_THERMAL_CTRL:
+	case MCU_EXT_CMD_GET_MIB_INFO:
+	case MCU_EXT_CMD_PHY_STAT_INFO:
+	case MCU_EXT_CMD_STA_REC_UPDATE:
+	case MCU_EXT_CMD_BSS_INFO_UPDATE:
+		mdev->mcu.timeout = 2 * HZ;
+		return;
+	default:
+		break;
+	}
+}
+
 static int
 mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 			int cmd, int *wait_seq)
@@ -208,6 +227,8 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	else
 		qid = MT_MCUQ_WM;
 
+	mt7915_mcu_set_timeout(mdev, cmd);
+
 	return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[qid], skb, 0);
 }
 
-- 
2.47.1


  parent reply	other threads:[~2024-12-30 19:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-30 19:41 [PATCH 01/14] wifi: mt76: remove mt76_calculate_default_rate() Felix Fietkau
2024-12-30 19:41 ` [PATCH 02/14] wifi: mt76: mt7996: remove phy->monitor_vif Felix Fietkau
2024-12-30 19:41 ` [PATCH 03/14] wifi: mt76: mt7915: fix slot time for 5/6GHz Felix Fietkau
2024-12-30 19:41 ` [PATCH 04/14] wifi: mt76: mt7915: fix eifs value on older chipsets Felix Fietkau
2024-12-30 19:41 ` [PATCH 05/14] wifi: mt76: mt7996: fix rx filter setting for bfee functionality Felix Fietkau
2024-12-30 19:41 ` [PATCH 06/14] wifi: mt76: mt7915: reduce the number of command retries Felix Fietkau
2024-12-30 19:41 ` Felix Fietkau [this message]
2024-12-30 19:41 ` [PATCH 08/14] wifi: mt76: only enable tx worker after setting the channel Felix Fietkau
2024-12-30 19:41 ` [PATCH 09/14] wifi: mt76: mt7915: ensure that only one sta entry is active per mac address Felix Fietkau
2024-12-30 19:41 ` [PATCH 10/14] wifi: mt76: mt7915: hold dev->mutex while interacting with the thermal state Felix Fietkau
2024-12-30 19:41 ` [PATCH 11/14] wifi: mt76: mt7915: firmware restart on devices with a second pcie link Felix Fietkau
2024-12-30 19:42 ` [PATCH 12/14] wifi: mt76: mt7915: fix omac index assignment after hardware reset Felix Fietkau
2024-12-30 19:42 ` [PATCH 13/14] wifi: mt76: mt7996: use mac80211 .sta_state op Felix Fietkau
2024-12-30 19:42 ` [PATCH 14/14] wifi: mt76: do not add wcid entries to sta poll list during MCU reset Felix Fietkau

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=20241230194202.95065-7-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).