diff mbox series

[1/1] media: ipu3-cio2: Fix PM runtime usage_count in driver unbind

Message ID 20230201133751.305474-1-sakari.ailus@linux.intel.com
State Accepted
Commit 909d3096ac99fa2289f9b8945a3eab2269947a0a
Headers show
Series [1/1] media: ipu3-cio2: Fix PM runtime usage_count in driver unbind | expand

Commit Message

Sakari Ailus Feb. 1, 2023, 1:37 p.m. UTC
Get the PM runtime usage_count and forbid PM runtime at driver unbind. The
opposite is being done in probe() already.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Bingbu Cao Feb. 1, 2023, 4 p.m. UTC | #1
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Sakari Ailus Feb. 2, 2023, 9:42 a.m. UTC | #2
Hi Bingbu,

On Wed, Feb 01, 2023 at 04:00:50PM +0000, Cao, Bingbu wrote:
> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>

I'm adding:

Fixes: commit c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver")
Cc: stable@vger.kernel.org # for >= 4.16
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
index 390bd5ea3472..3b76a9d0383a 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
@@ -1843,6 +1843,9 @@  static void cio2_pci_remove(struct pci_dev *pci_dev)
 	v4l2_device_unregister(&cio2->v4l2_dev);
 	media_device_cleanup(&cio2->media_dev);
 	mutex_destroy(&cio2->lock);
+
+	pm_runtime_forbid(&pci_dev->dev);
+	pm_runtime_get_noresume(&pci_dev->dev);
 }
 
 static int __maybe_unused cio2_runtime_suspend(struct device *dev)