]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.19 / drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch
1 From b8f9d7f37b6af829c34c49d1a4f73ce6ed58e403 Mon Sep 17 00:00:00 2001
2 From: Vicente Bergas <vicencb@gmail.com>
3 Date: Tue, 2 Apr 2019 13:37:53 +0200
4 Subject: drm/rockchip: shutdown drm subsystem on shutdown
5
6 From: Vicente Bergas <vicencb@gmail.com>
7
8 commit b8f9d7f37b6af829c34c49d1a4f73ce6ed58e403 upstream.
9
10 As explained by Robin Murphy:
11 > the IOMMU shutdown disables paging, so if the VOP is still
12 > scanning out then that will result in whatever IOVAs it was using now going
13 > straight out onto the bus as physical addresses.
14
15 We had a more radical approach before in commit
16 7f3ef5dedb14 ("drm/rockchip: Allow driver to be shutdown on reboot/kexec")
17 but that resulted in new warnings and oopses on shutdown on rk3399
18 chromeos devices.
19
20 So second try is resurrecting Vicentes shutdown change which should
21 achieve the same result but in a less drastic way.
22
23 Fixes: 63238173b2fa ("Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"")
24 Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
25 Cc: Robin Murphy <robin.murphy@arm.com>
26 Cc: Marc Zyngier <marc.zyngier@arm.com>
27 Cc: Brian Norris <briannorris@chromium.org>
28 Cc: Doug Anderson <dianders@chromium.org>
29 Cc: stable@vger.kernel.org
30 Suggested-by: JeffyChen <jeffy.chen@rock-chips.com>
31 Suggested-by: Robin Murphy <robin.murphy@arm.com>
32 Signed-off-by: Vicente Bergas <vicencb@gmail.com>
33 [adapted commit message to explain the history]
34 Signed-off-by: Heiko Stuebner <heiko@sntech.de>
35 Tested-by: Brian Norris <briannorris@chromium.org>
36 Tested-by: Douglas Anderson <dianders@chromium.org>
37 Acked-by: Marc Zyngier <marc.zyngier@arm.com>
38 Link: https://patchwork.freedesktop.org/patch/msgid/20190402113753.10118-1-heiko@sntech.de
39 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40
41 ---
42 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 +++++++++
43 1 file changed, 9 insertions(+)
44
45 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
46 +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
47 @@ -442,6 +442,14 @@ static int rockchip_drm_platform_remove(
48 return 0;
49 }
50
51 +static void rockchip_drm_platform_shutdown(struct platform_device *pdev)
52 +{
53 + struct drm_device *drm = platform_get_drvdata(pdev);
54 +
55 + if (drm)
56 + drm_atomic_helper_shutdown(drm);
57 +}
58 +
59 static const struct of_device_id rockchip_drm_dt_ids[] = {
60 { .compatible = "rockchip,display-subsystem", },
61 { /* sentinel */ },
62 @@ -451,6 +459,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_
63 static struct platform_driver rockchip_drm_platform_driver = {
64 .probe = rockchip_drm_platform_probe,
65 .remove = rockchip_drm_platform_remove,
66 + .shutdown = rockchip_drm_platform_shutdown,
67 .driver = {
68 .name = "rockchip-drm",
69 .of_match_table = rockchip_drm_dt_ids,