Mel Henning
2025-Jul-21 19:09 UTC
[PATCH V2 0/3] drm/nouveau: Remove DRM_NOUVEAU_GSP_DEFAULT config
Following earlier discussion at https://lists.freedesktop.org/archives/nouveau/2025-June/047887.html this series removes DRM_NOUVEAU_GSP_DEFAULT. The first two patches are the same as they were in V1. V2 adds a third commit that improves an error message in response to feedback from V1. Mel Henning (3): drm/nouveau: Remove DRM_NOUVEAU_GSP_DEFAULT config drm/nouveau: Remove nvkm_gsp_fwif.enable drm/nouveau: Improve message for missing firmware drivers/gpu/drm/nouveau/Kconfig | 8 -------- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 4 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c | 4 +++- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h | 1 - drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c | 6 +----- 8 files changed, 9 insertions(+), 20 deletions(-) -- 2.50.1
Mel Henning
2025-Jul-21 19:09 UTC
[PATCH V2 1/3] drm/nouveau: Remove DRM_NOUVEAU_GSP_DEFAULT config
This option was originally intoduced because the GSP code path was not well tested and we wanted to leave it up to distros which code path they shipped by default. By now though, the GSP path is probably better tested than the old firmware eg. Fedora ships GSP by default and we generally run CTS on GSP. We've always been GSP-only on Ada and later. So, this path removes the option and effectively sets the option to always on. We still fall back to the old firmware if GSP is not found. This change only affects Turing and Ampere. Users can still set nouveau.config=NvGspRm=0 on the kernel command line to force using the old firmware on Turing/Ampere. Signed-off-by: Mel Henning <mhenning at darkrefraction.com> Reviewed-by: Ben Skeggs <bskeggs at nvidia.com> --- drivers/gpu/drm/nouveau/Kconfig | 8 -------- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c | 6 +----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index d1587639ebb0..c88776d1e784 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -102,14 +102,6 @@ config DRM_NOUVEAU_SVM Say Y here if you want to enable experimental support for Shared Virtual Memory (SVM). -config DRM_NOUVEAU_GSP_DEFAULT - bool "Use GSP firmware for Turing/Ampere (needs firmware installed)" - depends on DRM_NOUVEAU - default n - help - Say Y here if you want to use the GSP codepaths by default on - Turing and Ampere GPUs. - config DRM_NOUVEAU_CH7006 tristate "Chrontel ch7006 TV encoder" depends on DRM_NOUVEAU diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c index 58e233bc53b1..81e56da0474a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c @@ -383,13 +383,9 @@ int tu102_gsp_load_rm(struct nvkm_gsp *gsp, const struct nvkm_gsp_fwif *fwif) { struct nvkm_subdev *subdev = &gsp->subdev; - bool enable_gsp = fwif->enable; int ret; -#if IS_ENABLED(CONFIG_DRM_NOUVEAU_GSP_DEFAULT) - enable_gsp = true; -#endif - if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", enable_gsp)) + if (!nvkm_boolopt(subdev->device->cfgopt, "NvGspRm", true)) return -EINVAL; ret = nvkm_gsp_load_fw(gsp, "gsp", fwif->ver, &gsp->fws.rm); -- 2.50.1
This struct element is no longer used. Signed-off-by: Mel Henning <mhenning at darkrefraction.com> Reviewed-by: Ben Skeggs <bskeggs at nvidia.com> --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 4 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c index eb765da0876e..35d1fcef520b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c @@ -41,8 +41,8 @@ ad102_gsp = { static struct nvkm_gsp_fwif ad102_gsps[] = { - { 1, tu102_gsp_load, &ad102_gsp, &r570_rm_ga102, "570.144", true }, - { 0, tu102_gsp_load, &ad102_gsp, &r535_rm_ga102, "535.113.01", true }, + { 1, tu102_gsp_load, &ad102_gsp, &r570_rm_ga102, "570.144" }, + { 0, tu102_gsp_load, &ad102_gsp, &r535_rm_ga102, "535.113.01" }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c index 12a3f2c1ed82..1b3b31b95ce4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb100.c @@ -20,7 +20,7 @@ gb100_gsp = { static struct nvkm_gsp_fwif gb100_gsps[] = { - { 0, gh100_gsp_load, &gb100_gsp, &r570_rm_gb10x, "570.144", true }, + { 0, gh100_gsp_load, &gb100_gsp, &r570_rm_gb10x, "570.144" }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c index c1d718172ddf..51384c63148c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c @@ -20,7 +20,7 @@ gb202_gsp = { static struct nvkm_gsp_fwif gb202_gsps[] = { - { 0, gh100_gsp_load, &gb202_gsp, &r570_rm_gb20x, "570.144", true }, + { 0, gh100_gsp_load, &gb202_gsp, &r570_rm_gb20x, "570.144" }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c index ce31e8248807..b0dd5fce7bad 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gh100.c @@ -344,7 +344,7 @@ gh100_gsp_load(struct nvkm_gsp *gsp, int ver, const struct nvkm_gsp_fwif *fwif) static struct nvkm_gsp_fwif gh100_gsps[] = { - { 0, gh100_gsp_load, &gh100_gsp, &r570_rm_gh100, "570.144", true }, + { 0, gh100_gsp_load, &gh100_gsp, &r570_rm_gh100, "570.144" }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h index 4f14e85fc69e..c3494b7ac572 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/priv.h @@ -14,7 +14,6 @@ struct nvkm_gsp_fwif { const struct nvkm_gsp_func *func; const struct nvkm_rm_impl *rm; const char *ver; - bool enable; }; int nvkm_gsp_load_fw(struct nvkm_gsp *, const char *name, const char *ver, -- 2.50.1
Mel Henning
2025-Jul-21 19:09 UTC
[PATCH V2 3/3] drm/nouveau: Improve message for missing firmware
This is inteded to address concerns that users might get cryptic error messages or a failure to boot if they set nouveau.config=NvGspRm=0 on the kernel command line and their gpu requires gsp (Ada or newer). With this patch, that configuration results in error messages like this: nouveau 0000:01:00.0: gsp: Failed to load required firmware for device. nouveau 0000:01:00.0: gsp ctor failed: -22 nouveau 0000:01:00.0: probe with driver nouveau failed with error -22 When nouveau fails to load like this, we still fall back to the generic framebuffer device, so users will still have limited graphical output. Signed-off-by: Mel Henning <mhenning at darkrefraction.com> --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c index d23243a83a4c..7ccb41761066 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c @@ -138,8 +138,10 @@ nvkm_gsp_new_(const struct nvkm_gsp_fwif *fwif, struct nvkm_device *device, nvkm_subdev_ctor(&nvkm_gsp, device, type, inst, &gsp->subdev); fwif = nvkm_firmware_load(&gsp->subdev, fwif, "Gsp", gsp); - if (IS_ERR(fwif)) + if (IS_ERR(fwif)) { + nvkm_error(&gsp->subdev, "Failed to load required firmware for device."); return PTR_ERR(fwif); + } gsp->func = fwif->func; -- 2.50.1