Files
linux/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/base.c
Linus Torvalds bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00

67 lines
1.5 KiB
C

/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
*/
#include "priv.h"
int
nvkm_fsp_boot_gsp_fmc(struct nvkm_fsp *fsp, u64 args_addr, u32 rsvd_size, bool resume,
u64 img_addr, const u8 *hash, const u8 *pkey, const u8 *sig)
{
return fsp->func->cot.boot_gsp_fmc(fsp, args_addr, rsvd_size, resume,
img_addr, hash, pkey, sig);
}
bool
nvkm_fsp_verify_gsp_fmc(struct nvkm_fsp *fsp, u32 hash_size, u32 pkey_size, u32 sig_size)
{
return hash_size == fsp->func->cot.size_hash &&
pkey_size == fsp->func->cot.size_pkey &&
sig_size == fsp->func->cot.size_sig;
}
static int
nvkm_fsp_preinit(struct nvkm_subdev *subdev)
{
struct nvkm_fsp *fsp = nvkm_fsp(subdev);
return fsp->func->wait_secure_boot(fsp);
}
static void *
nvkm_fsp_dtor(struct nvkm_subdev *subdev)
{
struct nvkm_fsp *fsp = nvkm_fsp(subdev);
nvkm_falcon_dtor(&fsp->falcon);
return fsp;
}
static const struct nvkm_falcon_func
nvkm_fsp_flcn = {
.emem_pio = &gp102_flcn_emem_pio,
};
static const struct nvkm_subdev_func
nvkm_fsp = {
.dtor = nvkm_fsp_dtor,
.preinit = nvkm_fsp_preinit,
};
int
nvkm_fsp_new_(const struct nvkm_fsp_func *func,
struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_fsp **pfsp)
{
struct nvkm_fsp *fsp;
fsp = *pfsp = kzalloc_obj(*fsp);
if (!fsp)
return -ENOMEM;
fsp->func = func;
nvkm_subdev_ctor(&nvkm_fsp, device, type, inst, &fsp->subdev);
return nvkm_falcon_ctor(&nvkm_fsp_flcn, &fsp->subdev, "fsp", 0x8f2000, &fsp->falcon);
}