From: Bing Bu Cao <bingbu.cao@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: 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: Thu, 11 Oct 2018 17:15:58 +0800 [thread overview]
Message-ID: <32526d30-eb77-328f-1cc0-2b168bb163a8@linux.intel.com> (raw)
In-Reply-To: <20181010083231.27492-2-sakari.ailus@linux.intel.com>
Tested-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
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);
> 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-11 16:38 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 [this message]
2018-10-15 7:15 ` Bing Bu Cao
2018-10-15 8:39 ` Sakari Ailus
2018-10-15 9:15 ` Bing Bu Cao
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=32526d30-eb77-328f-1cc0-2b168bb163a8@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