mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: rockchip: isp: assign memory for device early
The sub devices of rkisp will allocate memory from rkisp before the reserved memory been assigned to rkisp, and will alloc from default continuous cma memory region instead. The current system may never do free these memory, so the issue when to free these memory can not happen. Fix free issue by moving the assign memory earlier. Also return error if failed to assign reserved memory since driver has no iommu. Change-Id: I4bd3437e5536bda827c6ca71d630a993fcce2d8d Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
@@ -1088,6 +1088,15 @@ static int rkisp_plat_probe(struct platform_device *pdev)
|
||||
sizeof(isp_dev->media_dev.model));
|
||||
isp_dev->media_dev.dev = &pdev->dev;
|
||||
isp_dev->media_dev.ops = &rkisp_media_ops;
|
||||
|
||||
if (!is_iommu_enable(dev)) {
|
||||
ret = of_reserved_mem_device_init(dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "No reserved memory region\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
v4l2_dev = &isp_dev->v4l2_dev;
|
||||
v4l2_dev->mdev = &isp_dev->media_dev;
|
||||
strlcpy(v4l2_dev->name, DRIVER_NAME, sizeof(v4l2_dev->name));
|
||||
@@ -1114,13 +1123,6 @@ static int rkisp_plat_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
goto err_unreg_media_dev;
|
||||
|
||||
if (!is_iommu_enable(dev)) {
|
||||
ret = of_reserved_mem_device_init(dev);
|
||||
if (ret)
|
||||
v4l2_warn(v4l2_dev,
|
||||
"No reserved memory region assign to isp\n");
|
||||
}
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
ret = rkisp_vs_irq_parse(pdev);
|
||||
|
||||
Reference in New Issue
Block a user