From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 359FE3358BA for ; Wed, 18 Feb 2026 22:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771453333; cv=none; b=Q5pxDq4A0kvKB+vAZ961jotpXiBKrMYuN9dIMi2kfwCZkGCHLByDAcUi1xfvyZg11/MUo3cfQ754Wc5+OGls8N7pJY33jQzlQNzRSdee9aw7RIHxHDzh3g09BU2FBa83hOZzw7kPYIxK/rHY8R9TC7TwIL1WAOMykI2AIyjDlbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771453333; c=relaxed/simple; bh=6MIqgY4UQrceA2s9yZ6szCOXqUxXrfrLCpqE1Gg3myk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tIhO6PEAEjfKkELNbwfka3q2B7KI/DNlZ0gpj4SU4N3JsOnmtBW4OMQT79zHN7RFjwT+difWQLl/svWGD8wIz40kaRR1RQeHL8gvVwkyU/OSZwbzGMRldEArxwwZ2QDzLJgi9HB2GQACJ3NF6Vs6AMdxl+bghgKQyF52Rzi3YXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vPX4atLZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vPX4atLZ" 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 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-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 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