Skip to contentSkip to conversation

media: Correctly notify about the failed pipeline validation

PATCH In review Sakari Ailus 3 participants 5 messages Feb 12, 2015 – Apr 8, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: Correctly notify about the failed pipeline validation

On the place of the source entity name, the sink entity name was printed.

---
 drivers/media/media-entity.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/media-entity.c +3 -3
index defe4ac..d894481 100644
@@ -283,9 +283,9 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
 			if (ret < 0 && ret != -ENOIOCTLCMD) {
 				dev_dbg(entity->parent->dev,
 					"link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
-					entity->name, link->source->index,
-					link->sink->entity->name,
-					link->sink->index, ret);
+					link->source->entity->name,
+					link->source->index,
+					entity->name, link->sink->index, ret);
 				goto error;
 			}
 		}
Signature · 1 line
2.1.0.231.g7484e3b
#1 lore raw

Em Thu, 12 Feb 2015 15:43:11 +0200
Sakari Ailus <[email protected]> escreveu:

Quoted 12 lines

On the place of the source entity name, the sink entity name was printed.

---
 drivers/media/media-entity.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/media-entity.c +0 -0
index defe4ac..d894481 100644

drivers/media/media-entity.c __must_check int media_entity_pipeline_start(struct media_entity *entity, · line 288

Quoted 9 lines
drivers/media/media-entity.c +3 -3
@@ -283,9 +283,9 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
 			if (ret < 0 && ret != -ENOIOCTLCMD) {
 				dev_dbg(entity->parent->dev,
 					"link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
-					entity->name, link->source->index,
-					link->sink->entity->name,
-					link->sink->index, ret);
+					link->source->entity->name,
+					link->source->index,
+					entity->name, link->sink->index, ret);

This should likely be reviewed by Laurent, but the above code seems weird to me...

1) Why should it print the link source, instead of the sink? I suspect that the code here should take into account the chosen pad:

                        struct media_pad *pad = link->sink->entity == entity
                                                ? link->sink : link->source;

2) Assuming that your patch is right, why are you printing the link->sink->index, instead of link->source->index?

Regards,
Mauro

#2 lore raw

Hi Mauro,

Quoted 28 lines · Mauro Carvalho Chehab

Em Thu, 12 Feb 2015 15:43:11 +0200
Sakari Ailus <[email protected]> escreveu:

Quoted 12 lines

On the place of the source entity name, the sink entity name was printed.

---
 drivers/media/media-entity.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/media-entity.c +0 -0
index defe4ac..d894481 100644

drivers/media/media-entity.c __must_check int media_entity_pipeline_start(struct media_entity *entity, · line 288

Quoted 9 lines
drivers/media/media-entity.c +3 -3
@@ -283,9 +283,9 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
 			if (ret < 0 && ret != -ENOIOCTLCMD) {
 				dev_dbg(entity->parent->dev,
 					"link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
-					entity->name, link->source->index,
-					link->sink->entity->name,
-					link->sink->index, ret);
+					link->source->entity->name,
+					link->source->index,
+					entity->name, link->sink->index, ret);

This should likely be reviewed by Laurent, but the above code seems weird to me...

Quoted 6 lines

1) Why should it print the link source, instead of the sink? I suspect that the code here should take into account the chosen pad:

                        struct media_pad *pad = link->sink->entity == entity
                                                ? link->sink : link->source;

Link validation is only performed on sink pads. This is checked a few lines above this, so the pad here is always the sink pad. Instead of link->sink->index I could have used pad->index but the pad and thus the integer value is the same.

Quoted 3 lines

2) Assuming that your patch is right, why are you printing the link->sink->index, instead of link->source->index?

The source pad index is prited as well. The end result is, after the patch:

	source entity:source pad -> sink entity:sink pad

Before it was:

	sink entity:source pad -> sink entity:sink pad

Which indeed was wrong.

Signature · 4 lines
Regards,

Sakari Ailus
[email protected]
Acked-by on v1 1/1
#3 lore raw
In reply to Sakari Ailus

Hello Sakari,

Thank you for the patch.

Quoted 3 lines · On Thursday 12 February 2015 15:43:11 Sakari Ailus wrote:

On the place of the source entity name, the sink entity name was printed.

and applied to my tree. It's a bit late for v4.1, can it wait for v4.2 ?

drivers/media/media-entity.c __must_check int media_entity_pipeline_start(struct · line 285

Quoted 12 lines
---
 drivers/media/media-entity.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/media-entity.c +0 -0
index defe4ac..d894481 100644
@@ -283,9 +283,9 @@ __must_check int media_entity_pipeline_start(struct
 media_entity *entity, if (ret < 0 && ret != -ENOIOCTLCMD) {
 				dev_dbg(entity->parent->dev,
 					"link validation failed for \"%s\":%u -> \"%s\":%u, error 

%d\n",

Quoted 9 lines
drivers/media/media-entity.c +3 -3
-					entity->name, link->source->index,
-					link->sink->entity->name,
-					link->sink->index, ret);
+					link->source->entity->name,
+					link->source->index,
+					entity->name, link->sink->index, ret);
 				goto error;
 			}
 		}
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw

Hi Laurent,

Quoted 4 lines · Laurent Pinchart

Hello Sakari,

Thank you for the patch.

Quoted 8 lines
Quoted 3 lines · On Thursday 12 February 2015 15:43:11 Sakari Ailus wrote:

On the place of the source entity name, the sink entity name was printed.

and applied to my tree. It's a bit late for v4.1, can it wait for v4.2 ?

Thanks!

v4.2 is fine. This is just a bug fix in a debug print. I wouldn't bother with stable or v4.1.

Signature · 2 lines
Sakari Ailus
[email protected]