]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/nouveau/acr: store a mask of LS falcons the HSFW can bootstrap
authorBen Skeggs <bskeggs@redhat.com>
Tue, 16 Jun 2020 04:19:35 +0000 (14:19 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:48 +0000 (18:50 +1000)
This will prevent reloading of HS FW where it's pointless, and bypass
hitting some timeouts.

Not a situation one should generally hit, but can occur with a messed
up firmware installation.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/acr/priv.h

index e4866a02e457eec8a9357a7b1c1b7da705b03b94..51a669e7bf6a9301495c44a0267b060d344226bd 100644 (file)
@@ -141,12 +141,19 @@ nvkm_acr_bootstrap_falcons(struct nvkm_device *device, unsigned long mask)
        struct nvkm_acr *acr = device->acr;
        unsigned long id;
 
+       /* If there's no LS FW managing bootstrapping of other LS falcons,
+        * we depend on the HS firmware being able to do it instead.
+        */
        if (!acrflcn) {
-               int ret = nvkm_acr_reload(acr);
-               if (ret)
-                       return ret;
+               /* Which isn't possible everywhere... */
+               if ((mask & acr->func->bootstrap_falcons) == mask) {
+                       int ret = nvkm_acr_reload(acr);
+                       if (ret)
+                               return ret;
 
-               return acr->done ? 0 : -EINVAL;
+                       return acr->done ? 0 : -EINVAL;
+               }
+               return -ENOSYS;
        }
 
        if (acrflcn->func->bootstrap_multiple_falcons) {
index 74ffcf1e8de89a13db4a61de9d02e3f2056a7154..cd41b2e6cc8795feca6152c8188028be96163d22 100644 (file)
@@ -446,6 +446,8 @@ gm200_acr_0 = {
        .wpr_patch = gm200_acr_wpr_patch,
        .wpr_check = gm200_acr_wpr_check,
        .init = gm200_acr_init,
+       .bootstrap_falcons = BIT_ULL(NVKM_ACR_LSF_FECS) |
+                            BIT_ULL(NVKM_ACR_LSF_GPCCS),
 };
 
 static int
index 9c10879051c8364f43a9e4d303aeb9170a055f43..d71af17a169a40e6837bffb56de71b93dbd27828 100644 (file)
@@ -28,6 +28,7 @@ struct nvkm_acr_func {
        void (*wpr_check)(struct nvkm_acr *, u64 *start, u64 *limit);
        int (*init)(struct nvkm_acr *);
        void (*fini)(struct nvkm_acr *);
+       u64 bootstrap_falcons;
 };
 
 extern const struct nvkm_acr_func gm200_acr;