From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAA0D44A730 for ; Thu, 11 Jun 2026 17:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781199981; cv=none; b=OrV0iVBgLGIjp97PS8pZjHPy4Te+pbZf0qwzqm2eGh/mqkWCSAX05BCZYM+c0ejLT4EAPFhV33ENbgYEzQdh2sYyET23UZ7OuAZfptwqsIFVvg4hJVH06l2V7L7lTkGHPj1Eexs6AcTAMIhKULPByoNi3elUm7z727hEpAH3b3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781199981; c=relaxed/simple; bh=/VS4moAxewMl/vne0QAz7t4DDUEl2YS3zv0+upLp538=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I/pPTNguZVhn5eLq4c7ZWjGJNvuXwM+j2bDEqalkvZ9jFvKrAMEIFDRni8MeQuK2qEQjv3z3x2xP9uxKWcMHkpIXd0f24v4Kt+Qs+HECSoAqdkyWH3TMkOUqQqm9PDFSnkqMN+XbsPaZRONUpir4PkyucWp0Vr1oakXam4b8T2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZUPfDl0j; arc=none smtp.client-ip=209.85.214.175 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.b="ZUPfDl0j" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2c0c2c7d45eso1409775ad.1 for ; Thu, 11 Jun 2026 10:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781199979; x=1781804779; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=2N81ClsT3Q+ECsWMKxKdQQqfKQLKD2xchENp4OvvnmA=; b=ZUPfDl0j9mZIjp3FJxv7IIBkNYEHtWSK8j3d3VenTHCSn+ukQd3BBDTHrwjCwWc0Ti y0aUr+yfiY3j15hNdNP8+60gtBa9cBBPTElNFKZR2DTvsT48PKjofcd0ULzWAHuOkHFn jWlBZ70MvUCpqCItvCOXi3+LiFjXcA0ZA8e8zIe+X4tPVAhLk1uTpcJVDF/Z5x+4gBx2 AuFgBUc2ld/NLueoXhAUo1NFqdbyy+YeUP+XGMi6noudK8RP3u88Mr3WrnqpIZ4d/zJ1 J77S+vr3/sT16p3BRhan5rSbnCNkTxzS4IF6qyEIjH+C7CjMJryXQBJp2G3CHFEqe1ko 6C5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781199979; x=1781804779; h=in-reply-to:content-transfer-encoding:content-disposition :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; bh=2N81ClsT3Q+ECsWMKxKdQQqfKQLKD2xchENp4OvvnmA=; b=C5tel2K36YKBWLnWM2JhRbx2lTbLWVPNJgX+zXLs7IIcgwNkG+EISXm55kVcaUC8wf 9EfCgEmP/RwAmajvTA+kX98CGICbMNG2cPwQ6yWY+rtoktIG+Bz1EX3wZv8fWwGc0cf6 hBj+OxKtBDC9Dq3AAqsXzljVs2MbPPWEFFwwctp5DXe/fN0KyFcIdRnCl8A0e22ghdwl yZlJONknmWFQWAJbetIOlE8gcNJS0k7BY1Cz4MJC3mu1oUD6ZBvpVye/mHdqtJo0Ld2e L5dvWOQL411kHzqR9pPQp0IT1oIUIDUPIaY1xhCLcdPFO0Jcge5gdYHWBlESV/hugjgD zQIg== X-Forwarded-Encrypted: i=1; AFNElJ+NVkKGeO4tb+e5G2EcTr+SLtAeJHAxOaH9LmBWLlD/6cPnur9xp39YCCRPF3XVLofMC+wSEXr7gDiAV7I=@vger.kernel.org X-Gm-Message-State: AOJu0YyIf0mhKL7wiv64d2r4pMYVcun7m6i7KsIKjXHZMqr1QO0RfP+q SOO/kQwZl5W34Eio1nyJh6NIceuqx15AQszcVFiYvbxHHnEmsV+1h1zstIeEXTMwyVQ= X-Gm-Gg: Acq92OHK6YKAcZOMmll73cppwqPorS8Uzb7DCQGvsUa6yQwhCjNgOSbCF9jwsx4yt1Q bnWK3dxVrjuFQPshW4QKPU4+jeZUWjcuQjBs+6xA/hdNZ726h1S9ecFtjA8noVhkc1neHfCAdJg HoyMR5h2wWrWwQJ2AZH3MpQuNM3ZD/1AgnzezXijO/AIIUqBL3JAzVFtvx5adyg7hbg6OziWyxy e1FMNZUmu+IoR5MQj5YfwYi7l+Kogzu0ZSZdaTHDw8oQga2lu9qRP1JFR9iAkj7PrPbSlZit7o+ a8HY8xmvumczPIsA6X0EatCJzSE0dlQSLVjogVUPcvCVZCkehZ/HsP1ILb54xSZosSyR2c3afiZ 3RZVCLzWuBOzBpC1QYJ3W+2TyxcER34O1dGgccN15IknwwB1WhghwxhYs6/d4ThaqE6KE56gCNo 4VjDfFx38HJQ7M5j8qxycb07MWRVQ= X-Received: by 2002:a17:903:946:b0:2bf:379b:53f4 with SMTP id d9443c01a7336-2c2f1eba6a6mr42688705ad.19.1781199978790; Thu, 11 Jun 2026 10:46:18 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:5bde:8634:433a:e780]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16609e2e2sm280025525ad.49.2026.06.11.10.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 10:46:18 -0700 (PDT) Date: Thu, 11 Jun 2026 11:46:16 -0600 From: Mathieu Poirier To: tanmay.shah@amd.com Cc: Arnaud POULIQUEN , andersson@kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, divin.raj@arm.com Subject: Re: [PATCH v3 4/4] samples: rpmsg: add MTU size info Message-ID: References: <20260529164327.1827121-1-tanmay.shah@amd.com> <20260529164327.1827121-5-tanmay.shah@amd.com> <44c03148-9ff2-4fad-846d-ffe3d71adac1@foss.st.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jun 04, 2026 at 05:28:13PM -0500, Shah, Tanmay wrote: > > > On 6/2/2026 3:34 AM, Arnaud POULIQUEN wrote: > > > > > > On 5/29/26 18:43, Tanmay Shah wrote: > >> RPMsg MTU size can be variable now and no longer hardcoded to 512 bytes. > >> Add log to the sample driver that prints current MTU size of the rpmsg > >> buffer. > >> > >> Signed-off-by: Tanmay Shah > >> --- > >> > >> Changes in v3: > >>    - Check for error when retrieving MTU size > >>    - %s/mtu/MTU/ > >> > >>   samples/rpmsg/rpmsg_client_sample.c | 9 +++++++++ > >>   1 file changed, 9 insertions(+) > >> > >> diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/ > >> rpmsg_client_sample.c > >> index ae5081662283..55afa53189af 100644 > >> --- a/samples/rpmsg/rpmsg_client_sample.c > >> +++ b/samples/rpmsg/rpmsg_client_sample.c > >> @@ -52,6 +52,7 @@ static int rpmsg_sample_probe(struct rpmsg_device > >> *rpdev) > >>   { > >>       int ret; > >>       struct instance_data *idata; > >> +    ssize_t mtu; > >>         dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n", > >>                       rpdev->src, rpdev->dst); > >> @@ -62,6 +63,14 @@ static int rpmsg_sample_probe(struct rpmsg_device > >> *rpdev) > >>         dev_set_drvdata(&rpdev->dev, idata); > >>   +    mtu = rpmsg_get_mtu(rpdev->ept); > >> +    if (mtu < 0) { > >> +        dev_warn(&rpdev->dev, "invalid rpmsg MTU size = %ld\n", mtu); > >> +        return mtu; > >> +    } > >> + > >> +    dev_info(&rpdev->dev, "rpmsg MTU size = %ld\n", mtu); > >> + > > > > Do you really need this commit? rpmsg_send should return an error if the > > buffer size is insufficient [1]. > > > > [1] https://elixir.bootlin.com/linux/v7.0.10/source/drivers/rpmsg/ > > virtio_rpmsg_bus.c#L517 > > > > Here, I just want to demonstrate rpmsg_get_mtu() API. Now we can have a > configurable size of the RPMsg buffer. So rpmsg_get_mtu() API can be > used to check correct buffer length before even using rpmsg_send() API. > Since this is a demonstration, I think there is value in showing how to use the API correctly. There is certainly no disadvantage in doing so. > I think I should check msg length against mtu size as well. > I agree. > > > Regards, > > Arnaud > > > >>       /* send a message to our remote processor */ > >>       ret = rpmsg_send(rpdev->ept, MSG, strlen(MSG)); > >>       if (ret) { > > >