The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Wu. JackBB (GSM)" <JackBB_Wu@compal.com>
To: "netdev-bot+sashiko@kernel.org" <netdev-bot+sashiko@kernel.org>
Cc: "loic.poulain@oss.qualcomm.com" <loic.poulain@oss.qualcomm.com>,
	"ryazanov.s.a@gmail.com" <ryazanov.s.a@gmail.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"wen-zhi.huang@mediatek.com" <wen-zhi.huang@mediatek.com>,
	"shi-wei.yeh@mediatek.com" <shi-wei.yeh@mediatek.com>,
	"Minano.tseng@mediatek.com" <Minano.tseng@mediatek.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"Yu. Robert (GSM)" <robert_yu@compal.com>,
	"Chang. Jeff (GSM)" <Jeff_Chang@compal.com>,
	"edumazet@kernel.org" <edumazet@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH net-next v14 6/6] net: wwan: t9xx: Add AT & MBIM WWAN ports
Date: Fri, 4 Dec 2026 06:15:58 +0000	[thread overview]
Message-ID: <1ce10a2977f04ba9ac8f4649e8784be6@compal.com> (raw)
In-Reply-To: <179629120355.3146.3262911149272753703@kernel.org>

Thanks for the review.

> Can this hold the WWAN core's ops_lock for an unbounded time while the
> modem stalls TX completion?
>
> wwan_port_op_tx() calls this with port->ops_lock held:
>
> drivers/net/wwan/wwan_core.c:wwan_port_op_tx() {
> 	mutex_lock(&port->ops_lock);
>     ...
> 	else
> 		ret = port->ops->tx_blocking(port, skb);
>     ...
> }
>
> Under that lock, mtk_port_common_write(blocking=true) sleeps twice with
> no timeout. The first sleep is in mtk_port_wait_tx_space():
>
> 	wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
>
> The second is once per CCCI packet in mtk_port_send_data(), waiting for
> the modem to complete that packet's TRB:
>
> 	/* no timeout in tx blocking mode */
> 	ret = wait_event_interruptible(port->trb_wq,
> 				       mtk_port_trb_done(trb) ||
> 				       test_bit(PORT_S_FLUSH, &port->status) ||
> 				       !test_bit(PORT_S_WR, &port->status));
>
> Only a signal to the writer, a port disable or PORT_S_FLUSH ends these
> waits. In the meantime, other ops_lock users of the same wwan_port block
> in an uninterruptible mutex_lock(). These include wwan_port_fops_poll()
> on every poll()/epoll call, open()/close() from another process through
> wwan_port_op_start()/wwan_port_op_stop(), and other writers.
>
> If the CLDMA queue or the firmware stops completing TRBs on the AT or
> MBIM channel, won't those tasks stay in D state for as long as the stall
> lasts, and possibly trigger hung-task warnings?
>
> The commit message cites the t7xx .tx path as precedent. That path only
> waits for queue budget. Waiting for per-packet modem completion under
> ops_lock seems new here. The other in-tree tx_blocking user,
> rpmsg_wwan_ctrl through rpmsg_send(), has a bounded wait.
>
> Would a timeout on the per-packet completion wait, or not waiting for
> completion under ops_lock, avoid this?

True.

Will fix in v15: a blocking write no longer waits for the TX
completion of each packet. It waits for room in the port's TX queue,
queues its packets and returns; a TX error reported later is logged by
the completion, as for a non-blocking write. What is left under ops_lock
is the interruptible wait for queue room, which is what the t7xx .tx
path does (queue->budget > 0, no timeout); port removal still ends it
before wwan_remove_port() takes the lock. Note that rpmsg_send() is
bounded only on the virtio backend; the qcom_smd one waits for FIFO
space without a timeout.

Thanks,
Jack

pw-bot: cr

  reply	other threads:[~2026-12-04  6:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  8:58 [PATCH net-next v14 0/6] net: wwan: t9xx: Add MediaTek T9XX WWAN driver Jack Wu via B4 Relay
2026-12-02  8:59 ` [PATCH net-next v14 1/6] net: wwan: t9xx: Add PCIe core Jack Wu via B4 Relay
2026-12-03  9:46   ` netdev-bot+sashiko
2026-12-04  6:15     ` Wu. JackBB (GSM)
2026-12-02  8:59 ` [PATCH net-next v14 2/6] net: wwan: t9xx: Add control plane transaction layer framework Jack Wu via B4 Relay
2026-12-02  8:59 ` [PATCH net-next v14 3/6] net: wwan: t9xx: Add control DMA interface Jack Wu via B4 Relay
2026-12-03  9:46   ` netdev-bot+sashiko
2026-12-02  8:59 ` [PATCH net-next v14 4/6] net: wwan: t9xx: Add control port Jack Wu via B4 Relay
2026-12-03  9:46   ` netdev-bot+sashiko
2026-12-02  8:59 ` [PATCH net-next v14 5/6] net: wwan: t9xx: Add FSM thread Jack Wu via B4 Relay
2026-12-03  9:46   ` netdev-bot+sashiko
2026-12-04  6:14     ` Wu. JackBB (GSM)
2026-12-02  8:59 ` [PATCH net-next v14 6/6] net: wwan: t9xx: Add AT & MBIM WWAN ports Jack Wu via B4 Relay
2026-12-03  9:46   ` netdev-bot+sashiko
2026-12-04  6:15     ` Wu. JackBB (GSM) [this message]
2026-12-04  6:21 ` [PATCH net-next v14 0/6] net: wwan: t9xx: Add MediaTek T9XX WWAN driver Wu. JackBB (GSM)

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=1ce10a2977f04ba9ac8f4649e8784be6@compal.com \
    --to=jackbb_wu@compal.com \
    --cc=Jeff_Chang@compal.com \
    --cc=Minano.tseng@mediatek.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robert_yu@compal.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=shi-wei.yeh@mediatek.com \
    --cc=skhan@linuxfoundation.org \
    --cc=wen-zhi.huang@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