mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chrispine Tinega <dev@chrispinetinega.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chrispine Tinega <dev@chrispinetinega.com>
Subject: Re: [PATCH v2] rpmsg: char: Drop messages that arrive while the device is closed
Date: Fri,  4 Dec 2026 07:04:11 +0300	[thread overview]
Message-ID: <20261204040411.2238449-1-dev@chrispinetinega.com> (raw)
In-Reply-To: <axGl4BY14sMMPzqY@p14s>

Hi Mathieu,

On Thu, Dec 03, 2026 at 11:24:48AM -0600, Mathieu Poirier wrote:
> > +	if (eptdev->default_ept && !eptdev->ept) {
>
> Is there a point in checking @eptdev->default at all?  From what I understand,
> checking @eptdev->ept should be sufficient.
>
> Otherwise I'm good with your patch.

For a non-default endpoint, rpmsg_eptdev_open() calls rpmsg_create_ept()
and only assigns eptdev->ept after it returns. A transport can invoke
rpmsg_ept_cb() inside that window while eptdev->ept is still NULL.

For example, qcom_smd_create_ept() -> qcom_smd_channel_open() installs
the callback and moves the channel to SMD_CHANNEL_OPENED before sleeping
for the remote state. If the remote side opens and sends an initial
message, qcom_smd_channel_intr() runs rpmsg_ept_cb() in IRQ context
before rpmsg_eptdev_open() wakes up to set eptdev->ept.
virtio_rpmsg_create_ept() also registers the endpoint in vrp->endpoints
before returning.

Checking !eptdev->ept unconditionally would drop those initial messages
on a newly opened non-default endpoint. On release, non-default
endpoints are already torn down by rpmsg_destroy_ept(), so only
eptdev->default_ept needs this guard.

Let me know if you want a brief comment noting that in rpmsg_ept_cb() in
a v3, or if v2 is fine as is.

Regards,
Chrispine

  reply	other threads:[~2026-12-04  4:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 19:14 Chrispine Tinega
2026-12-03 17:24 ` Mathieu Poirier
2026-12-04  4:04   ` Chrispine Tinega [this message]
2026-12-04 15:18     ` Mathieu Poirier

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=20261204040411.2238449-1-dev@chrispinetinega.com \
    --to=dev@chrispinetinega.com \
    --cc=andersson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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

all inboxes | Powered by JetHome®