提交 243d4c02 编写于 作者: M Marek Szyprowski 提交者: Mauro Carvalho Chehab

[media] media: exynos4-is: fix deadlock on driver probe

Commit 0c426c47 ("[media] media: Always
keep a graph walk large enough around") changed
media_device_register_entity() function to take mdev->graph_mutex. This
causes deadlock in driver probe, which calls (indirectly) this function
with ->graph_mutex taken. This patch removes taking ->graph_mutex in
driver probe to avoid deadlock. Other drivers don't take ->graph_mutex
for entity registration, so this change should be safe.
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 89a09566
...@@ -1446,22 +1446,13 @@ static int fimc_md_probe(struct platform_device *pdev) ...@@ -1446,22 +1446,13 @@ static int fimc_md_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, fmd); platform_set_drvdata(pdev, fmd);
/* Protect the media graph while we're registering entities */
mutex_lock(&fmd->media_dev.graph_mutex);
ret = fimc_md_register_platform_entities(fmd, dev->of_node); ret = fimc_md_register_platform_entities(fmd, dev->of_node);
if (ret) { if (ret)
mutex_unlock(&fmd->media_dev.graph_mutex);
goto err_clk; goto err_clk;
}
ret = fimc_md_register_sensor_entities(fmd); ret = fimc_md_register_sensor_entities(fmd);
if (ret) { if (ret)
mutex_unlock(&fmd->media_dev.graph_mutex);
goto err_m_ent; goto err_m_ent;
}
mutex_unlock(&fmd->media_dev.graph_mutex);
ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode); ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册