From nobody Sat Oct 4 14:36:18 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 435591A314E for ; Fri, 15 Aug 2025 10:25:58 +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=1755253559; cv=none; b=Bb9tjm3D36FUVuNCvrGj6Sp+IeX3Idj6zz5zLIvDaCqTRYzW6w0GB3/0TvLSiWdeyUmp2G919bxzYq98M24NifX1zcq//Rxpp1grExnQNUyRIJ3ZeRx4Qixo6g7/FINGWpugnZDrzjvSEc6G6HUFqWqRuohzwOhXiJaV4r0mI2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755253559; c=relaxed/simple; bh=WsbGjxyxR1NecPxWrz4TfjE2ShUDhJJFUUS7X4n8iok=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YMbgXMqk3h0u8ILRaXsA/ONN0oLq0t6Baathi+8zyQoBjBJ/dw09LNnRVdeuQZIAE+yIQWAARtI6aYODO4T8QIzhLzNk7E5Wd2OdSos/EoMAMavb03Vx/9Ux7m8IlQKZ6QL2NccuBWKV2l488Y8sfXK7tF74etnEcSJAndq9y6o= 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 5A0511691; Fri, 15 Aug 2025 03:25:49 -0700 (PDT) Received: from e122027.cambridge.arm.com (e122027.cambridge.arm.com [10.1.29.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 155723F738; Fri, 15 Aug 2025 03:25:55 -0700 (PDT) From: Steven Price To: Boris Brezillon , Liviu Dudau , Daniel Stone Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Karunika Choo , Chia-I Wu , Steven Price Subject: [PATCH] drm/panthor: Remove dead code in mmu_hw_do_operation_locked Date: Fri, 15 Aug 2025 11:25:39 +0100 Message-ID: <20250815102539.39711-1-steven.price@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The only callers to mmu_hw_do_operation_locked() pass an 'op' of either AS_COMAND_FLUSH_MEM or AS_COMMAND_FLUSH_PT. So remove the code paths that test for other operations and add a drm_WARN_ON() to catch the posibility of others appearing the future. Suggested-by: Daniel Stone Signed-off-by: Steven Price --- drivers/gpu/drm/panthor/panthor_mmu.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/pantho= r/panthor_mmu.c index 367c89aca558..b16f44aec725 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -612,17 +612,12 @@ static int mmu_hw_do_operation_locked(struct panthor_= device *ptdev, int as_nr, * power it up */ =20 - if (op !=3D AS_COMMAND_UNLOCK) - lock_region(ptdev, as_nr, iova, size); + drm_WARN_ON(&ptdev->base, + op !=3D AS_COMMAND_FLUSH_MEM && op !=3D AS_COMMAND_FLUSH_PT); =20 - if (op =3D=3D AS_COMMAND_FLUSH_MEM || op =3D=3D AS_COMMAND_FLUSH_PT) - return mmu_hw_do_flush_on_gpu_ctrl(ptdev, as_nr, op); + lock_region(ptdev, as_nr, iova, size); =20 - /* Run the MMU operation */ - write_cmd(ptdev, as_nr, op); - - /* Wait for the flush to complete */ - return wait_ready(ptdev, as_nr); + return mmu_hw_do_flush_on_gpu_ctrl(ptdev, as_nr, op); } =20 static int mmu_hw_do_operation(struct panthor_vm *vm, --=20 2.39.5