From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0118.outbound.protection.outlook.com ([104.47.40.118]:6016 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727336AbeH3WMP (ORCPT ); Thu, 30 Aug 2018 18:12:15 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Lucas Stach , Sasha Levin Subject: [PATCH AUTOSEL 4.18 103/113] drm/etnaviv: fix crash in GPU suspend when init failed due to buffer placement Date: Thu, 30 Aug 2018 18:08:25 +0000 Message-ID: <20180830180714.36167-37-alexander.levin@microsoft.com> References: <20180830180714.36167-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180714.36167-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Lucas Stach [ Upstream commit 5b147465532365dc4e2fee8499d6ca1f52dd0d16 ] When the suballocator was unable to provide a suitable buffer for the MMUv1 linear window, we roll back the GPU initialization. As the GPU is runtime resumed at that point we need to clear the kernel cmdbuf suballoc entry to properly skip any attempt to manipulate the cmdbuf when the GPU gets shut down in the runtime suspend later on. Signed-off-by: Lucas Stach Signed-off-by: Sasha Levin --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnavi= v/etnaviv_gpu.c index 686f6552db48..3ef440b235e5 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -799,6 +799,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) =20 free_buffer: etnaviv_cmdbuf_free(&gpu->buffer); + gpu->buffer.suballoc =3D NULL; destroy_iommu: etnaviv_iommu_destroy(gpu->mmu); gpu->mmu =3D NULL; --=20 2.17.1