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 F0672309F1A for ; Thu, 2 Oct 2025 10:41:33 +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=1759401696; cv=none; b=L08k00JevPwiETTCPRkVKGvZ3/07T09nFpmT/kmG/QIua37yKQ/LpaOYIlo7DfylwMVPenK72WRymSDxdTpUvcqdvNT5GCzmDAZoqee8bVYljnH61guRf31CE4/uHU90Zyxgk5VPT1xFLLj63LDk0AyuV4dcXaSI8gnrk+K3cP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759401696; c=relaxed/simple; bh=+AxQ8anefbXoNuXw2l3Z5V7SE92CcACHbej+9Z8A6V4=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=ZtFJk1ZvEtfoaMb/QtQxbgbacCBlrr2F2FVG0OZfWGQitMMrLQG09hNS6NuRDqTQ6UFWPJ9f12Q6KJvTt9BHqX9P9J+AsRI9T6U1Gbgua+W7OUsjd0qsDJMPNYYBY/locytunaSfGyilhcMpmRvhPx3W8ouXpXsEo8pip+sK/g8= 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 E7A861692; Thu, 2 Oct 2025 03:41:24 -0700 (PDT) Received: from [10.57.2.240] (unknown [10.57.2.240]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FB953F66E; Thu, 2 Oct 2025 03:41:30 -0700 (PDT) Message-ID: Date: Thu, 2 Oct 2025 11:41:28 +0100 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 02/10] drm/panthor: rename and document lock_region 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 References: <20250916210823.4033529-1-olvaffe@gmail.com> <20250916210823.4033529-3-olvaffe@gmail.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20250916210823.4033529-3-olvaffe@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/09/2025 22:08, Chia-I Wu wrote: > Rename lock_region to mmu_hw_cmd_lock. > > Signed-off-by: Chia-I Wu > --- > drivers/gpu/drm/panthor/panthor_mmu.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > index d3af4f79012b4..8600d98842345 100644 > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > @@ -545,8 +545,17 @@ static int write_cmd(struct panthor_device *ptdev, u32 as_nr, u32 cmd) > return status; > } > > -static void lock_region(struct panthor_device *ptdev, u32 as_nr, > - u64 region_start, u64 size) > +/** > + * mmu_hw_cmd_lock() - Issue a LOCK command > + * @ptdev: Device. > + * @as_nr: AS to issue command to. > + * @region_start: Start of the region. > + * @size: Size of the region. > + * > + * Issue a LOCK command to invalidate MMU caches and block future transactions > + * for a region. The LOCK command doesn't invalidate the caches - that's the UNLOCK command. LOCK just blocks any memory accesses that target the region. [I guess the hardware implementation might flush TLBs to achieve the block, but that's an implementation detail and shouldn't be relied upon]. I'm also not entirely clear what the benefit of this rename is? It's a static function in a xxx_mmu.c file so it's fairly obvious this going to MMU HW related. I also feel "_region" in the name makes it obvious that there is a memory range that is affected by the lock. Thanks, Steve > + */ > +static void mmu_hw_cmd_lock(struct panthor_device *ptdev, u32 as_nr, u64 region_start, u64 size) > { > u8 region_width; > u64 region; > @@ -609,7 +618,7 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr, > * power it up > */ > > - lock_region(ptdev, as_nr, iova, size); > + mmu_hw_cmd_lock(ptdev, as_nr, iova, size); > > ret = mmu_hw_wait_ready(ptdev, as_nr); > if (ret)