Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752620AbdLEOaa (ORCPT ); Tue, 5 Dec 2017 09:30:30 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:8841 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbdLEOa1 (ORCPT ); Tue, 5 Dec 2017 09:30:27 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 05 Dec 2017 06:30:27 -0800 Subject: Re: [PATCH 1/2] drm/nouveau/bar/gf100: fix hang when calling ->fini() before ->init() To: Guillaume Tucker , David Airlie , Ben Skeggs CC: , , , References: From: Jon Hunter Message-ID: <6db622ac-319d-c640-91ab-9248e528b69b@nvidia.com> Date: Tue, 5 Dec 2017 14:30:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.21.132.148] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1469 Lines: 45 On 04/12/17 18:37, Guillaume Tucker wrote: > If the firmware fails to load then ->fini() will be called before the > device has been initialised, causing the kernel to hang while trying > to write to a register. Add a test in ->fini() to avoid this issue. > > This fixes a kernel hang on tegra124. > > Fixes: b17de35a2ebbe ("drm/nouveau/bar: implement bar1 teardown") > Signed-off-by: Guillaume Tucker > CC: Ben Skeggs > --- > drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c > index a3ba7f50198b..95e2aba64aad 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c > @@ -43,9 +43,12 @@ gf100_bar_bar1_wait(struct nvkm_bar *base) > } > > void > -gf100_bar_bar1_fini(struct nvkm_bar *bar) > +gf100_bar_bar1_fini(struct nvkm_bar *base) > { > - nvkm_mask(bar->subdev.device, 0x001704, 0x80000000, 0x00000000); > + struct nvkm_device *device = base->subdev.device; > + > + if (base->subdev.oneinit) > + nvkm_mask(device, 0x001704, 0x80000000, 0x00000000); > } > > void I have tested this and it works for me. Thanks for fixing this! Would be good to get Ben's ACK, but you can have my ... Tested-by: Jon Hunter Cheers Jon -- nvpublic