All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Dave Airlie <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: Re: [PATCH] nouveau: fw: sync dma after setup is called.
Date: Mon, 25 Nov 2024 17:55:50 +0100	[thread overview]
Message-ID: <f4e39af3-ada1-4bbd-ade1-90bfaf3899da@kernel.org> (raw)
In-Reply-To: <20241114004603.3095485-1-airlied@gmail.com>

On 11/14/24 1:46 AM, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> When this code moved to non-coherent allocator the sync was put too
> early for some firmwares which called the setup function, move the
> sync down after the setup function.
> 
> Reported-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>

Do you have a link of where this issue has been reported?

> Tested-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
> Fixes: 9b340aeb26d5 ("nouveau/firmware: use dma non-coherent allocator")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>   drivers/gpu/drm/nouveau/nvkm/falcon/fw.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/fw.c b/drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
> index a1c8545f1249..cac6d64ab67d 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
> @@ -89,11 +89,6 @@ nvkm_falcon_fw_boot(struct nvkm_falcon_fw *fw, struct nvkm_subdev *user,
>   		nvkm_falcon_fw_dtor_sigs(fw);
>   	}
>   
> -	/* after last write to the img, sync dma mappings */
> -	dma_sync_single_for_device(fw->fw.device->dev,
> -				   fw->fw.phys,
> -				   sg_dma_len(&fw->fw.mem.sgl),
> -				   DMA_TO_DEVICE);
>   
>   	FLCNFW_DBG(fw, "resetting");
>   	fw->func->reset(fw);
> @@ -105,6 +100,12 @@ nvkm_falcon_fw_boot(struct nvkm_falcon_fw *fw, struct nvkm_subdev *user,
>   			goto done;
>   	}
>   
> +	/* after last write to the img, sync dma mappings */
> +	dma_sync_single_for_device(fw->fw.device->dev,
> +				   fw->fw.phys,
> +				   sg_dma_len(&fw->fw.mem.sgl),
> +				   DMA_TO_DEVICE);
> +
>   	ret = fw->func->load(fw);
>   	if (ret)
>   		goto done;


      parent reply	other threads:[~2024-11-25 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14  0:46 [PATCH] nouveau: fw: sync dma after setup is called Dave Airlie
2024-11-14  1:10 ` Ben Skeggs
2024-11-25 16:55 ` Danilo Krummrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4e39af3-ada1-4bbd-ade1-90bfaf3899da@kernel.org \
    --to=dakr@kernel.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.