From: bingbu.cao@intel.com
To: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
laurent.pinchart@ideasonboard.com
Cc: tomi.valkeinen@ideasonboard.com, hans@jjverkuil.nl,
jacopo.mondi@ideasonboard.com, bingbu.cao@intel.com,
bingbu.cao@linux.intel.com
Subject: [PATCH 3/3] media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release
Date: Fri, 15 Aug 2025 17:20:37 +0800 [thread overview]
Message-ID: <20250815092037.1825769-3-bingbu.cao@intel.com> (raw)
In-Reply-To: <20250815092037.1825769-1-bingbu.cao@intel.com>
From: Bingbu Cao <bingbu.cao@intel.com>
IPU7 ISYS and PSYS auxiliary devices are released after
ipu7_bus_del_devices(), so driver can not reference the MMU devices
from ISYS and PSYS auxiliary devices, so move the MMUs cleanup before
releasing the auxiliary devices.
Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
---
drivers/staging/media/ipu7/ipu7.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c
index aef931d23510..3de41b3d1ae1 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2644,6 +2644,9 @@ static void ipu7_pci_remove(struct pci_dev *pdev)
if (!IS_ERR_OR_NULL(isp->fw_code_region))
vfree(isp->fw_code_region);
+ ipu7_mmu_cleanup(isp->isys->mmu);
+ ipu7_mmu_cleanup(isp->psys->mmu);
+
ipu7_bus_del_devices(pdev);
pm_runtime_forbid(&pdev->dev);
@@ -2653,8 +2656,6 @@ static void ipu7_pci_remove(struct pci_dev *pdev)
release_firmware(isp->cpd_fw);
- ipu7_mmu_cleanup(isp->psys->mmu);
- ipu7_mmu_cleanup(isp->isys->mmu);
}
static void ipu7_pci_reset_prepare(struct pci_dev *pdev)
--
2.34.1
next prev parent reply other threads:[~2025-08-15 9:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 9:20 [PATCH 1/3] media: staging/ipu7: convert to use pci_alloc_irq_vectors() API bingbu.cao
2025-08-15 9:20 ` [PATCH 2/3] media: staging/ipu7: Don't set name for IPU7 PCI device bingbu.cao
2025-08-15 9:20 ` bingbu.cao [this message]
2025-08-15 21:26 ` [PATCH 3/3] media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release Sakari Ailus
2025-08-18 2:27 ` Bingbu Cao
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=20250815092037.1825769-3-bingbu.cao@intel.com \
--to=bingbu.cao@intel.com \
--cc=bingbu.cao@linux.intel.com \
--cc=hans@jjverkuil.nl \
--cc=jacopo.mondi@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen@ideasonboard.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.