From: Ben Skeggs <bskeggs@nvidia.com>
To: <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] nouveau/fence: handle cross device fences properly.
Date: Tue, 7 Jan 2025 16:16:36 +1000 [thread overview]
Message-ID: <dcc9d9d0-a5df-4252-ab6c-885e957f8bac@nvidia.com> (raw)
In-Reply-To: <20250107055846.536589-1-airlied@gmail.com>
On 7/1/25 15:58, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> If we have two nouveau controlled devices and one passes a dma-fence
> to the other, when we hit the sync path it can cause the second device
> to try and put a sync wait in it's pushbuf for the seqno of the context
> on the first device.
>
> Since fence contexts are vmm bound, check the if vmm's match between
> both users, this should ensure that fence seqnos don't get used wrongly
> on incorrect channels.
>
> This seems to happen fairly spuriously and I found it tracking down
> a multi-card regression report, that seems to work by luck before this.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> Cc: stable@vger.kernel.org
Reviewed-by: Ben Skeggs <bskeggs@nvidia.com>
> ---
> drivers/gpu/drm/nouveau/nouveau_fence.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
> index ee5e9d40c166f..5743c82f4094b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_fence.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
> @@ -370,7 +370,8 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan,
>
> rcu_read_lock();
> prev = rcu_dereference(f->channel);
> - if (prev && (prev == chan ||
> + if (prev && (prev->vmm == chan->vmm) &&
> + (prev == chan ||
> fctx->sync(f, prev, chan) == 0))
> must_wait = false;
> rcu_read_unlock();
next prev parent reply other threads:[~2025-01-07 6:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 5:58 [PATCH] nouveau/fence: handle cross device fences properly Dave Airlie
2025-01-07 6:16 ` Ben Skeggs [this message]
2025-01-07 16:02 ` Danilo Krummrich
2025-01-08 1:04 ` Dave Airlie
2025-01-08 7:39 ` Danilo Krummrich
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=dcc9d9d0-a5df-4252-ab6c-885e957f8bac@nvidia.com \
--to=bskeggs@nvidia.com \
--cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox