[PATCH] drm/nouveau: remove unused memory target test

Zhi Wang zhiw at nvidia.com
Thu Jul 17 08:09:24 UTC 2025


On Tue, 15 Jul 2025 16:05:59 -0500
Timur Tabi <ttabi at nvidia.com> wrote:

There is also a similar code block in this function:

        if (fw->inst) {
                nvkm_falcon_mask(falcon, 0x048, 0x00000001, 0x00000001);

                switch (nvkm_memory_target(fw->inst)) {
                case NVKM_MEM_TARGET_VRAM: target = 0; break;
                case NVKM_MEM_TARGET_HOST: target = 2; break;
                case NVKM_MEM_TARGET_NCOH: target = 3; break;
                default:
                        WARN_ON(1);
                        return -EINVAL;
                }

Should this be removed with the same purpose here?

Z.

> The memory target check is a hold-over from a refactor.  It's harmless
> but distracting, so just remove it.
> 
> Signed-off-by: Timur Tabi <ttabi at nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
> b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c index
> b7da3ab44c27..f0acfaa153d1 100644 ---
> a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c +++
> b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c @@ -249,9 +249,11 @@ int
>  gm200_flcn_fw_load(struct nvkm_falcon_fw *fw)
>  {
>  	struct nvkm_falcon *falcon = fw->falcon;
> -	int target, ret;
> +	int ret;
>  
>  	if (fw->inst) {
> +		int target;
> +
>  		nvkm_falcon_mask(falcon, 0x048, 0x00000001,
> 0x00000001); 
>  		switch (nvkm_memory_target(fw->inst)) {
> @@ -285,15 +287,6 @@ gm200_flcn_fw_load(struct nvkm_falcon_fw *fw)
>  	}
>  
>  	if (fw->boot) {
> -		switch (nvkm_memory_target(&fw->fw.mem.memory)) {
> -		case NVKM_MEM_TARGET_VRAM: target = 4; break;
> -		case NVKM_MEM_TARGET_HOST: target = 5; break;
> -		case NVKM_MEM_TARGET_NCOH: target = 6; break;
> -		default:
> -			WARN_ON(1);
> -			return -EINVAL;
> -		}
> -
>  		ret = nvkm_falcon_pio_wr(falcon, fw->boot, 0, 0,
>  					 IMEM, falcon->code.limit -
> fw->boot_size, fw->boot_size, fw->boot_addr >> 8, false);
> 
> base-commit: 155a3c003e555a7300d156a5252c004c392ec6b0



More information about the Nouveau mailing list