Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: ccs: Print a warning on CCS static data parse failure
@ 2024-12-09 11:17 Mehdi Djait
  2024-12-09 11:40 ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Mehdi Djait @ 2024-12-09 11:17 UTC (permalink / raw)
  To: sakari.ailus; +Cc: linux-media, david, Mehdi Djait

ccs_data_parse() return value is not propagated up to the probe
function, making it difficult on static data parse Failure.
Improve this by printing a warning when ccs_data_parse() fails.

Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
---
 drivers/media/i2c/ccs/ccs-data.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/ccs/ccs-data.c b/drivers/media/i2c/ccs/ccs-data.c
index c40d859166dd..f64fbfa1c7b5 100644
--- a/drivers/media/i2c/ccs/ccs-data.c
+++ b/drivers/media/i2c/ccs/ccs-data.c
@@ -976,6 +976,7 @@ int ccs_data_parse(struct ccs_data_container *ccsdata, const void *data,
 out_cleanup:
 	kvfree(bin.base);
 	memset(ccsdata, 0, sizeof(*ccsdata));
+	dev_warn(dev, "failed to parse CCS static data file: %d\n", rval);
 
 	return rval;
 }
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: ccs: Print a warning on CCS static data parse failure
  2024-12-09 11:17 [PATCH] media: ccs: Print a warning on CCS static data parse failure Mehdi Djait
@ 2024-12-09 11:40 ` Sakari Ailus
  2024-12-10  8:53   ` Mehdi Djait
  0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2024-12-09 11:40 UTC (permalink / raw)
  To: Mehdi Djait; +Cc: linux-media, david

Hi Mehdi,

On Mon, Dec 09, 2024 at 12:17:38PM +0100, Mehdi Djait wrote:
> ccs_data_parse() return value is not propagated up to the probe
> function, making it difficult on static data parse Failure.

Could you reword this by referring to the CCS static data library only?
This would fit better for the CCS tools where the patch will also be
imported to.

<URL:https://github.com/MIPI-Alliance/ccs-tools>

I also wonder if the CCS driver should actually fail probe if parsing
fails: this is a very likely problem and quitting there would be
appropriate IMO. Not every device might need one, so it should be just
based on parser failure.

Thanks.

> Improve this by printing a warning when ccs_data_parse() fails.
> 
> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> ---
>  drivers/media/i2c/ccs/ccs-data.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/i2c/ccs/ccs-data.c b/drivers/media/i2c/ccs/ccs-data.c
> index c40d859166dd..f64fbfa1c7b5 100644
> --- a/drivers/media/i2c/ccs/ccs-data.c
> +++ b/drivers/media/i2c/ccs/ccs-data.c
> @@ -976,6 +976,7 @@ int ccs_data_parse(struct ccs_data_container *ccsdata, const void *data,
>  out_cleanup:
>  	kvfree(bin.base);
>  	memset(ccsdata, 0, sizeof(*ccsdata));
> +	dev_warn(dev, "failed to parse CCS static data file: %d\n", rval);

s/ file//

>  
>  	return rval;
>  }

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: ccs: Print a warning on CCS static data parse failure
  2024-12-09 11:40 ` Sakari Ailus
@ 2024-12-10  8:53   ` Mehdi Djait
  0 siblings, 0 replies; 3+ messages in thread
From: Mehdi Djait @ 2024-12-10  8:53 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, david

Hi Sakari,

On Mon, Dec 09, 2024 at 11:40:00AM +0000, Sakari Ailus wrote:
> Hi Mehdi,
> 
> On Mon, Dec 09, 2024 at 12:17:38PM +0100, Mehdi Djait wrote:
> > ccs_data_parse() return value is not propagated up to the probe
> > function, making it difficult on static data parse Failure.
> 
> Could you reword this by referring to the CCS static data library only?
> This would fit better for the CCS tools where the patch will also be
> imported to.
> 
> <URL:https://github.com/MIPI-Alliance/ccs-tools>
> 
> I also wonder if the CCS driver should actually fail probe if parsing
> fails: this is a very likely problem and quitting there would be
> appropriate IMO. Not every device might need one, so it should be just
> based on parser failure.

I would also think there is no point to continue probing if parsing fails. I
will send a v2 for this.

--
Kind Regards
Mehdi Djait

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-10  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 11:17 [PATCH] media: ccs: Print a warning on CCS static data parse failure Mehdi Djait
2024-12-09 11:40 ` Sakari Ailus
2024-12-10  8:53   ` Mehdi Djait

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox