1 From foo@baz Wed Aug 22 09:16:55 CEST 2018
2 From: Ayan Kumar Halder <ayan.halder@arm.com>
3 Date: Fri, 20 Apr 2018 15:44:57 +0100
4 Subject: drm/arm/malidp: Ensure that the crtcs are shutdown before removing any encoder/connector
6 From: Ayan Kumar Halder <ayan.halder@arm.com>
8 [ Upstream commit 109c4d18e57445afcaf728b8716a69375a3daab2 ]
10 One needs to ensure that the crtcs are shutdown so that the
11 drm_crtc_state->connector_mask reflects that no connectors
12 are currently active. Further, it reduces the reference
13 count for each connector. This ensures that the connectors
14 and encoders can be cleanly removed either when _unbind
15 is called for the corresponding drivers or by
16 drm_mode_config_cleanup().
17 We need drm_atomic_helper_shutdown() to be called before
18 component_unbind_all() otherwise the connectors attached to the
19 component device will have the wrong reference count value and will not
22 Signed-off-by: Ayan Kumar Halder <ayan.halder@arm.com>
23 Acked-by: Liviu Dudau <liviu.dudau@arm.com>
24 Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
25 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 drivers/gpu/drm/arm/malidp_drv.c | 3 ++-
29 1 file changed, 2 insertions(+), 1 deletion(-)
31 --- a/drivers/gpu/drm/arm/malidp_drv.c
32 +++ b/drivers/gpu/drm/arm/malidp_drv.c
33 @@ -278,7 +278,6 @@ static int malidp_init(struct drm_device
35 static void malidp_fini(struct drm_device *drm)
37 - drm_atomic_helper_shutdown(drm);
38 drm_mode_config_cleanup(drm);
41 @@ -646,6 +645,7 @@ vblank_fail:
42 malidp_de_irq_fini(drm);
43 drm->irq_enabled = false;
45 + drm_atomic_helper_shutdown(drm);
46 component_unbind_all(dev, drm);
48 of_node_put(malidp->crtc.port);
49 @@ -681,6 +681,7 @@ static void malidp_unbind(struct device
50 malidp_se_irq_fini(drm);
51 malidp_de_irq_fini(drm);
52 drm->irq_enabled = false;
53 + drm_atomic_helper_shutdown(drm);
54 component_unbind_all(dev, drm);
55 of_node_put(malidp->crtc.port);
56 malidp->crtc.port = NULL;