mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Chris Lew <christopher.lew@oss.qualcomm.com>
Cc: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>,
	Pranav Mahesh Phansalkar <pranav.phansalkar@oss.qualcomm.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: [REGRESSION] ath12k suspend/resume breakage on 7.3-rc2
Date: Sun, 13 Sep 2026 10:39:47 +0200	[thread overview]
Message-ID: <878q55sfxo.wl-tiwai@suse.de> (raw)
In-Reply-To: <87a4plsg4w.wl-tiwai@suse.de>

On Sun, 13 Sep 2026 10:35:27 +0200,
Takashi Iwai wrote:
> 
> Hi,
> 
> on 7.3-rc2, the suspend/resume of ath12k WiFi on Lenovo Thinkpad T14s
> Gen6 AMD model is broken.  Upon suspend, the network isn't recovered,
> and the desktop got eventually frozen.
> 
> The git bisect pointed to the commit
> 544d85de4dc22c01badfd8cefa59829ce35c4858
>     net: qrtr: Send HELLO message on endpoint register
> 
> and reverting this fixed the problem.
> 
> Below is the (stripped) dmesg output after the resume showing the
> problem.
> 
> As far as I understand, the problem seems to be the change of the code
> flow: ath12k uses mhi_power_down_keep_dev() during suspend, so the
> qcom_mhi_qrtr_remove() and *_probe() won't be called.  This makes the
> driver endlessly waiting for the HELLO handshake upon resume with the
> commit above.

... and below is a quick fix I tested.  It seems working so far.


Takashi

-- 8< --
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] net: qrtr: Fix suspend/resume regression in HELLO handshake

Commit 544d85de4dc2 ("net: qrtr: Send HELLO message on endpoint register")
broke suspend/resume for ath12k (wcn7850 over MHI/QRTR).

The new protocol from the commit works on first boot: the host sends a
proactive HELLO at endpoint registration, firmware replies, and ath12k
waits for fw_ready.  However, ath12k uses mhi_power_down_keep_dev()
during suspend so that the MHI device (and the QRTR endpoint) remain
registered across the power cycle.  This means qcom_mhi_qrtr_remove()
and qcom_mhi_qrtr_probe() are never called on resume: qrtr_endpoint_
register() never runs, and hello_sent stays true from the initial probe.

On resume, the wcn7850 firmware restarts and sends a HELLO to the host NS,
expecting a reply to re-establish the QRTR connection.  Without that reply,
the firmware's handshake never completes, fw_ready is never sent, and
ath12k_core_resume() times out waiting for restart_completed (-ETIMEDOUT).
mac80211 then emits WARNINGs about hardware unavailability and cfg80211
tries to stop interfaces that were never started.

This patch fixes the regression by restoring say_hello() in
ctrl_cmd_hello() so the NS again replies to an incoming HELLO from a
remote node.  Also the patch removes the proactive HELLO from
qrtr_endpoint_register(); with both the proactive HELLO and the NS
reply active, the firmware receives two HELLOs from the host on first
boot, which confuses its state machine.  Since wcn7850 always
initiates the HELLO itself, the proactive HELLO is redundant.
The retry machinery in qrtr_send_hello() is retained to handle the
case where the HELLO reply fails transiently.

Fixes: 544d85de4dc2 ("net: qrtr: Send HELLO message on endpoint register")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 net/qrtr/af_qrtr.c | 25 +++++++++++--------------
 net/qrtr/ns.c      | 29 +++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c
index 78347c937af7..88cfc116dbdf 100644
--- a/net/qrtr/af_qrtr.c
+++ b/net/qrtr/af_qrtr.c
@@ -598,29 +598,29 @@ static void qrtr_hello_work(struct work_struct *work)
 	struct qrtr_ctrl_pkt *pkt;
 	struct qrtr_node *node;
 	struct qrtr_sock *ctrl;
+	bool reschedule = true;
 	struct sk_buff *skb;
 
 	node = container_of(to_delayed_work(work), struct qrtr_node, say_hello);
 
-	/* NS must be bound before we can send; retry with backoff if not ready */
 	ctrl = qrtr_port_lookup(QRTR_PORT_CTRL);
-	if (!ctrl) {
-		schedule_delayed_work(&node->say_hello, msecs_to_jiffies(100));
-		return;
-	}
+	if (!ctrl)
+		goto out_reschedule;
 
 	skb = qrtr_alloc_ctrl_packet(&pkt, GFP_KERNEL);
-	if (!skb) {
-		qrtr_port_put(ctrl);
-		schedule_delayed_work(&node->say_hello, msecs_to_jiffies(100));
-		return;
-	}
+	if (!skb)
+		goto out_put;
 
 	pkt->cmd = cpu_to_le32(QRTR_TYPE_HELLO);
 	from.sq_node = qrtr_local_nid;
 	to.sq_node = node->nid;
-	qrtr_node_enqueue(node, skb, QRTR_TYPE_HELLO, &from, &to);
+	if (!qrtr_node_enqueue(node, skb, QRTR_TYPE_HELLO, &from, &to))
+		reschedule = false;
+out_put:
 	qrtr_port_put(ctrl);
+out_reschedule:
+	if (reschedule)
+		schedule_delayed_work(&node->say_hello, msecs_to_jiffies(100));
 }
 
 /**
@@ -661,9 +661,6 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid)
 	mutex_unlock(&qrtr_node_lock);
 	ep->node = node;
 
-	/* Initiate HELLO handshake from the core layer */
-	schedule_delayed_work(&node->say_hello, 0);
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(qrtr_endpoint_register);
diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
index bcb090ee79d4..fe2dfc05e380 100644
--- a/net/qrtr/ns.c
+++ b/net/qrtr/ns.c
@@ -327,8 +327,37 @@ static int server_del(struct qrtr_node *node, unsigned int port, bool bcast)
 	return 0;
 }
 
+static int say_hello(struct sockaddr_qrtr *dest)
+{
+	struct qrtr_ctrl_pkt pkt;
+	struct msghdr msg = { };
+	struct kvec iv;
+	int ret;
+
+	iv.iov_base = &pkt;
+	iv.iov_len = sizeof(pkt);
+
+	memset(&pkt, 0, sizeof(pkt));
+	pkt.cmd = cpu_to_le32(QRTR_TYPE_HELLO);
+
+	msg.msg_name = (struct sockaddr *)dest;
+	msg.msg_namelen = sizeof(*dest);
+
+	ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
+	if (ret < 0)
+		pr_err("failed to send hello msg\n");
+
+	return ret;
+}
+
 static int ctrl_cmd_hello(struct sockaddr_qrtr *sq)
 {
+	int ret;
+
+	ret = say_hello(sq);
+	if (ret < 0)
+		return ret;
+
 	return announce_servers(sq);
 }
 
-- 
2.55.0


  reply	other threads:[~2026-09-13  8:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13  8:35 Takashi Iwai
2026-09-13  8:39 ` Takashi Iwai [this message]
2026-09-13  9:03   ` Thorsten Leemhuis
2026-09-14  6:22     ` Takashi Iwai

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=878q55sfxo.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=christopher.lew@oss.qualcomm.com \
    --cc=deepak.singh@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pranav.phansalkar@oss.qualcomm.com \
    --cc=regressions@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®