<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 6, 2017 at 12:30 AM, Jon Hunter <span dir="ltr"><<a href="mailto:jonathanh@nvidia.com" target="_blank">jonathanh@nvidia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 04/12/17 18:37, Guillaume Tucker wrote:<br>
> If the firmware fails to load then ->fini() will be called before the<br>
> device has been initialised, causing the kernel to hang while trying<br>
> to write to a register. Add a test in ->fini() to avoid this issue.<br>
><br>
> This fixes a kernel hang on tegra124.<br>
><br>
> Fixes: b17de35a2ebbe ("drm/nouveau/bar: implement bar1 teardown")<br>
> Signed-off-by: Guillaume Tucker <<a href="mailto:guillaume.tucker@collabora.com">guillaume.tucker@collabora.<wbr>com</a>><br>
> CC: Ben Skeggs <<a href="mailto:bskeggs@redhat.com">bskeggs@redhat.com</a>><br>
> ---<br>
> drivers/gpu/drm/nouveau/nvkm/<wbr>subdev/bar/gf100.c | 7 +++++--<br>
> 1 file changed, 5 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/nouveau/<wbr>nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/<wbr>nvkm/subdev/bar/gf100.c<br>
> index a3ba7f50198b..95e2aba64aad 100644<br>
> --- a/drivers/gpu/drm/nouveau/<wbr>nvkm/subdev/bar/gf100.c<br>
> +++ b/drivers/gpu/drm/nouveau/<wbr>nvkm/subdev/bar/gf100.c<br>
> @@ -43,9 +43,12 @@ gf100_bar_bar1_wait(struct nvkm_bar *base)<br>
> }<br>
><br>
> void<br>
> -gf100_bar_bar1_fini(struct nvkm_bar *bar)<br>
> +gf100_bar_bar1_fini(struct nvkm_bar *base)<br>
> {<br>
> - nvkm_mask(bar->subdev.device, 0x001704, 0x80000000, 0x00000000);<br>
> + struct nvkm_device *device = base->subdev.device;<br>
> +<br>
> + if (base->subdev.oneinit)<br>
> + nvkm_mask(device, 0x001704, 0x80000000, 0x00000000);<br>
> }<br>
><br>
> void<br>
<br>
</div></div>I have tested this and it works for me. Thanks for fixing this! Would be<br>
good to get Ben's ACK, but you can have my ...<br></blockquote><div>I'd love to get a good explanation as to why it hangs without this change, as, on the surface, it's not immediately obvious as to why it's hanging.</div><div><br></div><div>Thanks,</div><div>Ben.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Tested-by: Jon Hunter <<a href="mailto:jonathanh@nvidia.com">jonathanh@nvidia.com</a>><br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888">Jon<br>
<br>
--<br>
nvpublic<br>
</font></span></blockquote></div><br></div></div>