Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215629 > unrolled thread

[PATCH] remoteproc: report error if resource table doesn't exist

Started byStefan Agner <stefan@agner.ch>
First post2015-08-29 03:10 +0200
Last post2015-09-03 21:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] remoteproc: report error if resource table doesn't exist Stefan Agner <stefan@agner.ch> - 2015-08-29 03:10 +0200
    Re: [PATCH] remoteproc: report error if resource table doesn't exist Suman Anna <s-anna@ti.com> - 2015-09-03 21:40 +0200

#1215629 — [PATCH] remoteproc: report error if resource table doesn't exist

FromStefan Agner <stefan@agner.ch>
Date2015-08-29 03:10 +0200
Subject[PATCH] remoteproc: report error if resource table doesn't exist
Message-ID<q2COC-3lr-11@gated-at.bofh.it>
Currently, if the resource table is completely missing in the
firmware, powering up the remoteproc fails silently. Add a message
indicating that the resource table is missing in the firmware.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
Hi Ohad,

I am currently working on remoteproc support for Freescale Vybrid's
secondary Cortex-M4 core. I stumbled upon this rough spot since the
little test firmware I am using now does not have a resource table
yet.

This also opens up a more general question: Is it mandatory to have
a resource table in the firmware? Theoretically a remoteproc could
also work completely independent, all what would be used from the
remoteproc framework is the loading and starting capabilities...

--
Stefan

 drivers/remoteproc/remoteproc_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8b3130f..29db8b3 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -823,8 +823,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
 
 	/* look for the resource table */
 	table = rproc_find_rsc_table(rproc, fw, &tablesz);
-	if (!table)
+	if (!table) {
+		dev_err(dev, "Failed to find resource table\n");
 		goto clean_up;
+	}
 
 	/* Verify that resource table in loaded fw is unchanged */
 	if (rproc->table_csum != crc32(0, table, tablesz)) {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1218533

FromSuman Anna <s-anna@ti.com>
Date2015-09-03 21:40 +0200
Message-ID<q4Iwx-4D6-3@gated-at.bofh.it>
In reply to#1215629
On 08/28/2015 08:08 PM, Stefan Agner wrote:
> Currently, if the resource table is completely missing in the
> firmware, powering up the remoteproc fails silently. Add a message
> indicating that the resource table is missing in the firmware.

Yeah, pretty useful to have a trace there..

Acked-by: Suman Anna <s-anna@ti.com>

> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> Hi Ohad,
> 
> I am currently working on remoteproc support for Freescale Vybrid's
> secondary Cortex-M4 core. I stumbled upon this rough spot since the
> little test firmware I am using now does not have a resource table
> yet.
> 
> This also opens up a more general question: Is it mandatory to have
> a resource table in the firmware? Theoretically a remoteproc could
> also work completely independent, all what would be used from the
> remoteproc framework is the loading and starting capabilities...

Hi Ohad,

We will probably be seeing more of such scenarios for very simplistic
devices (like the ones that load into their internal memories), it looks
like the framework needs some kind of support for booting such devices,
whether auto-boot, or give some kind of sysfs control for userspace. We
do have the rproc_boot() and rproc_shutdown() API, but that almost
always requires some other entity in the kernel to be able to invoke
those API. Any suggestions here?

regards
Suman

> 
> --
> Stefan
> 
>  drivers/remoteproc/remoteproc_core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 8b3130f..29db8b3 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -823,8 +823,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
>  
>  	/* look for the resource table */
>  	table = rproc_find_rsc_table(rproc, fw, &tablesz);
> -	if (!table)
> +	if (!table) {
> +		dev_err(dev, "Failed to find resource table\n");
>  		goto clean_up;
> +	}
>  
>  	/* Verify that resource table in loaded fw is unchanged */
>  	if (rproc->table_csum != crc32(0, table, tablesz)) {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web