From: Bing Bu Cao <bingbu.cao@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, rajmohan.mani@intel.com,
yong.zhi@intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com,
jian.xu.zheng@intel.com
Subject: Re: [PATCH 1/2] ipu3-cio2: Unregister device nodes first, then release resources
Date: Mon, 15 Oct 2018 17:15:50 +0800 [thread overview]
Message-ID: <05a4e10d-76fa-b6a0-4c7e-2d09e343fa77@linux.intel.com> (raw)
In-Reply-To: <20181015083929.kgx3wvtnjcunmfub@paasikivi.fi.intel.com>
On 10/15/2018 04:39 PM, Sakari Ailus wrote:
> Hi Bingbu,
>
> On Mon, Oct 15, 2018 at 03:15:05PM +0800, Bing Bu Cao wrote:
>> On 10/10/2018 04:32 PM, Sakari Ailus wrote:
>>> While there are issues related to object lifetime management, unregister
>>> the media device first, followed immediately by other device nodes when
>>> the driver is being unbound. Only then the resources needed by the driver
>>> may be released. This is slightly safer.
>>>
>>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>>> ---
>>> drivers/media/pci/intel/ipu3/ipu3-cio2.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
>>> index 452eb9b42140..723022ef3662 100644
>>> --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
>>> +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
>>> @@ -1846,12 +1846,12 @@ static void cio2_pci_remove(struct pci_dev *pci_dev)
>>> struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
>>> unsigned int i;
>>>
>>> + media_device_unregister(&cio2->media_dev);
>>> cio2_notifier_exit(cio2);
>>> - cio2_fbpt_exit_dummy(cio2);
>>> for (i = 0; i < CIO2_QUEUES; i++)
>>> cio2_queue_exit(cio2, &cio2->queue[i]);
>>> + cio2_fbpt_exit_dummy(cio2);
>> Hi, Sakari,
>> The fbpt dummy pages cleanup does not matter much before/after queues
>> exit, right?
> cio2_queue_exit() will unregister the video device and the video buffer
> queue. Up to this point it's possible to open the video device and start
> streaming on it. While this patch does not fully address the issue it makes
> it a slightly lesser issue.
Okay, thanks for your explanation.
>>> v4l2_device_unregister(&cio2->v4l2_dev);
>>> - media_device_unregister(&cio2->media_dev);
>>> media_device_cleanup(&cio2->media_dev);
>>> mutex_destroy(&cio2->lock);
>>> }
next prev parent reply other threads:[~2018-10-15 16:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 8:32 [PATCH 0/2] Trivial CIO2 patches Sakari Ailus
2018-10-10 8:32 ` [PATCH 1/2] ipu3-cio2: Unregister device nodes first, then release resources Sakari Ailus
2018-10-11 9:15 ` Bing Bu Cao
2018-10-15 7:15 ` Bing Bu Cao
2018-10-15 8:39 ` Sakari Ailus
2018-10-15 9:15 ` Bing Bu Cao [this message]
2018-10-10 8:32 ` [PATCH 2/2] ipu3-cio2: Use cio2_queues_exit Sakari Ailus
2018-10-11 9:16 ` Bing Bu Cao
2018-10-13 20:15 ` 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=05a4e10d-76fa-b6a0-4c7e-2d09e343fa77@linux.intel.com \
--to=bingbu.cao@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=jian.xu.zheng@intel.com \
--cc=linux-media@vger.kernel.org \
--cc=rajmohan.mani@intel.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@intel.com \
--cc=yong.zhi@intel.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