All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
@ 2017-02-28 12:02 Sakari Ailus
  2017-02-28 12:35 ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2017-02-28 12:02 UTC (permalink / raw)
  To: linux-media; +Cc: pavel

If endpoint has an invalid configuration, ignore it instead of happily
proceeding to use it nonetheless. Ignoring such an endpoint is better than
failing since there could be multiple endpoints, only some of which are
bad.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Pavel,

How about this one? isp_fwnode_parse() is expected to return an error if
there's one but currently it's quite shy. With this patch, the faulty
endpoint is simply ignored. This is completely untested so far.

 drivers/media/platform/omap3isp/isp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 95850b9..8026221 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2120,10 +2120,12 @@ static int isp_fwnodes_parse(struct device *dev,
 		if (!isd)
 			goto error;
 
-		notifier->subdevs[notifier->num_subdevs] = &isd->asd;
+		if (isp_fwnode_parse(dev, fwn, isd)) {
+			devm_kfree(dev, isd);
+			continue;
+		}
 
-		if (isp_fwnode_parse(dev, fwn, isd))
-			goto error;
+		notifier->subdevs[notifier->num_subdevs] = &isd->asd;
 
 		isd->asd.match.fwnode.fwn =
 			fwnode_graph_get_remote_port_parent(fwn);
-- 
2.7.4

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

* Re: [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
  2017-02-28 12:02 [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration Sakari Ailus
@ 2017-02-28 12:35 ` Pavel Machek
  2017-02-28 12:45   ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2017-02-28 12:35 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

On Tue 2017-02-28 14:02:30, Sakari Ailus wrote:
> If endpoint has an invalid configuration, ignore it instead of happily
> proceeding to use it nonetheless. Ignoring such an endpoint is better than
> failing since there could be multiple endpoints, only some of which are
> bad.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Hi Pavel,
> 
> How about this one? isp_fwnode_parse() is expected to return an error if
> there's one but currently it's quite shy. With this patch, the faulty
> endpoint is simply ignored. This is completely untested so far.

Does not seem to break anything.

Tested-by: Pavel Machek <pavel@ucw.cz>

								Pavel

>  drivers/media/platform/omap3isp/isp.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> index 95850b9..8026221 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2120,10 +2120,12 @@ static int isp_fwnodes_parse(struct device *dev,
>  		if (!isd)
>  			goto error;
>  
> -		notifier->subdevs[notifier->num_subdevs] = &isd->asd;
> +		if (isp_fwnode_parse(dev, fwn, isd)) {
> +			devm_kfree(dev, isd);
> +			continue;
> +		}
>  
> -		if (isp_fwnode_parse(dev, fwn, isd))
> -			goto error;
> +		notifier->subdevs[notifier->num_subdevs] = &isd->asd;
>  
>  		isd->asd.match.fwnode.fwn =
>  			fwnode_graph_get_remote_port_parent(fwn);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
  2017-02-28 12:35 ` Pavel Machek
@ 2017-02-28 12:45   ` Sakari Ailus
  2017-02-28 19:30     ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2017-02-28 12:45 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-media

Pavel Machek wrote:
> Tested-by: Pavel Machek <pavel@ucw.cz>

Thanks!

I've applied the patch, plus yours, to the ccp2 branch.

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

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

* Re: [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
  2017-02-28 12:45   ` Sakari Ailus
@ 2017-02-28 19:30     ` Pavel Machek
  2017-03-01  7:33       ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2017-02-28 19:30 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

On Tue 2017-02-28 14:45:31, Sakari Ailus wrote:
> Pavel Machek wrote:
> >Tested-by: Pavel Machek <pavel@ucw.cz>
> 
> Thanks!
> 
> I've applied the patch, plus yours, to the ccp2 branch.

Thanks!

https://git.linuxtv.org/sailus/media_tree.git/log/?h=ccp2 ? I don't
see recent changes there...

Best regards,
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
  2017-02-28 19:30     ` Pavel Machek
@ 2017-03-01  7:33       ` Sakari Ailus
  2017-03-01 10:37         ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2017-03-01  7:33 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-media

Pavel Machek wrote:
> On Tue 2017-02-28 14:45:31, Sakari Ailus wrote:
>> Pavel Machek wrote:
>>> Tested-by: Pavel Machek <pavel@ucw.cz>
>>
>> Thanks!
>>
>> I've applied the patch, plus yours, to the ccp2 branch.
>
> Thanks!
>
> https://git.linuxtv.org/sailus/media_tree.git/log/?h=ccp2 ? I don't
> see recent changes there...

I accidentally pushed it to a wrong place. Pushing again...

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

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

* Re: [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration
  2017-03-01  7:33       ` Sakari Ailus
@ 2017-03-01 10:37         ` Pavel Machek
  0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2017-03-01 10:37 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

On Wed 2017-03-01 09:33:59, Sakari Ailus wrote:
> Pavel Machek wrote:
> >On Tue 2017-02-28 14:45:31, Sakari Ailus wrote:
> >>Pavel Machek wrote:
> >>>Tested-by: Pavel Machek <pavel@ucw.cz>
> >>
> >>Thanks!
> >>
> >>I've applied the patch, plus yours, to the ccp2 branch.
> >
> >Thanks!
> >
> >https://git.linuxtv.org/sailus/media_tree.git/log/?h=ccp2 ? I don't
> >see recent changes there...
> 
> I accidentally pushed it to a wrong place. Pushing again...

Thanks, I see it now.
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2017-03-01 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 12:02 [RFC 1/1] omap3isp: Ignore endpoints with invalid configuration Sakari Ailus
2017-02-28 12:35 ` Pavel Machek
2017-02-28 12:45   ` Sakari Ailus
2017-02-28 19:30     ` Pavel Machek
2017-03-01  7:33       ` Sakari Ailus
2017-03-01 10:37         ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.