From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6F11314B6C for ; Thu, 4 Dec 2025 09:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764840341; cv=none; b=mDEBVPvUl/V8kyBm8ZxcDSspqM0zX1m43cdFif5+t8SDwz9T1720zKG2b2L3wFFoVNKuNF3pFi2wm4M5x5rskTRUO+o5T34rwH/I5E52W3sm/RfGqYKH6oYgztZ9B7fFdgW0+hwaQlqUXOxy/KB8A2sUOpkgHg8Aba9Sc2ii8y4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764840341; c=relaxed/simple; bh=zVQ6JZXiKEUcd0BaAqY9WHHVRjlMqAETjaFSgy911z0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TzwW2XA2gcuzoGGqu8RIsxekLUjamzJJwqmA8smnkuD1+azpz05p4JFYgVkozy7WeaqnuPhuk4nb8bX8+Xnk8qajjBtT1yoUBExXHqYcM4N3pBO8lYR9jkxe6Fodn31ZQmZ2f9+ga6nDFDxqkNwC+MHWkfVq2m43TTYr9kDQA60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D23F8339 for ; Thu, 4 Dec 2025 01:25:31 -0800 (PST) Received: from [10.2.10.34] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EDE5E3F59E for ; Thu, 4 Dec 2025 01:25:38 -0800 (PST) Date: Thu, 4 Dec 2025 09:25:10 +0000 From: Liviu Dudau To: Chia-I Wu Cc: Boris Brezillon , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Grant Likely , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tvrtko.ursulin@igalia.com Subject: Re: [PATCH] drm/panthor: fix for dma-fence safe access rules Message-ID: References: <20251204015034.841235-1-olvaffe@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251204015034.841235-1-olvaffe@gmail.com> On Wed, Dec 03, 2025 at 05:50:34PM -0800, Chia-I Wu wrote: > Commit 506aa8b02a8d6 ("dma-fence: Add safe access helpers and document > the rules") details the dma-fence safe access rules. The most common > culprit is that drm_sched_fence_get_timeline_name may race with > group_free_queue. > > Fixes: d2624d90a0b77 ("drm/panthor: assign unique names to queues") > Signed-off-by: Chia-I Wu Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_sched.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index 33b9ef537e359..a8b1347e4da71 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include "panthor_devfreq.h" > #include "panthor_device.h" > @@ -923,6 +924,9 @@ static void group_release_work(struct work_struct *work) > release_work); > u32 i; > > + /* dma-fences may still be accessing group->queues under rcu lock. */ > + synchronize_rcu(); > + > for (i = 0; i < group->queue_count; i++) > group_free_queue(group, group->queues[i]); > > -- > 2.52.0.177.g9f829587af-goog >