brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0542-drm-vc4-Free-hang-state-before-destroying-BO-cache.patch
1 From 778bdac35c6979233dd6384dfba01eaa2a4b982b Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Tue, 26 Jul 2016 13:47:13 -0700
4 Subject: [PATCH] drm/vc4: Free hang state before destroying BO cache.
5
6 The BO cache will complain if BOs are still allocated when we try to
7 destroy it (since freeing those BOs would try to hit the cache). You
8 could hit this if you were to unload the module after a GPU hang.
9
10 Signed-off-by: Eric Anholt <eric@anholt.net>
11 Fixes: 214613656b51 ("drm/vc4: Add an interface for capturing the GPU state after a hang.")
12 (cherry picked from commit def96527707e1978a0c88e75d13b082f51460d5c)
13 ---
14 drivers/gpu/drm/vc4/vc4_gem.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17 --- a/drivers/gpu/drm/vc4/vc4_gem.c
18 +++ b/drivers/gpu/drm/vc4/vc4_gem.c
19 @@ -968,8 +968,8 @@ vc4_gem_destroy(struct drm_device *dev)
20 vc4->overflow_mem = NULL;
21 }
22
23 - vc4_bo_cache_destroy(dev);
24 -
25 if (vc4->hang_state)
26 vc4_free_hang_state(dev, vc4->hang_state);
27 +
28 + vc4_bo_cache_destroy(dev);
29 }