From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.54.127.134 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796357329; b=TOzucSWmY9cHbK9i8iKt3XiNbZnMMAqsAxkNiRbIEwbIVJgNG82LOijFIUSM4mVSwd7m zkXnqDMN0OXLlHWZrIVENYn7bPsL1OyxCrAYwqgptA9mA2vS0jfqt6IIcrVeYXmOK3hzH +3TginpxeyTfA7ZJMOsPRaeo3E5uCAQe2P0h0Qt7R9fKrZ/v2fpb4bBLk7fT4MoeLXCBs ZpdLEBXkyzSsKksTkGCX+eYVCt0gACya6vuUUpHZ27OryLZ8/8Hr4Cwb7JEw0XeJffcZu 5uhhn9VhcEYoS5POsIvVhfai7r8Wh7UC47k2a351gmF0gV7Xiwfm5MWFKjvvuyN3a+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796357329; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Envelope-From; bh=BTwcKHsXbDWvyjkwL72v47CInguicPks0Lec3OWBs1E=; b=qyC/dIR59l1uU+wiAQxLrUVWqTcQVh4rENKWQGnw1oXGk4hSO+3QCbdzS89pXrkSk/xT UYDAM2rS12m5VaLE5ZwNX9BAVQxw5h7jtsolMwTIvnYzxG4IBe62HfD0U+bAWjtb7dFrf mEgc2Q99ryTfASFIVep8+ltKSDWDLF1xyaDMZlQHJ/AiaXRNe14EoBFywfTKYHQ5W4/SJ C2KDOKi/rAoBHF/j30Nw+5/JvS2pui8WauTIEo+PE6Q1uuRy254ToO1aYN6arLJQPJSQS 6tTBCZuGgE2o0MhDMuWoETsq7gpj08WaX25CMUUqXeiIIw0Rq6M5hEcFGiV/ZZJc0rg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrispinetinega.com; spf=pass smtp.mailfrom=chrispinetinega.com; dkim=pass header.d=chrispinetinega.com header.i=@chrispinetinega.com header.a=rsa-sha256 header.s=default header.b=mmSvZ56b; arc=none smtp.remote-ip=198.54.127.134 Received: from out-2z4y-a134.jellyfish.systems (out-2z4y-a134.jellyfish.systems [198.54.127.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAC8D606A322 for ; Fri, 4 Dec 2026 04:08:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DAC8D606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chrispinetinega.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrispinetinega.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=chrispinetinega.com header.i=@chrispinetinega.com header.a=rsa-sha256 header.s=default header.b=mmSvZ56b Received: from mail.privateemail.com (unknown [62.8.90.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4jgdJn2QJKzyNc; Fri, 04 Dec 2026 04:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrispinetinega.com; s=default; t=1796357307; bh=BTwcKHsXbDWvyjkwL72v47CInguicPks0Lec3OWBs1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mmSvZ56bx1eH1JBqkgBN5TNzSUjK/uFh4cafeUn3JQHHWNREjMhi1ZRcyozMt0Iap MoVeFJTRMgMmBSGsstMpeIHN3BdRnpvh8fc1xzN67WvC6nqQ0xzZnyCIRW47LMqrpv D2Dt/30DBJTJEsAVEmFbPxafE3XXFQU0mPWodMzXjdmxouVinh06y2OG78NWRf/wv8 VpP4s7QlRSQrHLqka0PkXkaSleSirPa9LOmmxcOSZS/JaZmbfSScBlb5dDWMcJBCGv Me/+F6P7GmUxrCQsrRMpPiyA80eQ3uJrzAPTQkkphiF2uAtkSc79Qh0R16/0JHWIux p20aYFQgzLWeg== From: Chrispine Tinega To: Mathieu Poirier Cc: Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Chrispine Tinega Subject: Re: [PATCH v2] rpmsg: char: Drop messages that arrive while the device is closed Date: Fri, 4 Dec 2026 07:04:11 +0300 Message-ID: <20261204040411.2238449-1-dev@chrispinetinega.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: <20261123191453.1172967-1-dev@chrispinetinega.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Envelope-From: dev@chrispinetinega.com 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