Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Levinsky <blevinsk@amd.com>
To: "Shah, Tanmay" <tanmay.shah@amd.com>,
	Daniel Baluta <daniel.baluta@oss.nxp.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>
Cc: Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH 3/4] remoteproc: add helper for optional ELF resource tables
Date: Tue, 12 May 2026 10:19:35 -0700	[thread overview]
Message-ID: <cb737dc0-ffcc-40a1-ae8c-0a19714d0dc8@amd.com> (raw)
In-Reply-To: <DM4PR12MB6448B1E51D58F3F8B11171F683392@DM4PR12MB6448.namprd12.prod.outlook.com>

Hi Daniel, Arnaud, Tanmay,

Please see my reply below

On 5/12/26 10:04 AM, Levinsky, Ben wrote:
> AMD General
> 
> 
> 
> 
> *From: *Shah, Tanmay <tanmays@amd.com>
> *Date: *Tuesday, May 12, 2026 at 7:53 AM
> *To: *Daniel Baluta <daniel.baluta@oss.nxp.com>; Levinsky, Ben 
> <ben.levinsky@amd.com>; Bjorn Andersson <andersson@kernel.org>; Mathieu Poirier 
> <mathieu.poirier@linaro.org>; linux-remoteproc@vger.kernel.org <linux- 
> remoteproc@vger.kernel.org>
> *Cc: *Frank Li <Frank.Li@nxp.com>; Sascha Hauer <s.hauer@pengutronix.de>; 
> Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam 
> <festevam@gmail.com>; Geert Uytterhoeven <geert+renesas@glider.be>; Magnus Damm 
> <magnus.damm@gmail.com>; Patrice Chotard <patrice.chotard@foss.st.com>; Maxime 
> Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue 
> <alexandre.torgue@foss.st.com>; imx@lists.linux.dev <imx@lists.linux.dev>; 
> linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>; 
> linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; linux-renesas- 
> soc@vger.kernel.org <linux-renesas-soc@vger.kernel.org>; linux-stm32@st-md- 
> mailman.stormreply.com <linux-stm32@st-md-mailman.stormreply.com>; Shah, Tanmay 
> <tanmay.shah@amd.com>
> *Subject: *Re: [PATCH 3/4] remoteproc: add helper for optional ELF resource tables
> 
> 
> 
> On 5/12/2026 2:55 AM, Daniel Baluta wrote:
>  > On 5/12/26 00:18, Ben Levinsky wrote:
>  >> [You don't often get email from ben.levinsky@amd.com. Learn why this is 
> important at https://aka.ms/LearnAboutSenderIdentification <https://aka.ms/ 
> LearnAboutSenderIdentification> ]
>  >>
>  >> Add a small helper around rproc_elf_load_rsc_table() for remoteproc
>  >> drivers that treat a missing ELF resource table as optional. The helper
>  >> returns success on -EINVAL and propagates other failures unchanged.
>  >>
>  >> Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
>  >> ---
>  >>  drivers/remoteproc/remoteproc_internal.h | 12 ++++++++++++
>  >>  1 file changed, 12 insertions(+)
>  >>
>  >> diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/ 
> remoteproc_internal.h
>  >> index 3724a47a9748..dff87e468837 100644
>  >> --- a/drivers/remoteproc/remoteproc_internal.h
>  >> +++ b/drivers/remoteproc/remoteproc_internal.h
>  >> @@ -146,6 +146,18 @@ static inline int rproc_mem_entry_iounmap(struct rproc 
> *rproc,
>  >>         return 0;
>  >>  }
>  >>
>  >> +static inline int rproc_elf_load_rsc_table_optional(struct rproc *rproc,
>  >> +                                                   const struct firmware *fw)
>  >> +{
>  >> +       int ret;
>  >> +
>  >> +       ret = rproc_elf_load_rsc_table(rproc, fw);
>  >> +       if (ret == -EINVAL)
>  >> +               dev_dbg(&rproc->dev, "no resource table found\n");
>  >
>  > You are changing loglevel here. Initial drivers use dev_info or dev_warn. At 
> least I'm used
>  > with seeing this messages in the logs.
>  >
>  > So, what do you think on adding at least dev_info to this instead of dev_dbg?
>  >
> 
> Actually can we leave that choice to the platform driver ? There are
> many use cases where the remoteproc subsystem is used to load and start
> the remote core and the firmware doesn't have the resource table. We
> don't want to make info level log for such use cases, as the resource
> table is not expected in the first place there.

Thanks for the feedback.

I agree the helper should not impose a common log level. Some platforms intentionally run firmware without a resource table, so forcing a shared dev_info/dev_warn message from the helper would add
noise in those cases.

I'll rework this in v2 so the helper only handles the return-value behavior, while platform drivers keep control over whether the missing-table case is logged and at what level.

Thanks,
Ben

> 
>  >> +
>  >> +       return ret == -EINVAL ? 0 : ret;
>  >> +}
>  >> +
>  >>  static inline int rproc_prepare_device(struct rproc *rproc)
>  >>  {
>  >>         if (rproc->ops->prepare)
>  >> --
>  >> 2.34.1
>  >>
>  >>
>  >
> 



  parent reply	other threads:[~2026-05-12 17:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 21:18 [PATCH 0/4] remoteproc: cleanup shared carveout and resource-table helpers Ben Levinsky
2026-05-11 21:18 ` [PATCH 1/4] remoteproc: add common wc-ioremap carveout callbacks Ben Levinsky
2026-05-12  9:44   ` Arnaud POULIQUEN
     [not found]     ` <DM4PR12MB64482037D67096393D4668CE83392@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-05-12 17:15       ` Ben Levinsky
2026-05-11 21:18 ` [PATCH 2/4] remoteproc: switch exact-match drivers to wc-ioremap callbacks Ben Levinsky
2026-05-12  7:06   ` Geert Uytterhoeven
2026-05-11 21:18 ` [PATCH 3/4] remoteproc: add helper for optional ELF resource tables Ben Levinsky
2026-05-12  7:55   ` Daniel Baluta
2026-05-12  9:22     ` Arnaud POULIQUEN
2026-05-12 14:53     ` Shah, Tanmay
     [not found]       ` <DM4PR12MB6448B1E51D58F3F8B11171F683392@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-05-12 17:19         ` Ben Levinsky [this message]
2026-05-11 21:18 ` [PATCH 4/4] remoteproc: switch drivers to optional resource-table helper Ben Levinsky
2026-05-12  7:07   ` Geert Uytterhoeven

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=cb737dc0-ffcc-40a1-ae8c-0a19714d0dc8@amd.com \
    --to=blevinsk@amd.com \
    --cc=Frank.Li@nxp.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=daniel.baluta@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=magnus.damm@gmail.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=s.hauer@pengutronix.de \
    --cc=tanmay.shah@amd.com \
    /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