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 EA5CD1D9A54 for ; Thu, 4 Dec 2025 16:57:00 +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=1764867423; cv=none; b=f36fozpp09X78qDAvTGgP+NhLKUVsZg4LRq656jcdx9OcNBbtmtqziq/1bq35MNy7b6DSHKc7uk4Nvlhtm0aOmFMF+cwt26hOywhWt3wYR7U2aO6jbmljY+I1yXMHYWorW3/cnP5pMWbcD/qcktmXFatxpZDNpcME7alFqjh5/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764867423; c=relaxed/simple; bh=9w60/2azP0has70GfrWIVJvKbuir+WgQ4oCk+b72fWU=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=LTfP3oaWl4dUuLMVFZddduyFHVah73czGurGbroTUbsuVjbnvRVXQsjgmz4qEjQ7le2fuOVc1athpOLgOWOK63ie2Gbm0U1hFt1VhodplZSTNFyWsOUtAhM6sI9v7yu05ITtyBTsapzDN/9X8n+IgI/Xx5OHQhiHrNPErm5tNS4= 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 E3B67339; Thu, 4 Dec 2025 08:56:52 -0800 (PST) Received: from [10.1.38.32] (e122027.cambridge.arm.com [10.1.38.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 088FE3F59E; Thu, 4 Dec 2025 08:56:57 -0800 (PST) Message-ID: Date: Thu, 4 Dec 2025 16:56:55 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/panthor: fix for dma-fence safe access rules To: Chia-I Wu , Boris Brezillon , Liviu Dudau , 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 References: <20251204015034.841235-1-olvaffe@gmail.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20251204015034.841235-1-olvaffe@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/12/2025 01:50, 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: Steven Price > --- > 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]); >