[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <63d280ed-ea7e-483d-8f64-5066174adf0e@amd.com>
Date: Thu, 20 Nov 2025 14:22:28 +0100
From: Christian König <christian.koenig@....com>
To: Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
intel-xe@...ts.freedesktop.org
Cc: Matthew Auld <matthew.auld@...el.com>,
Matthew Brost <matthew.brost@...el.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Waiman Long <longman@...hat.com>, Sumit Semwal <sumit.semwal@...aro.org>,
LKML <linux-kernel@...r.kernel.org>, dri-devel@...ts.freedesktop.org,
linaro-mm-sig@...ts.linaro.org,
"Pelloux-Prayer, Pierre-Eric" <Pierre-eric.Pelloux-prayer@....com>
Subject: Re: [RFC PATCH 2/2] dma-buf/dma-resv: Improve the dma-resv lockdep
checks
On 11/20/25 12:03, Thomas Hellström wrote:
> Ensure that dma_resv_held() and dma_resv_assert_held() operate
> on individual reservation objects within a WW transaction rather
> than on the reservation WW class.
>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@...ux.intel.com>
I can't judge the lockdep backend changes, but this patch here makes a lot of sense.
Reviewed-by: Christian König <christian.koenig@....com>
That reminds me that Pierre-Eric stumbled over some odd lockdep behavior while working on TTM as well. @Pierre-Eric what that this issue?
Regards,
Christian.
> ---
> include/linux/dma-resv.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h
> index c5ab6fd9ebe8..001de3880fde 100644
> --- a/include/linux/dma-resv.h
> +++ b/include/linux/dma-resv.h
> @@ -308,8 +308,11 @@ static inline bool dma_resv_iter_is_restarted(struct dma_resv_iter *cursor)
> fence = dma_resv_iter_first(cursor); fence; \
> fence = dma_resv_iter_next(cursor))
>
> -#define dma_resv_held(obj) lockdep_is_held(&(obj)->lock.base)
> -#define dma_resv_assert_held(obj) lockdep_assert_held(&(obj)->lock.base)
> +#define dma_resv_held(obj) (lockdep_is_held(&(obj)->lock.base) && ww_mutex_held(&(obj)->lock))
> +#define dma_resv_assert_held(obj) do { \
> + lockdep_assert_held(&(obj)->lock.base); \
> + ww_mutex_assert_held(&(obj)->lock); \
> + } while (0)
>
> #ifdef CONFIG_DEBUG_MUTEXES
> void dma_resv_reset_max_fences(struct dma_resv *obj);
Powered by blists - more mailing lists