diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 06:54:20 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 04:40:44 +0200 |
commit | 8de65bd0901e2ee7a485a158bfe9e4631cc00644 (patch) | |
tree | ca9033713ff66a001a1697fa966cf86500094328 /drivers/gpu/drm/nouveau/nvkm/subdev/devinit | |
parent | drm/nouveau/ibus: convert to new-style nvkm_subdev (diff) | |
download | linux-8de65bd0901e2ee7a485a158bfe9e4631cc00644.tar.xz linux-8de65bd0901e2ee7a485a158bfe9e4631cc00644.zip |
drm/nouveau/devinit: run devinit scripts right after preinit
This ensures we have a valid mask of disabled engines before we start
trying to execute fini()/init() on the subdevs, potentially touching
devices that don't exist.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/devinit')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c index 47823f5a2cdf..5f25402f6b09 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c @@ -50,11 +50,21 @@ nvkm_devinit_meminit(struct nvkm_devinit *init) u64 nvkm_devinit_disable(struct nvkm_devinit *init) { - if (init->func->disable) + if (init && init->func->disable) return init->func->disable(init); return 0; } +int +nvkm_devinit_post(struct nvkm_devinit *init, u64 *disable) +{ + int ret = 0; + if (init && init->func->post) + ret = init->func->post(init, init->post); + *disable = nvkm_devinit_disable(init); + return ret; +} + static int nvkm_devinit_fini(struct nvkm_subdev *subdev, bool suspend) { @@ -82,17 +92,8 @@ static int nvkm_devinit_init(struct nvkm_subdev *subdev) { struct nvkm_devinit *init = nvkm_devinit(subdev); - int ret; - - ret = init->func->post(init, init->post); - if (ret) - return ret; - if (init->func->init) init->func->init(init); - - if (init->func->disable) - subdev->device->disable_mask |= init->func->disable(init); return 0; } |