From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796397510; b=P/jjt3s629EmIVpGXZqKktLO1auQwUxoZZnSBELWZIghfdt3vtWdvuH0rjqa19f2Y68r vpwVMys4SLXXgZmPcxzPSlr+Ig9o3QsOI2Lh62H+WeBgI2aZKwzuS/HCqLZWQzigBfpxg WSxLJc7U7LgtJadMcWnU+y2vQSvtY1Wwntv8KMTKNJD5LQn6Za+nNr6B5ce6+siYPlbM3 4S5cRQjU+PIQTx8eXbdFJHNqWp5LQJpK20M1c0Wwan2nAF3T3RNet2z7fKW3XhSiIekTq H+56d68XkcS/i/Fas4jvS+39+hctNMLf5SrQBT9k34oWb3eKHGKdC+pIA+MXxiiKAZw== 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=eRTMquq5VW8BLLzF+3+LfQW2ilhDk+obwwRcALA/mnP728q2ToJgfvaSKymzgdMaOL+n tPNgfS1Mn3S3LRFrEPBmiCnQCVUM+whCikuz15fhqvzRDVQZhU5HJpA8X1q32wtMCXjCT ekZ2CWTNLCzACRg0PrJnJRGZXeq7SnH9I5eFT2dHlXZ2CKxxxbghjDsvYm7Srg7wyYlXA WZ8UUR++e6qaENIahwqsgf0k/Lyh4Mf7H9iz0mTNNHmFclgX8/l8wRkJlwfBlUmpvvPRv TzLI84IyZTv/vGcZo4o/XjPrbxIt5WillbtWUieuWpMIqfWy5YxsiicztIWpABgt+pw== 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.170 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 4E22E606A32C for ; Fri, 4 Dec 2026 15:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4E22E606A32C 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, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=s/jKpVd0 Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2f04f61282dso6861255ad.1 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=sCOaXbSVrhCoZZYCKHg+q5z44jkv59VxPfYpMuUtZHELQ+tpv5ruZmJ/UqJHHTVmIz QvEcT6rg9DXn8qyIxVxBoi32pVBBQSudZ4uePWOLxOM+/SSbu3NHwWH/7rDvYTckMixV DHKSz+iOJN9LvIoetbyJBZcFCfkhFiOVzkerA50JF5ue8BKuyl+kThj9SATHVlYICKBn H1GT7/mhhKafsGEMI5O1AhKyebXTo+TRTMca47SP+b+ctiC+mh4sDso4wpcFWMZHA62y jRN3J4L/a9NhlWlU6oXPq+awkCwGn3zle0uSupgBwLBABjrwXzz4ZoS7XyyBCRFjJKsd QErw== X-Forwarded-Encrypted: i=1; AL+hErFYIcUNbh031DAf05N3MTpfkp3KWR5TmCHMoi8OXXKid8KSgBR8HM6u12aoIUjfCyitJzD/+8D/MSIo7z4=@vger.kernel.org X-Gm-Message-State: AB4q+uHbGME689ZuhnFnDCsz161eYzcxfdH16fi6CiXEae4NsYMddbHi nQAC/MBrw33QlAxkhEHE20F3GJCB7xOBVwFZDajT1/i8PLX7rY4n+f+0jikCCfLChYt8+iYuU6T oKntw X-Gm-Gg: AZFdTZc41+VppZFiE561WxtYPg3XW19ZK/jFmtzgfsz5cyJDrwBySUniq2ePWxFYSkR ArE3605f0CwOSXLvjw5QyTCquIrCygz7LL6fq9LlRwaCk1vh5MKbVVLfoAHAD284GOMc47K7ehn +YtbCtSUHmNT8fKt69vdysZHlX60WYpWlIWRwx/t3iFp7ds4dX5nE4PMCqAUu5I6284NCv3WJdA 3ePRy6eIiSrMstB7XA5SP4I2SbFJqGaBfCbqsBiVCqbl7SwUiIENjZwkX3cU4pV6QXl1R2ABxyo ddID18zgbim32lRJYA+3tQdkc2O6nabSkkg5n0FIeM+ji+/Ouztn2u/Sp6uUPyoyYPYnefDwiyx 4lAIN3AKCJz+biaVQwzw599Inc+Kfn8O6RDO40Y5Wt1Et+ovWsYAxcHotmC9cMKX7XvKjQpZ8eR mr2pShTxPi3Try+WqP2RoewFaFcxWU25DAkrwWjb5p702DKiMxz/QoQ8izqoZzQv4Yy1bEjPgjY 9QAOi+G04fQhs7SuXHiFuMigAOSVz3nBj6ARyVuN+daTUWwmVkj0AgzZqcMjlEK7y7N4xPST6rx ToM8q5ZRX4uyM5PTpN+C/UMfBqluhJr1Qy0Jj7AaAePKqAihTKSE 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-kernel@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