drm/nouveau/devinit/gf100: make devinit on resume safer
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 1 Apr 2016 06:40:59 +0000 (15:40 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 20 May 2016 04:43:04 +0000 (14:43 +1000)
commitc6007dc4e55e1a483c4d1e32dc1055b41aeacfc1
treef2114f0010978daed3c954fb88e5b605bc02170f
parent4dc28134a8c124aa01b441e1e5b8b54312edc5dd
drm/nouveau/devinit/gf100: make devinit on resume safer

In case of successful suspend, devinit will have to be run and this is
the behavior currently hardcoded. However, as FD bug 94725 suggests,
there might be cases where runtime suspend leaves the GPU powered, and
in such cases devinit should not be run on resume.

On GF100+ we have a reliable way to know whether we need to run devinit.
Use it instead of blindly trusting the flag set by nvkm_devinit_fini().

The code around the NvForcePost also needs to be slightly reworked in
order to keep working.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Suggested-by: Dave Airlie <airlied@redhat.com>
Suggested-by: Karol Herbst <nouveau@karolherbst.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c