From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7764CE9A02C for ; Wed, 18 Feb 2026 22:22:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF81B10E630; Wed, 18 Feb 2026 22:22:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="vPX4atLZ"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id D981A10E323 for ; Wed, 18 Feb 2026 22:22:13 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 5A79E61858; Wed, 18 Feb 2026 22:22:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA34FC116D0; Wed, 18 Feb 2026 22:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771453333; bh=6MIqgY4UQrceA2s9yZ6szCOXqUxXrfrLCpqE1Gg3myk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vPX4atLZTSW93kyNyMIi+fG3N9D0EjyclpzEMVtLRoowsgTf/FrN+hf1c4+VmKLEN /w7aucS3uAtnHcbabrTiosuFLWg1zBWtLxyNzrG3CuubJULpWf7RVsJ7JJodhVQV/V U/JLAqRTOtRXKoOYIRrGy2uEtum7SZm6EpW10UGCf16wfUhErEuh4A8rLl6hqbbeKB eJPHUeHfctSsWt/HdTINKbesNhAM8inNAsVUceXmyVCCqkVMILIJ0EjlwDjHvLeVYD 8ltTE3uNyMw3C8aSdkyZk1p0ErZQIrkXtG8H0nKSj9yh2fDUsRZ53NBAkwZuHi1qDF bIPo83l08a8NQ== From: "Rob Herring (Arm)" Date: Wed, 18 Feb 2026 16:21:56 -0600 Subject: [PATCH 2/3] accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260218-ethos-fixes-v1-2-be3fa3ea9a30@kernel.org> References: <20260218-ethos-fixes-v1-0-be3fa3ea9a30@kernel.org> In-Reply-To: <20260218-ethos-fixes-v1-0-be3fa3ea9a30@kernel.org> To: Tomeu Vizoso , Anders Roxell , Oded Gabbay , Thomas Zimmermann , Frank Li Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.15-dev X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The NPU_OP_ELEMENTWISE instruction uses a scalar value for IFM2 if the IFM2_BROADCAST "scalar" mode is set. It is a bit (7) on the u65 and part of a field (bits 3:0) on the u85. The driver was hardcoded to the u85. Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver") Signed-off-by: Rob Herring (Arm) --- drivers/accel/ethosu/ethosu_gem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 473b5f5d7514..a735f860a119 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -417,7 +417,10 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, return ret; break; case NPU_OP_ELEMENTWISE: - use_ifm2 = !((st.ifm2.broadcast == 8) || (param == 5) || + use_scale = ethosu_is_u65(edev) ? + (st.ifm2.broadcast & 0x80) : + (st.ifm2.broadcast == 8); + use_ifm2 = !(use_scale || (param == 5) || (param == 6) || (param == 7) || (param == 0x24)); use_ifm = st.ifm.broadcast != 8; ret = calc_sizes_elemwise(ddev, info, cmd, &st, use_ifm, use_ifm2); -- 2.51.0