Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: Print information on failed link validation

The Media controller doesn't tell much to the user in cases such as pipeline
startup failure. The link validation is the most common media graph (or in
V4L2's case, format) related reason for the failure. In more complex
pipelines the reason may not always be obvious to the user, so point them to
look at the right direction.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Sakari Ailus and committed by
Mauro Carvalho Chehab
fab9d30b f491dbe0

+11 -1
+11 -1
drivers/media/media-entity.c
··· 279 279 continue; 280 280 281 281 ret = entity->ops->link_validate(link); 282 - if (ret < 0 && ret != -ENOIOCTLCMD) 282 + if (ret < 0 && ret != -ENOIOCTLCMD) { 283 + dev_dbg(entity->parent->dev, 284 + "link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n", 285 + entity->name, link->source->index, 286 + link->sink->entity->name, 287 + link->sink->index, ret); 283 288 goto error; 289 + } 284 290 } 285 291 286 292 /* Either no links or validated links are fine. */ ··· 294 288 295 289 if (!bitmap_full(active, entity->num_pads)) { 296 290 ret = -EPIPE; 291 + dev_dbg(entity->parent->dev, 292 + "\"%s\":%u must be connected by an enabled link\n", 293 + entity->name, 294 + find_first_zero_bit(active, entity->num_pads)); 297 295 goto error; 298 296 } 299 297 }