From nobody Sun Apr 5 13:07:04 2026 Received: from out-13.smtp.spacemail.com (out-13.smtp.spacemail.com [63.250.43.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0983D28CF6F for ; Tue, 17 Feb 2026 21:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.250.43.96 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771364430; cv=none; b=KRjzHcNFyzfFtSlBCoFTQD40eHUVo1BgAYzf4nACX6fbqzDAcD/JdWV5d3Yc6kUE+yePSb75QaarxrPgSK5NXqMKB0LNyDJroFf6zkI0C1ATr7tmBL3kTX23L/W/5KhE6feb22+YoORqyt0KMKc/5ouizsAobOkS7E/5meSzt4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771364430; c=relaxed/simple; bh=O8dvO9jPl5/KKxBPfvLRBDq6Xf6UbiLZvL/YK3iBv6E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=px1eQ5cFCfchJ7ZdfgE0kyxQl3/dC3NY9yg1QFwW0Tv/SQdjN9MfitmoKt+8CNwta0cgt9LtR3E5qCFbmAuDCkXwQWJYv/6+L7QKDVHHEUW6qPxPiaw9BIjyIgY5T6A+WecDdYMK0X7gOLXA3ZHioXRIY/d3+dgSY9sf/N6rOh8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=r-sc.ca; spf=pass smtp.mailfrom=r-sc.ca; dkim=pass (2048-bit key) header.d=r-sc.ca header.i=@r-sc.ca header.b=eNv5WZ30; arc=none smtp.client-ip=63.250.43.96 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=r-sc.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=r-sc.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=r-sc.ca header.i=@r-sc.ca header.b="eNv5WZ30" Received: from mac.pk.shawcable.net (S0106dceb699ec90f.pk.shawcable.net [24.69.43.232]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.spacemail.com (Postfix) with ESMTPSA id 4fFtNT5Q57z6tkL; Tue, 17 Feb 2026 21:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=r-sc.ca; s=spacemail; t=1771364427; bh=I99tBoI9TXIsELu4UV+lme4CdAPu87/8INed4CLN2Xc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eNv5WZ309Xa1dp3x4ZA8q8+PncDehOESp9osofBRzyx9aaRASOJxXC3C3SfJ0tcGL IMw9hleVIxPWBRSchSJuMAEv7uoQBCtTlygEMBY7BIvwJ2btipId7KAQMs0WOGoOfK NW25zRpzP7o8OuHIgTToNa01h2FqCEo3pkApVpfYKHxDIE9LukuY77Bh4YJQF2o/DC DeBprkYjEYSe9Ugcc0mKQLJPGvvFACdO6H22vtg8RsXKsT1aUDRQa1MS7TZVqtJKJj UkGDgY5JgHvOw3tleHPfYiVw6XscpcKHdSCegGp44sAFUSyBsqDTeEIzgL7jVQxOkK S+8e3JJkArDpA== From: Ross Cawston Date: Tue, 17 Feb 2026 13:39:52 -0800 Subject: [PATCH 4/5] accel/rocket: Skip CNA/Core S_POINTER initialization for standalone tasks 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: quoted-printable Message-Id: <20260217-accel-rocket-clean-base-v1-4-d72354325a25@r-sc.ca> References: <20260217-accel-rocket-clean-base-v1-0-d72354325a25@r-sc.ca> In-Reply-To: <20260217-accel-rocket-clean-base-v1-0-d72354325a25@r-sc.ca> To: Tomeu Vizoso , Oded Gabbay , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ross Cawston X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771364416; l=3130; i=ross@r-sc.ca; s=20260217; h=from:subject:message-id; bh=O8dvO9jPl5/KKxBPfvLRBDq6Xf6UbiLZvL/YK3iBv6E=; b=FUfnHHgYQ3mGQnnW03s2TeWiOl5l1ePobjC4leeQItxLJwGfzksgx9brJvYAl5DJ2/76Aq+AY T+UM3Hbb4U1Ct3zp8s1xBnAkYKNeCrnFbOuJRL0E8tfH05IYu/ocZS5 X-Developer-Key: i=ross@r-sc.ca; a=ed25519; pk=c50mfTDLKsgS2tlqXEZEvb/VGiLvxjsLOw5M50DxhtM= X-Envelope-From: ross@r-sc.ca Standalone DPU (element-wise) and PPU (pooling, etc.) tasks do not use the CNA or Core blocks. Writing S_POINTER to those blocks re-arms them with stale/uninitialized state, leading to corruption. Introduce ROCKET_TASK_SKIP_CNA_CORE flag (added in previous patch) so userspace can indicate such tasks. When set, skip the CNA and Core S_POINTER MMIO writes. Also move the per-core extra bit (bit 28 =C3=97 core index) inside the same conditional - it is only needed when CNA/Core are actually used. Signed-off-by: Ross Cawston --- drivers/accel/rocket/rocket_job.c | 41 +++++++++++++++++++++++++++--------= ---- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocke= t_job.c index 34898084cc56..1dcc0c945f7f 100644 --- a/drivers/accel/rocket/rocket_job.c +++ b/drivers/accel/rocket/rocket_job.c @@ -116,7 +116,6 @@ rocket_copy_tasks(struct drm_device *dev, static void rocket_job_hw_submit(struct rocket_core *core, struct rocket_j= ob *job) { struct rocket_task *task; - unsigned int extra_bit; =20 /* Don't queue the job if a reset is in progress */ if (atomic_read(&core->reset.pending)) @@ -129,17 +128,35 @@ static void rocket_job_hw_submit(struct rocket_core *= core, struct rocket_job *jo =20 rocket_pc_writel(core, BASE_ADDRESS, 0x1); =20 - /* From rknpu, in the TRM this bit is marked as reserved */ - extra_bit =3D 0x10000000 * core->index; - rocket_cna_writel(core, S_POINTER, CNA_S_POINTER_POINTER_PP_EN(1) | - CNA_S_POINTER_EXECUTER_PP_EN(1) | - CNA_S_POINTER_POINTER_PP_MODE(1) | - extra_bit); - - rocket_core_writel(core, S_POINTER, CORE_S_POINTER_POINTER_PP_EN(1) | - CORE_S_POINTER_EXECUTER_PP_EN(1) | - CORE_S_POINTER_POINTER_PP_MODE(1) | - extra_bit); + /* + * Initialize CNA and Core S_POINTER for ping-pong mode via MMIO. + * + * Each core needs a per-core extra_bit (bit 28 * core_index) which + * the TRM marks as reserved but the BSP rknpu driver sets. Without + * it, non-zero cores hang. This MUST be done via MMIO (not regcmd) + * because userspace doesn't know which core the scheduler picks. + * + * For standalone DPU/PPU tasks (element-wise ops, pooling), CNA + * and Core have no work. Writing their S_POINTERs would re-arm + * them with stale state from the previous conv task, corrupting + * the DPU/PPU output. Userspace signals this via the + * ROCKET_TASK_SKIP_CNA_CORE flag. + */ + if (!(task->flags & ROCKET_TASK_SKIP_CNA_CORE)) { + unsigned int extra_bit =3D 0x10000000 * core->index; + + rocket_cna_writel(core, S_POINTER, + CNA_S_POINTER_POINTER_PP_EN(1) | + CNA_S_POINTER_EXECUTER_PP_EN(1) | + CNA_S_POINTER_POINTER_PP_MODE(1) | + extra_bit); + + rocket_core_writel(core, S_POINTER, + CORE_S_POINTER_POINTER_PP_EN(1) | + CORE_S_POINTER_EXECUTER_PP_EN(1) | + CORE_S_POINTER_POINTER_PP_MODE(1) | + extra_bit); + } =20 rocket_pc_writel(core, BASE_ADDRESS, task->regcmd); rocket_pc_writel(core, REGISTER_AMOUNTS, --=20 2.52.0