Browse Source

drm/nouveau/secboot: make sure requested falcons are supported

Check at contruction time that we have support for all the LS firmwares
asked by the caller.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot 8 years ago
parent
commit
a335f078df
1 changed files with 7 additions and 0 deletions
  1. 7 0
      drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c

+ 7 - 0
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c

@@ -888,6 +888,13 @@ acr_r352_new_(const struct acr_r352_func *func,
 	      unsigned long managed_falcons)
 {
 	struct acr_r352 *acr;
+	int i;
+
+	/* Check that all requested falcons are supported */
+	for_each_set_bit(i, &managed_falcons, NVKM_SECBOOT_FALCON_END) {
+		if (!func->ls_func[i])
+			return ERR_PTR(-ENOTSUPP);
+	}
 
 	acr = kzalloc(sizeof(*acr), GFP_KERNEL);
 	if (!acr)