[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160128133728.5fa54fa3@recife.lan>
Date: Thu, 28 Jan 2016 13:37:28 -0200
From: Mauro Carvalho Chehab <mchehab@....samsung.com>
To: Shuah Khan <shuahkh@....samsung.com>
Cc: tiwai@...e.com, clemens@...isch.de, hans.verkuil@...co.com,
laurent.pinchart@...asonboard.com, sakari.ailus@...ux.intel.com,
javier@....samsung.com, pawel@...iak.com, m.szyprowski@...sung.com,
kyungmin.park@...sung.com, perex@...ex.cz, arnd@...db.de,
dan.carpenter@...cle.com, tvboxspy@...il.com, crope@....fi,
ruchandani.tina@...il.com, corbet@....net, chehabrafael@...il.com,
k.kozlowski@...sung.com, stefanr@...6.in-berlin.de,
inki.dae@...sung.com, jh1009.sung@...sung.com,
elfring@...rs.sourceforge.net, prabhakar.csengg@...il.com,
sw0312.kim@...sung.com, p.zabel@...gutronix.de,
ricardo.ribalda@...il.com, labbott@...oraproject.org,
pierre-louis.bossart@...ux.intel.com, ricard.wanderlof@...s.com,
julian@...st.de, takamichiho@...il.com, dominic.sacre@....de,
misterpib@...il.com, daniel@...que.org, gtmkramer@...all.nl,
normalperson@...t.net, joe@...po.co.uk, linuxbugs@...tgam.net,
johan@...ud.se, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-api@...r.kernel.org,
alsa-devel@...a-project.org
Subject: Re: [PATCH 13/31] media: au0828 fix au0828_create_media_graph()
entity checks
Em Wed, 6 Jan 2016 13:27:02 -0700
Shuah Khan <shuahkh@....samsung.com> escreveu:
> au0828_create_media_graph() doesn't do any checks to determine,
> if vbi_dev, vdev, and input entities have been registered prior
> to creating pad links. Checking graph_obj.mdev field works as
> the graph_obj.mdev field gets initialized in the entity register
> interface. Fix it to check graph_obj.mdev field before creating
> pad links.
>
> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
> ---
> drivers/media/usb/au0828/au0828-core.c | 27 +++++++++++++++++----------
> 1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
> index f46fb43..8ef7c71 100644
> --- a/drivers/media/usb/au0828/au0828-core.c
> +++ b/drivers/media/usb/au0828/au0828-core.c
> @@ -291,20 +291,27 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
> if (ret)
> return ret;
> }
> - ret = media_create_pad_link(decoder, AU8522_PAD_VID_OUT,
> - &dev->vdev.entity, 0,
> - MEDIA_LNK_FL_ENABLED);
> - if (ret)
> - return ret;
> - ret = media_create_pad_link(decoder, AU8522_PAD_VBI_OUT,
> - &dev->vbi_dev.entity, 0,
> - MEDIA_LNK_FL_ENABLED);
> - if (ret)
> - return ret;
> + if (dev->vdev.entity.graph_obj.mdev) {
> + ret = media_create_pad_link(decoder, AU8522_PAD_VID_OUT,
> + &dev->vdev.entity, 0,
> + MEDIA_LNK_FL_ENABLED);
> + if (ret)
> + return ret;
> + }
Those new if() doesn't look right. We can't continue if the entities
weren't registered, as the graph would have troubles. The logic should
ensure that the entities will always be created before running
au0828_create_media_graph(). If this is not the case, some async
logic is needed to ensure that.
> + if (dev->vbi_dev.entity.graph_obj.mdev) {
> + ret = media_create_pad_link(decoder, AU8522_PAD_VBI_OUT,
> + &dev->vbi_dev.entity, 0,
> + MEDIA_LNK_FL_ENABLED);
> + if (ret)
> + return ret;
> + }
>
> for (i = 0; i < AU0828_MAX_INPUT; i++) {
> struct media_entity *ent = &dev->input_ent[i];
>
> + if (!ent->graph_obj.mdev)
> + continue;
> +
> if (AUVI_INPUT(i).type == AU0828_VMUX_UNDEFINED)
> break;
>
Powered by blists - more mailing lists