summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/subdev
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2017-01-23 12:48:09 +0900
committerBen Skeggs <bskeggs@redhat.com>2017-03-07 17:05:11 +1000
commita335f078df6006bd7694a1480e7dfbcf7e0de00c (patch)
tree65917fe2d7cf9422604432f8fe53a6c2d95addc6 /drivers/gpu/drm/nouveau/nvkm/subdev
parent489a5fe868f1d1b09d1c1337424c09e686437c3c (diff)
downloadop-kernel-dev-a335f078df6006bd7694a1480e7dfbcf7e0de00c.zip
op-kernel-dev-a335f078df6006bd7694a1480e7dfbcf7e0de00c.tar.gz
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
index b1e5652..372d295 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
+++ b/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)
OpenPOWER on IntegriCloud