All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Joonhoe Kim <26rote@gmail.com>
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	 pabeni@redhat.com, horms@kernel.org,
	christopher.lew@oss.qualcomm.com,  deepak.singh@oss.qualcomm.com,
	pranav.phansalkar@oss.qualcomm.com, andersson@kernel.org,
	 linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,  regressions@lists.linux.dev,
	stable@vger.kernel.org
Subject: Re: [PATCH net] net: qrtr: ns: retry service announcements on -EAGAIN
Date: Sat, 17 Oct 2026 09:24:38 +0530	[thread overview]
Message-ID: <atLkH_D2JrYdzacx@debian> (raw)
In-Reply-To: <20261016124600.31-1-26rote@gmail.com>

On Fri, Oct 16, 2026 at 09:45:59PM +0900, Joonhoe Kim wrote:
> Since commit 544d85de4dc2 ("net: qrtr: Send HELLO message on endpoint
> register"), qrtr_node_enqueue() returns -EAGAIN for every packet but
> HELLO until our HELLO has gone out to the node. The HELLO is retried,
> but the NEW_SERVER announcements sent in reply to the remote's HELLO
> are not, so a service registered before the remote came up is never
> announced to it.
> 
> On Kaanapali the modem sends its HELLO before it accepts ours. With
> rmtfs started first, the modem never learns about rmtfs and its
> watchdog resets the SoC about 40 s later.
> 
> Retry each announcement for up to 10 s while it fails with -EAGAIN.
> announce_servers() runs from the name service worker, which can sleep.
> 
> Fixes: 544d85de4dc2 ("net: qrtr: Send HELLO message on endpoint register")
> Cc: stable@vger.kernel.org
> Signed-off-by: Joonhoe Kim <26rote@gmail.com>

Thanks for the fix!

> ---
> Tested on a Lenovo Legion Tab Y700 Gen 5 (out-of-tree board support)
> with rmtfs started before the modem: without this patch the SoC resets;
> with it the announcement goes out on the first retry and the modem
> stays up. Starting rmtfs after the modem avoids the problem, but
> distribution units start rmtfs first and let it boot the modem.
> 
>  net/qrtr/ns.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
> index bcb090ee79d4..33a9c4449d6f 100644
> --- a/net/qrtr/ns.c
> +++ b/net/qrtr/ns.c
> @@ -5,6 +5,7 @@
>   * Copyright (c) 2020, Linaro Ltd.
>   */
>  
> +#include <linux/delay.h>
>  #include <linux/module.h>
>  #include <linux/qrtr.h>
>  #include <linux/workqueue.h>
> @@ -226,7 +227,13 @@ static int announce_servers(struct sockaddr_qrtr *sq)
>  
>  	/* Announce the list of servers registered in this node */
>  	xa_for_each(&node->servers, index, srv) {
> +		unsigned long timeout = jiffies + 10 * HZ;
> +
>  		ret = service_announce_new(sq, srv);
> +		while (ret == -EAGAIN && time_before(jiffies, timeout)) {
> +			msleep(100);
> +			ret = service_announce_new(sq, srv);
> +		}

This loop is going to block other nodes. announce_servers() is called from
ordered workqueue which only executes atmost one work item at any point of time.
So if any other node queues command while this loop is running, it will get
blocked.

What you can do is, ask your LLM to rework this code to schedule a new *delayed*
work in the same qrts_ns.workqueue and just keep on rescheduling it until
-EAGAIN is not received from announce_servers(). While the new work item gets
scheduled on the same workqueue, the delayed work gives other node's a chance
to execute and not just block. You can use a conservative delay of 100ms.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

      parent reply	other threads:[~2026-10-17  3:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:45 [PATCH net] net: qrtr: ns: retry service announcements on -EAGAIN Joonhoe Kim
2026-10-16 13:14 ` Konrad Dybcio
2026-10-16 13:20   ` Joonhoe Kim
2026-10-16 13:22     ` Konrad Dybcio
2026-10-17  3:54 ` Manivannan Sadhasivam [this message]

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=atLkH_D2JrYdzacx@debian \
    --to=mani@kernel.org \
    --cc=26rote@gmail.com \
    --cc=andersson@kernel.org \
    --cc=christopher.lew@oss.qualcomm.com \
    --cc=davem@davemloft.net \
    --cc=deepak.singh@oss.qualcomm.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pranav.phansalkar@oss.qualcomm.com \
    --cc=regressions@lists.linux.dev \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.