From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796397510; b=1cv6nnVsZmHmAHp6jX1eYfEsQKnG4ymEgu/6KI04xkY4hjqvge6dbtq1hZLQucwO+9IA h7dPTX3jlHCmw4U0pnR0R6hQ7t8iMgdNqgH0hdk2ovtavswWexr2GwuSY5vRPQQSEWtHM hNAIxYJb0FzjpJ66efJwfl6jyXqiQA12HFzqspAVf+pIB48NLvfDkN3yFrVBklm27rXTa XRiuAD4uBq6AxaLLuJipej2B8jfNj3TU3jXsPS9dXOwYGR4fAL49X9Q+R8DDgItyu0Lnl fWclfg0UXRrJhnLX4fK5pKIb+CZGVNJNOXI9nPUMKsnEj17CgHZ5jN+rrzgFl5nkbIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796397510; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=zUi9708BWOY2tGalu5exf++rG3SdGndlAdRwMSYEsuo=; b=NJcNS0bFjsWkG4bumhUpNmORpKoJL3CHu+/19WibAeVx5HYGcMRtO4SXlZ3B/wvg5Ili GZHmgiqyKs+Klgt2DVi92L5N0PxjOZv9Y0HMcnAskm6Qy5IGzfbRlWHEDWp4+43jfCMVm +0gy9Kd/ql49HBiUA9iTzOd1w+7y8CYCKPqdXVMLDiMpnq7rdQmLybChiWM8nGcYI47ZB M25o53SXFodWKPD93PZYCbG3QgCZdRUFKvV5iElndjwUJp3/WtxHa1jfE0+aIKKEGrn2a aDSE4NhplNREqbftbqBdrshVN6izArbU0K/wsjMXQoYLrojf6OqImlfbxIymsbeKJNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b="s/jKpVd0"; arc=none smtp.remote-ip=209.85.214.174 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46013606A322 for ; Fri, 4 Dec 2026 15:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 46013606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=s/jKpVd0 Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2f020d0169eso6128125ad.0 for ; Fri, 04 Dec 2026 07:18:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796397509; x=1797002309; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=zUi9708BWOY2tGalu5exf++rG3SdGndlAdRwMSYEsuo=; b=s/jKpVd0eYzzLjuSD00N1X5XL7/AMfgHis1Z+hIPmD2RHp6JMqpIEq6t9HHX44Fusg scS0+F4uKKsRvWT3AxBaLgL1a4/4AUOw0PCZJgksXcqlR3NRhyg/qHFs5LBV7na82/Eb tQy0Z35dDWr3MtZ4iBwA6DerRKzb0r/mOUv6x+S7g26OigXc8jZRz8GcPSwcBFaphS3o pNi+aIyytXaPqcYPPp5qj90pwYgHBwMDR1CFnitRQHB3WomnmeUGSAp2xwDr7QePK5Xt TmUjsMtzE/QQXnHp7mSFmC0pk9qWTxuZ4RvNu+LlKh4RO55lYYzJK4bEwXQuIXuQudh/ nPmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796397509; x=1797002309; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zUi9708BWOY2tGalu5exf++rG3SdGndlAdRwMSYEsuo=; b=A4Y61XW7E4nK5FSHfiM0Tt75Kl5jVdPE6qAe5NUcLXA/5+iLx1f2MAbKWDYJCOZiDc Pu/XTEb7GeHHHUv6jjqfoNaHakePjCpRNJrtYiLNOvis4L4Mz5yctt/4yURD8vibol9W 6wCWDht7tPyrn7QZMtevJvuctyEHotp56kf4x/f4s9HHkWK4o11ygYW+UfDGyXkItHlU WFEoxdh5Rjq7GEWm76XFdhiD6wjNi2g6Z95nkHxQo4J/cfW9iaFNgzrpMa78B1ZfrJ3l H2KMbXL5wTUDBiKXV5ygej5uZf1R8elZAuJT1EQdycPUjTm1avZoa1NFVD3xO4ta4oNY +gLA== X-Forwarded-Encrypted: i=1; AL+hErFDYfrcq8j777knwI+qaNdKqUlpWtAWjsuWNRRMtpdtg+d23qd3Klt71iSkY/KyjXh54Y0sWdyEu3RZtaIzFlZd@vger.kernel.org X-Gm-Message-State: AB4q+uGkwX2N3HhB5vhWBTjAfu7/oiOkR/Uf0aeA85iDKHna+G3N1jeq Hby7TjEB8jrC7vZEiLyFgvdH3/trimleuDb+P4RF2D5x2OYfy8KL0hXCiqFZ6T0kvg8= X-Gm-Gg: AZFdTZeOwpRiOP9S/xIzOM5TKZLxFGJuYBjvuqR6sC2FRdPOuc6LNPEnbhqFiZkhSy4 3MlHFBUQ4Fc+MW0e0fCBAddCireZnYkS5spyiLGsJ5Bewsit5zGbLhSsSzPgNaHKx0wv9/qbXS4 yu5agglQrwOOa76QXwa0vW+ZDNF4s+130SImm/IrWqInTRSfSYzPu5jHTL8aQoRS96dkZgSQnUb /8Qdko7Z8x7QyyGt9zYOSD+iQW++58QmP4+ETyzPIipeuESUzPmrmamE4wU+j+XCG0SxjPEfbqV gaeFhxV4czKstK4WBym89iqd6I08V0WCd7heBLP/awgLjXLvzb4BFOfHmaZyhL00sCc7gR2VTwd 2NifP0t+M5lP3uyHqU5RsMLLHnkDKo6NaFWtwt5LdrtAxPkvHuvSwitUJfkZmmcAmzRce0opoMh smGsmfAsoeQL86IaCQG5Zn8lAorz/mJb5DAWeXXSsMjeNJnGOcoz8Y8k7slkPtChLwvlfjtgsoL ACoY58W0b4oNAVtN++f65hMuc8zPQ10lBS+JajY392e8NV2YwRDbUIZlDi48Av4/s4N74NX+O6h IwFhHP2cS7tMZF4vQDL1lXlqQWqIxHbxl+c73pFGCzZIRhtu5FpL X-Received: by 2002:a17:903:22c3:b0:2ef:e044:290c with SMTP id d9443c01a7336-2f1ba1737bdmr19906445ad.25.1796397509368; Fri, 04 Dec 2026 07:18:29 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:fdba:321f:5306:151e]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b79625e1sm13863865ad.57.2026.12.04.07.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 07:18:28 -0800 (PST) Date: Fri, 4 Dec 2026 09:18:27 -0600 From: Mathieu Poirier To: Chrispine Tinega Cc: Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] rpmsg: char: Drop messages that arrive while the device is closed Message-ID: References: <20261123191453.1172967-1-dev@chrispinetinega.com> <20261204040411.2238449-1-dev@chrispinetinega.com> X-Mailing-List: linux-remoteproc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204040411.2238449-1-dev@chrispinetinega.com> On Fri, Dec 04, 2026 at 07:04:11AM +0300, Chrispine Tinega wrote: > 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. > Right, and in that case messages should be dropped. > 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. > Again, we agree. In either cases messages should be dropped until ->ept is valid. I don't see a point in checking for ->default_ept. What am I missing? > 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