From: Matthew Auld <matthew.auld@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v5 28/36] drm/xe: Lock the bo in xe_bo_dma_unmap_pinned()
Date: Thu, 3 Dec 2026 16:18:45 +0000 [thread overview]
Message-ID: <0dcdb524-1e3f-4119-a825-e58abd46cc28@intel.com> (raw)
In-Reply-To: <20261202233323.3743190-29-matthew.brost@intel.com>
On 02/12/2026 23:33, Matthew Brost wrote:
> xe_bo_apply_to_pinned() drops xe->pinned.lock before invoking the
> callback with only a bo reference held. Unlike the other pinned
> callbacks, xe_bo_dma_unmap_pinned() does not take the bo's dma-resv lock,
> so on device removal it can race with an importer unpinning an exported
> bo (xe_bo_unpin_external()) followed by an eviction that unmaps the same
> tt, resulting in a double DMA unmap and sg table free. The imported-bo
> branch also calls dma_buf_unmap_sgt(), which asserts that the dma-resv
> lock is held.
>
> Take the bo lock around the unmap.
>
> Fixes: 3cbb651117ff ("drm/xe/bo: Add a bo remove callback")
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: stable@vger.kernel.org # v6.16+
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
prev parent reply other threads:[~2026-12-03 16:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261202233323.3743190-1-matthew.brost@intel.com>
2026-12-02 23:33 ` [PATCH v5 26/36] drm/xe: Don't DMA map tt pages after device unplug Matthew Brost
2026-12-02 23:33 ` [PATCH v5 27/36] drm/xe/display: Flush cleanup work on unregister Matthew Brost
2026-12-02 23:33 ` [PATCH v5 28/36] drm/xe: Lock the bo in xe_bo_dma_unmap_pinned() Matthew Brost
2026-12-03 16:18 ` Matthew Auld [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=0dcdb524-1e3f-4119-a825-e58abd46cc28@intel.com \
--to=matthew.auld@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=stable@vger.kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
/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