All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, Helen Koike <helen.koike@collabora.com>
Subject: Re: [PATCHv4 7/9] vimc: zero the media_device on probe
Date: Fri, 8 Mar 2019 15:13:49 +0100	[thread overview]
Message-ID: <eb52fba3-587c-5e59-5f3a-8c818bf413cd@xs4all.nl> (raw)
In-Reply-To: <20190308140909.GL4802@pendragon.ideasonboard.com>

On 3/8/19 3:09 PM, Laurent Pinchart wrote:
> Hi Hans,
> 
> Thank you for the patch.
> 
> On Fri, Mar 08, 2019 at 02:56:23PM +0100, Hans Verkuil wrote:
>> The media_device is part of a static global vimc_device struct.
>> The media framework expects this to be zeroed before it is
>> used, however, since this is a global this is not the case if
>> vimc is unbound and then bound again.
>>
>> So call memset to ensure any left-over values are cleared.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Do I recall correctly that you mentioned there's work in progress that
> will allocate this dynamically ? If so feel free to mention it in the
> commit message if you want.

There is, but it might take some time before that will land (it's Helen's
patch series that converts vimc to use configfs to configure all the
subdevs and topology).

Regards,

	Hans

> 
>> ---
>>  drivers/media/platform/vimc/vimc-core.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
>> index 0fbb7914098f..3aa62d7e3d0e 100644
>> --- a/drivers/media/platform/vimc/vimc-core.c
>> +++ b/drivers/media/platform/vimc/vimc-core.c
>> @@ -304,6 +304,8 @@ static int vimc_probe(struct platform_device *pdev)
>>  
>>  	dev_dbg(&pdev->dev, "probe");
>>  
>> +	memset(&vimc->mdev, 0, sizeof(vimc->mdev));
>> +
>>  	/* Create platform_device for each entity in the topology*/
>>  	vimc->subdevs = devm_kcalloc(&vimc->pdev.dev, vimc->pipe_cfg->num_ents,
>>  				     sizeof(*vimc->subdevs), GFP_KERNEL);
> 


  reply	other threads:[~2019-03-08 14:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 13:56 [PATCHv4 0/9] Various core and virtual driver fixes Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 1/9] cec: fill in cec chardev kobject to ease debugging Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 2/9] media-devnode: fill in media " Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 3/9] vivid: use vzalloc for dev->bitmap_out Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 4/9] vim2m: replace devm_kzalloc by kzalloc Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 5/9] v4l2-subdev: add release() internal op Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 6/9] v4l2-subdev: handle module refcounting here Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 7/9] vimc: zero the media_device on probe Hans Verkuil
2019-03-08 14:09   ` Laurent Pinchart
2019-03-08 14:13     ` Hans Verkuil [this message]
2019-03-08 13:56 ` [PATCHv4 8/9] vimc: free vimc_cap_device when the last user disappears Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 9/9] vimc: use new release op Hans Verkuil
2019-03-11 12:34   ` [PATCHv4.1 " Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb52fba3-587c-5e59-5f3a-8c818bf413cd@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=helen.koike@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.