From: Peter Hunt <peter.hunt@opengear.com>
To: peter.hunt@opengear.com, Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: ryazanov.s.a@gmail.com, johannes@sipsolutions.net,
mani@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, mhi@lists.linux.dev,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v8 1/2] net: wwan: core: propagate modem control signals to port drivers
Date: Thu, 8 Oct 2026 18:17:14 -0600 [thread overview]
Message-ID: <20261009001714.1078580-1-peter.hunt@opengear.com> (raw)
In-Reply-To: <CAFEp6-2QsKyZfEdSotVPhxVNOyRzncUphqLY5cRwHXGJiEbzuA@mail.gmail.com>
Hi Loic,
Thanks for the review.
On Thu, Oct 8, 2026 at 5:19 PM Loic Poulain wrote:
>> + if (port->start_count == 1)
>
> You basically have the same check above
Agreed, v9 raises DTR/RTS inside the existing first-open branch, once
->start() has succeeded.
>> + if (port->type == WWAN_PORT_AT)
>> + call_dtr_rts = true;
>
> Any reason not to just call dtr_rts() whenever the callback is
> implemented?
wwan_port_fops_at_ioctl() serves both AT and QCDM ports. DTR/RTS only
means something on the AT (DUN) port of these modems, QCDM is the DIAG
channel and has no DTR semantics. Open, close and removal raise and drop
the lines for AT ports only, so I kept the ioctl path on the same rule.
Review of v3 flagged the opposite mismatch, where a QCDM port could have
DTR raised through TIOCMSET but never dropped on close.
If there is a case you have in mind where a non-AT port driver would
want ->dtr_rts, I'm happy to drop the type check, but I'd do it in all
four places (open, close, removal and ioctl) so they stay consistent. Is
there something I haven't thought of?
> So now we end up with two mutexes essentially protecting the same
> state. Since dtr_rts() is always called under ops_lock, and the ioctl
> path acquires both ops_lock and data_lock, would it make sense to drop
> data_lock altogether and rely solely on ops_lock?
I looked at this, and my concern is blocking writes. wwan_port_op_tx()
holds ops_lock across the driver's ->tx_blocking(), and
rpmsg_wwan_ctrl implements that with rpmsg_send(), which can sleep until
the remote has space. If the termios and TIOCM state moved under
ops_lock, TCGETS, TIOCMGET and the rest of the AT/QCDM ioctls on those
ports would wait behind a stuck write. Today they only take data_lock
and return straight away. The automated review of v7 raised the same
point about the TIOCM path taking ops_lock.
What I'd suggest instead is to keep data_lock for the termios/TIOCM
state, and only take ops_lock (with mutex_lock_interruptible()) for the
->dtr_rts call itself. v9 already reduces how often that happens, as it
only calls ->dtr_rts when DTR or RTS actually changes. Would that work
for you, or would you still prefer a single lock?
Thanks,
Peter
next prev parent reply other threads:[~2026-10-09 0:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 18:22 [PATCH net-next v8 0/2] net: wwan: support DTR/RTS on AT ports via MHI IP_CTRL Peter Hunt
2026-10-07 18:22 ` [PATCH net-next v8 1/2] net: wwan: core: propagate modem control signals to port drivers Peter Hunt
2026-10-08 15:19 ` Loic Poulain
2026-10-09 0:17 ` Peter Hunt [this message]
2026-10-07 18:22 ` [PATCH net-next v8 2/2] net: wwan: mhi_wwan_ctrl: drive DTR/RTS via the IP_CTRL channel Peter Hunt
2026-10-08 15:30 ` Loic Poulain
2026-10-09 0:17 ` Peter Hunt
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=20261009001714.1078580-1-peter.hunt@opengear.com \
--to=peter.hunt@opengear.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.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