Skip to contentSkip to conversation

media: ipu3-cio2: Fix PM runtime usage_count in driver unbind

PATCH In review Sakari Ailus 2 participants 3 messages Feb 1, 2023 – Feb 2, 2023

Subsystems (2)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

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

Get the PM runtime usage_count and forbid PM runtime at driver unbind. The opposite is being done in probe() already.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +3 -0
index 390bd5ea3472..3b76a9d0383a 100644
@@ -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)
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw

________________________
BRs,
Intel VTG - Linux & Chrome IPU SW
Bingbu Cao

Quoted 33 lines

-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Wednesday, February 1, 2023 21:38
To: [email protected]
Cc: Cao, Bingbu <[email protected]>
Subject: [PATCH 1/1] media: ipu3-cio2: Fix PM runtime usage_count in driver unbind

Get the PM runtime usage_count and forbid PM runtime at driver unbind. The opposite is being done in probe() already.

---
 drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +3 -1
index 390bd5ea3472..3b76a9d0383a 100644
@@ -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)
--

2.30.2