From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Shuah Khan" <shuah.kh@samsung.com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
"Linux Media Mailing List" <linux-media@vger.kernel.org>,
"Mauro Carvalho Chehab" <mchehab@infradead.org>,
"Javier Martinez Canillas" <javier@osg.samsung.com>,
"Rafael Lourenço de Lima Chehab" <chehabrafael@gmail.com>
Subject: Re: [PATCH 4/4] [meida] media-device: dynamically allocate struct media_devnode
Date: Thu, 28 Apr 2016 13:43:29 -0300 [thread overview]
Message-ID: <20160428134329.5e60ec3e@recife.lan> (raw)
In-Reply-To: <572238EE.2090303@osg.samsung.com>
Shuah,
Em Thu, 28 Apr 2016 10:23:10 -0600
Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> >>> I'm running it today with the stress test. So far (~100 unbind loops, with 5
> >>> concurrent accesses via mc_nextgen_test), the only issue it got so
> >>> far seems to be at V4L2 cdev stuff (not at the media side, but at the
> >>> V4L2 API side):
> >>
> >> Are you planning to debug this further to isolate the problem?
> >
> > Not now. I didn't actually check the code, but, after thinking
> > a little bit more, this is very likely the media cdev issue.
> > your cdev patch setting the parent should fix it.
>
> Looks like you still have some comments from Lars that aren't
> addressed - looking at the
>
> https://git.linuxtv.org/mchehab/experimental.git/commit/?h=au0828-unbind-fixes-v5&id=0ab1eadf69c73e66860d2ee3ed8d7ceebac222d5
>
> Please see inline on what needs fixing:
>
> > + struct media_device *dev = devnode->media_dev;
>
> You need a lock to protect this from running concurrently with
> media_device_unregister() otherwise the struct might be freed while still in
> use.
Let's not try to solve multiple multiple different issues in the
same patch. The rule is one patch per logical change.
This one deals *only* with the dynamic allocation of media_devnode.
So, adding other locks, using krefs, cdevs, etc should be done on
separate patches.
> Not sure if this follwoing comment is relevant for your patch.
> It was for mine.
It is relevant: accessing mdev from devnode should be protected,
e. g. we cannot let the driver free media_dev() while the pointer
is being used.
I guess this could easily be fixed by locking any changes to
devnode->media_dev using the media devnode static lock.
> mdev->devnode->media_dev needs to be set to NULL.
I guess my patch already does that.
>
> Please let me know once you have these addressed. Are you planning to
> send the patch out for review once these comments are addressed?
>
> thanks,
> -- Shuah
next prev parent reply other threads:[~2016-04-28 16:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 19:27 [PATCH 0/4] Some fixes and cleanups for the Media Controller code Mauro Carvalho Chehab
2016-03-23 19:27 ` [PATCH 1/4] [media] media-device: Simplify compat32 logic Mauro Carvalho Chehab
2016-03-24 8:40 ` Laurent Pinchart
2016-03-23 19:27 ` [PATCH 2/4] [media] media-devnode: fix namespace mess Mauro Carvalho Chehab
2016-03-23 19:27 ` [PATCH 3/4] [media] media-device: get rid of a leftover comment Mauro Carvalho Chehab
2016-03-24 8:41 ` Laurent Pinchart
2016-03-23 19:27 ` [PATCH 4/4] [meida] media-device: dynamically allocate struct media_devnode Mauro Carvalho Chehab
2016-03-23 20:28 ` kbuild test robot
2016-03-24 8:24 ` Laurent Pinchart
2016-03-24 11:37 ` Mauro Carvalho Chehab
2016-04-27 22:20 ` Shuah Khan
2016-04-28 11:41 ` Mauro Carvalho Chehab
2016-04-28 14:50 ` Shuah Khan
2016-04-28 15:04 ` Mauro Carvalho Chehab
2016-04-28 16:23 ` Shuah Khan
2016-04-28 16:43 ` Mauro Carvalho Chehab [this message]
2016-03-24 10:03 ` [PATCH 0/4] Some fixes and cleanups for the Media Controller code Sakari Ailus
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=20160428134329.5e60ec3e@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=chehabrafael@gmail.com \
--cc=javier@osg.samsung.com \
--cc=lars@metafoo.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=shuah.kh@samsung.com \
--cc=shuahkh@osg.samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox