Commit 02158552 authored by Vicente Bergas's avatar Vicente Bergas Committed by Greg Kroah-Hartman

drm/rockchip: shutdown drm subsystem on shutdown

commit b8f9d7f3 upstream.

As explained by Robin Murphy:
> the IOMMU shutdown disables paging, so if the VOP is still
> scanning out then that will result in whatever IOVAs it was using now going
> straight out onto the bus as physical addresses.

We had a more radical approach before in commit
7f3ef5de ("drm/rockchip: Allow driver to be shutdown on reboot/kexec")
but that resulted in new warnings and oopses on shutdown on rk3399
chromeos devices.

So second try is resurrecting Vicentes shutdown change which should
achieve the same result but in a less drastic way.

Fixes: 63238173 ("Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"")
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Brian Norris <briannorris@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: stable@vger.kernel.org
Suggested-by: default avatarJeffyChen <jeffy.chen@rock-chips.com>
Suggested-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarVicente Bergas <vicencb@gmail.com>
[adapted commit message to explain the history]
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Tested-by: default avatarBrian Norris <briannorris@chromium.org>
Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190402113753.10118-1-heiko@sntech.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a7ca9dd7
...@@ -448,6 +448,14 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev) ...@@ -448,6 +448,14 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev)
return 0; return 0;
} }
static void rockchip_drm_platform_shutdown(struct platform_device *pdev)
{
struct drm_device *drm = platform_get_drvdata(pdev);
if (drm)
drm_atomic_helper_shutdown(drm);
}
static const struct of_device_id rockchip_drm_dt_ids[] = { static const struct of_device_id rockchip_drm_dt_ids[] = {
{ .compatible = "rockchip,display-subsystem", }, { .compatible = "rockchip,display-subsystem", },
{ /* sentinel */ }, { /* sentinel */ },
...@@ -457,6 +465,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); ...@@ -457,6 +465,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids);
static struct platform_driver rockchip_drm_platform_driver = { static struct platform_driver rockchip_drm_platform_driver = {
.probe = rockchip_drm_platform_probe, .probe = rockchip_drm_platform_probe,
.remove = rockchip_drm_platform_remove, .remove = rockchip_drm_platform_remove,
.shutdown = rockchip_drm_platform_shutdown,
.driver = { .driver = {
.name = "rockchip-drm", .name = "rockchip-drm",
.of_match_table = rockchip_drm_dt_ids, .of_match_table = rockchip_drm_dt_ids,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment