From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 599D540F722; Wed, 12 Aug 2026 09:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527691; cv=none; b=nqysxV37KPOEYSnzQtv+bv9x+0BZDmfyBezMnXG04lf2xdKgZxwyon/OBy5DZW4ugpY1qq8rMjeQO3vkk1R+gi+QPYmL4D/vSkWJ5GYIn0LUZesqplTWp7EudD9NEMoSWaY0U0KenEjD3WkZ96GaQ/1i3STcKAIx16faq/cCm0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527691; c=relaxed/simple; bh=sPxh2z4Aoc1bi80XfRfZ93Hlae72rcQgRl+KQIh2pNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DGn8lLCx3HPhxl/MZTLNhU30twNjAV4b9i+lOtDUb5BK99ogr+9SL2Ck06gNOsUi4GwGy1dq/WVBbz0NAawydhn667GpRZb6Z7dXJ4n33SOmFI3YoNlnOxsDU3O7Fdp+EgH5S0azZNn46p0W/RwXgcxSbxycaLNN0s8YNb5GSg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=IsWCq+ym; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=SlWbMh4+; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="IsWCq+ym"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="SlWbMh4+" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailflow.stl.internal (Postfix) with ESMTP id 2B1C71300782; Wed, 12 Aug 2026 05:41:29 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Wed, 12 Aug 2026 05:41:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527689; x= 1786531289; bh=VCaIqgm5h38tS1NOZz3rf/ZGDAWT4oH6Ksw3UTozkgQ=; b=I sWCq+ymMFy+pK2BEuBRWOTYDK6S3cYII4CId3Q6heNmaoONEosZxQNoBgTKXEAUN HgnMaABF/H6GSu4KyLg21ozBAELe9hG+SC7MgsKuClZvmAvoQDOaD58wuGBicHWH 6Vet+EtGWrzTA+6mz8USO2aLcXwPVJwiY9U6amM4KThzVz7l5OnUtQYF2lV+Pi0t Teq+O19eT9AmCH4wmgMiY8lvRtKsn8wwNJ8gqt2y8o/HLgf8Eu4zgpacPFkIRv8L 1ckI7aDo8jmZks7c2UaWmj8/27saOr1fWc9G8c8YCwasLgvfaAiwTQw4lICN0m/L IvhuV9xd/3LYU2zo6VlPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527689; x=1786531289; bh=V CaIqgm5h38tS1NOZz3rf/ZGDAWT4oH6Ksw3UTozkgQ=; b=SlWbMh4+Fyxpvj2ao JQI3HOduCouojbB2io9qXxkZP1U0XBbMFudgR7kEsArZenmM7X7SjpJwXHfIUeS6 97CDjxNDJQvu/q9BCIhbjpCc/vhgbqYCmpgefMlWaEltuijyEVym4oJvOdGvTUhA Xby8hq6Trg4LSQrHKTcs1rqaEY4kP7eaJHP+PneD2EdasiqkwUZu7YJT5nRbz22m ppIp3WoqomKeMDr+Qx+HAZU17krrHrBOmPgRD4EFVjiIVjfLFZzMps2D+gTE/UAF rzopcQY1L8tbkT7moFupkm6RQSpnmONuDG+1pV4ANFojUNfCM4O8wZRJcMXHS9xL MKA9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGwgEiQ82b/vslvxu748yQUK6wPursKF8fMIVbz67wiFGHgA47PKoO/uGXMsZMxLx gFPIgLOcY7P5CngkkiK3BYsM+NSvuArVGUEmY/S//Od5HX6j19/B4vsjpf5HveubJ3pf// pWCcY4ceqdx0GtHj0WCQ0o6J65xdr5brIk0MpFgwd1OnJb0OJtZbfDBehL90KckpJx/ici /427xioY7E6zKhb2nnVrNb5/eVe38u0ELJVPMEpl79CB4mXXIS+TOXwQ2vG5Pe68Rd3XXD xmR8fAtcy04eoj5dkZNb571/YdUoGmvjFo0tW/6wl1YthjyIcmyfW3v1C+VPOybfcM4wWP Tl6eyUPtJkyhWVCvNl+hTzD/pCa6fif3pxWK/mRqkkFmLLxolhf+Kxdbw1ixKiPq0y/Pir yG0ATqMFq8iwhhw22PoynBYi4Jz5QuGzS2u6GqG5IpsMjY2Ul/3UjRWM6dpm0kptjN8ufE LmFxZDquW6bcDvBcrPjRz1GW8FIufkPaypoPzYZ/VQoWKG4V5C9ymnLZ1dOt2fBwXsftYR yYdt97+Rnh9j2F71OtmG6GS/ghqWMqYoLF6MhwZ/1k1leSVKTPYXpTsL9aToidw28llefd 2Bg3SGg/0i2IsActKoc/A2TXwpIG5jy/4OsoxGMuhsZaewW6qYlghvNvpEKg X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:41:22 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 01/10] accel/rocket: take the completion register writes under job_lock Date: Wed, 12 Aug 2026 21:40:56 +1200 Message-ID: <20260812094106.1391698-2-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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" rocket_job_handle_irq() writes OPERATION_ENABLE and INTERRUPT_CLEAR before taking job_lock, while rocket_job_hw_submit() writes OPERATION_ENABLE from inside it. The two can therefore race: a completion being handled on one co= re can write its zero after a submit on the same core has written its one, and stop a task that has only just started. Nothing in tree hits this often, because the interrupt is the only completi= on path and it does not overlap its own submit, but the ordering is wrong on i= ts own terms. Move both writes inside the existing scoped_guard() rather than adding a se= cond critical section, so stopping the block and deciding what to start next are= one atomic step. Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL") Signed-off-by: Jiaxing Hu Tested-by: Igor Paunovic # RK3588, three cores --- drivers/accel/rocket/rocket_job.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocke= t_job.c index bb77b6bf0..4c01b703e 100644 --- a/drivers/accel/rocket/rocket_job.c +++ b/drivers/accel/rocket/rocket_job.c @@ -345,10 +345,15 @@ static void rocket_job_handle_irq(struct rocket_core = *core) { pm_runtime_mark_last_busy(core->dev); =20 - rocket_pc_writel(core, OPERATION_ENABLE, 0x0); - rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff); + scoped_guard(mutex, &core->job_lock) { + /* + * Stopping the block belongs under the lock. hw_submit() writes + * OPERATION_ENABLE too, and outside the lock this zero can land + * after that one and stop a task that has only just started. + */ + rocket_pc_writel(core, OPERATION_ENABLE, 0x0); + rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff); =20 - scoped_guard(mutex, &core->job_lock) if (core->in_flight_job) { if (core->in_flight_job->next_task_idx < core->in_flight_job->task_coun= t) { rocket_job_hw_submit(core, core->in_flight_job); @@ -360,6 +365,7 @@ static void rocket_job_handle_irq(struct rocket_core *c= ore) pm_runtime_put_autosuspend(core->dev); core->in_flight_job =3D NULL; } + } } =20 static void --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 F277131F9A8; Wed, 12 Aug 2026 09:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527704; cv=none; b=NMx7Ljh8iuIEP6xcjF4Lk62cd0VgNQkFhFO6Sm6keXqItvBanpzlDMubh1CtYmaySF72fE+O21w4FXZQaetNdonIrEwDEZnoNyQQIFaJdg/y77MxiiCZH8GpW3Lvpn8oHI0BT2eJOtwF5uZ/hn/C590puaVwx9U3BMgAfk3qcn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527704; c=relaxed/simple; bh=oV4iDIMq5N3PrVLkQlF1wL5VJYlz7tVgJd6QkEBft/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZR0M5YJuTodGcGrYin6cyVjfgsq1W+7oO9xz4a7CMkGEZv+jKowXwGAdmw5SBxH/f1Wkofd867149tYCfensiprhILGBJXj9mXQJOa3ZsSMXZnDGN7/A6/60tGIpGgXyGHnGb1J900PiWff2KuTTSsonodvogv4QZ8ICU9UN6D4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=MBzgLSRS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=drX/n1sJ; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="MBzgLSRS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="drX/n1sJ" Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailflow.stl.internal (Postfix) with ESMTP id BA99F13000EE; Wed, 12 Aug 2026 05:41:41 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 12 Aug 2026 05:41:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527701; x= 1786531301; bh=fJ4g5RSUTUngB2QsAjY07V1zWb09bk9RMpH/GbhT9pQ=; b=M BzgLSRS1y6TuK2caXq89K4QPxxLDs1hTR5fsRFCvl72+2eN52V3WJz2cjTgMqC1E 20zloIzUmcqojjUsXiH18NPDQbUQi+seaZurdxvOveZKAtL2fK7wclll1eU7cNrG V2dEej6qse4AczeNLoH2CHydFVpagS1Ks9iDSadQjq5YkYkGkjNXkU4MjiCgjQne HeEYHuIs7WkNzUyqqqxLY2kZ6/RIee12CyGUb/m1KArvo1W64PcHcC9Nya7phiZ0 cTd2EKogcqImqxidpsMTdktUBk1gpIfiEUecPAfAWMFO4gWQcafhKz/aBHUbNADH CveoIfALJwU5NgBkX2yqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527701; x=1786531301; bh=f J4g5RSUTUngB2QsAjY07V1zWb09bk9RMpH/GbhT9pQ=; b=drX/n1sJnSiVbY6wc D7EQDih/4ee2njM2oTOg/wvjdcUlfv7bfcyoN7kCopa/DNt1RuG4ZcXvAF9lQJ3Y bgzRsOrmsGVFpAR0hwKRGWHm/INPVeepsj5rGnyIvj4Sogg8vEuseSmLVsM5rHoH eyMiaWFVo1wTpqX1eh8ldCpTmoc55nH3+0KTeVPLKTD+DtNEsWMGGy2YYekSaTaV 0SuiS1GQOb9T4r4r1EDC/MW9O8fmJfmpsTScXH+YyElsDgdqglgrRFusliB7JOdf m62IDLirS+ODSGkVOWcPdGCG7ify1y7TtNXgxmnBt6VIuHvbomerKy+/c+XJdsEZ AiiXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGwgEiQ82b/vslvxu748yQUK6wPursKF8fMIVbz67wiFGHgA47PKoO/uGXMsZMxLx gFPIgLOcY7P5CngkkiK3BYsM+NSvuArVGUEmY/S//Od5HX6j19/B4vsjpf5HveubJ3pf// pWCcY4ceqdx0GtHj0WCQ0o6J65xdr5brIk0MpFgwd1OnJb0OJtZbfDBehL90KckpJx/ici /427xioY7E6zKhb2nnVrNb5/eVe38u0ELJVPMEpl79CB4mXXIS+TOXwQ2vG5Pe68Rd3XXD xmR8fAtcy04eoj5dkZNb571/YdUoGmvjFo0tW/6wl1YthjyIcmyfW3v1C+VPOybfcM4wjT LdKEcIcF2B4kK5cHnWkC6BcCPZkRlcxU1SnK3gGEFLmBy+1dCJosAA/1B3dootFu4uq2Pc 2tgkxqQS1xPyK7tyueuXMOwRxZEmJFBPsnxUsaEHHrJtfJMut/KeZjRNgplY4cj9VQTG2Y gTDDaRdLMAqBdVS2dNx0JCkhvyDeYiqWzNEkTjCnbhlu+0vnjEV+FvHpd5K2WjCAafNhhF DT7ZQknnOWNdLGqp22kfujsYF6zIoD0B3dKq9sBx7rf9hdaVNfzkLfuXKN5FXMdWQ+6eC/ usJr/JoRKMJe3HByv/v/2ijXD7pzWfPiXpHQWiI1Vr2HUj9Ijr2e2BAN5I9A X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:41:32 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 02/10] dt-bindings: npu: rockchip: add rockchip,rk3576-rknn-core Date: Wed, 12 Aug 2026 21:40:57 +1200 Message-ID: <20260812094106.1391698-3-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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 RK3576 NPU has two cores of the same RKNN block the RK3588 binding already describes, but it wires them up differently: two extra CBUF clocks, two power domains per core, and a single reset instead of two. It also has no NPU SRAM supply. Widen the property ranges to cover both, then pin each SoC back to its own shape in allOf so nothing loosens for RK3588, and keep sram-supply required for rockchip,rk3588-rknn-core only. Signed-off-by: Jiaxing Hu Reviewed-by: Krzysztof Kozlowski --- .../npu/rockchip,rk3588-rknn-core.yaml | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-cor= e.yaml b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.ya= ml index caca2a490..3b611b64c 100644 --- a/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml +++ b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml @@ -21,6 +21,7 @@ properties: =20 compatible: enum: + - rockchip,rk3576-rknn-core - rockchip,rk3588-rknn-core =20 reg: @@ -33,14 +34,18 @@ properties: - const: core # Main NPU core processing unit registers =20 clocks: - maxItems: 4 + minItems: 4 + maxItems: 6 =20 clock-names: + minItems: 4 items: - const: aclk - const: hclk - const: npu - const: pclk + - const: aclk_cbuf + - const: hclk_cbuf =20 interrupts: maxItems: 1 @@ -51,12 +56,15 @@ properties: npu-supply: true =20 power-domains: - maxItems: 1 + minItems: 1 + maxItems: 2 =20 resets: + minItems: 1 maxItems: 2 =20 reset-names: + minItems: 1 items: - const: srst_a - const: srst_h @@ -75,7 +83,40 @@ required: - resets - reset-names - npu-supply - - sram-supply + +allOf: + - if: + properties: + compatible: + contains: + const: rockchip,rk3588-rknn-core + then: + properties: + clocks: + maxItems: 4 + clock-names: + maxItems: 4 + power-domains: + maxItems: 1 + resets: + minItems: 2 + reset-names: + minItems: 2 + required: + - sram-supply + else: + properties: + clocks: + minItems: 6 + clock-names: + minItems: 6 + power-domains: + minItems: 2 + resets: + maxItems: 1 + reset-names: + maxItems: 1 + sram-supply: false =20 additionalProperties: false =20 --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 BCBD240F729; Wed, 12 Aug 2026 09:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527715; cv=none; b=kolHq21ssIWdaxALmkWJGVpzOGfLiAoOf4/ks8Z4see634xN8ScFRScUVpDnO9iI490EwqXaQrZMxPABws05sx1QxiV16DzMh8p7UwctKvlcF3Vu/flgPHu8SB+z+WzM8pWn2yyZ10OQZ9mvOD6WGb/KhfH1xyc3zc6v5FNeuYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527715; c=relaxed/simple; bh=49LsQG+QjElX2eCbzDnse345n7kq+FWFX7y+e2sBLqU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g9U/zwxZBb+tJtmX5pHV/FvVePH0UUdeonrgN7mskyt0ZGsrBinmbLKmJMuuPldJyVlVaay1R2P/LZUPS8LK+iuaLKNXJDFsDMYjksrSHxC7Yk/r/tnPSRulCK27gM1/7c9jPUQ+Em727I5QhGJhFN9g8kcpM5C8LQ/me/+fNd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=h99nZ9zC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AHuCavRI; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="h99nZ9zC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AHuCavRI" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailflow.stl.internal (Postfix) with ESMTP id 7D37613000EE; Wed, 12 Aug 2026 05:41:52 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 12 Aug 2026 05:41:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527712; x= 1786531312; bh=AnRpSSR1MsqH9LAlQncz/jaOzpH1LWDcFn32HaGkRrs=; b=h 99nZ9zCNnETKl6ckCI+8GXjDNdnaxcOSu137Jh4E3vpPvXdhpiwpROpB/6A1kCMM HO50IQknxuR3oGsv1kg+FHISFPWBx3J97Qk7kfEVWo5DubJnFaPlsR6uXunwc8bi WAiT+n4XAdlZ8N1kkRX8RrR3TCMF/+FflxpukvoQVcfwTP9dHMsgfr+iLM4MRotg EWrM8BG10FnuQCH4rc2C7X1eMZIrDxSPBWjyaq9YZxZ5YL2iOSOq2FVU6VFGPPkl NPvdlXDvuZBFS4zWuL+/GwLQB91SoyAlrAur0hZZ5oiKI8Ul+HzbtHEOddubzasV WqYtkY9/X3dgRjTYD2jOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527712; x=1786531312; bh=A nRpSSR1MsqH9LAlQncz/jaOzpH1LWDcFn32HaGkRrs=; b=AHuCavRIV5fUOeM9i bxrW4gzbSIF1EMY54Hm8/38F7Wf98M/4/8+C8RA/m8a8UHN3w2M0oqAdE9+5efGj FWLh+zQhbocTqnZUC8T58XgtKbxuM5FuiqRRS8by803jIcizqbTLpkE+Zjs2dqxX T0UhQkNy7RLeda39tydctiu5leYREwXHSZIXnhH004fwpQSzLqRaSknPpeUyW1en M8oYN8Xfeo+GKv9JUEdgg736vnuRE9Q17zLIrpvn0oWVi67IqShEWQIhE9Bw/QHz foAKizwGa2ghu7RjMOyUjeVsiGudLVCfYYO6pVY/Il9qxr5RpcmJMNHJxx2Z7gc5 82bFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGwgEiQ82b/vslvxu748yQUK6wPursKF8fMIVbz67wiFGHgA47PKoO/uGXMsZMxLx gFPIgLOcY7P5CngkkiK3BYsM+NSvuArVGUEmY/S//Od5HX6j19/B4vsjpf5HveubJ3pf// pWCcY4ceqdx0GtHj0WCQ0o6J65xdr5brIk0MpFgwd1OnJb0OJtZbfDBehL90KckpJx/ici /427xioY7E6zKhb2nnVrNb5/eVe38u0ELJVPMEpl79CB4mXXIS+TOXwQ2vG5Pe68Rd3XXD xmR8fAtcy04eoj5dkZNb571/YdUoGmvjFo0tW/6wl1YthjyIcmyfW3v1C+VPOybfcM4weR wvHqR8eqTQsScu5/IIiyIBfpTWpXEAzxmfRiiXFihpCyhjxA52ECtPMO1Sx0d+Nwu4rFMO DarZyQhwhA4CrAV0a8k/h7ZKBHZYlCbIPgzl0YoLlqwZKJQOykbspoIwRU2+YPxa1eHCTZ 5DsBZ9/6G2IjHrqPmLht9bm6qLFUU9Ff32QDxGWdeDg0zERa9SswppTTC2ltcEDJ5Ba5Tv KOFGZtuyAtKPuFX/ttw+me/fCXy+/0seTizHfM1lI2/0L058DD0ju2JWH+VT8CRIQneqEV c32LjCJEMl8jX3l3/qe3V14LOKzo+2ktbiFSdFAk7w81DjGK/dj7y+tSh/Og X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:41:44 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 03/10] dt-bindings: power: rockchip: allow resets in a power domain node Date: Wed, 12 Aug 2026 21:40:58 +1200 Message-ID: <20260812094106.1391698-4-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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" Some domains do not come up in a usable state on their own and need their resets cycled once power is on. The RK3576 NPU domains are one case: without it the first access after power-on takes an async SError. pd-node has no resets property and every nesting level is unevaluatedProperties: false, so describing that in DT is rejected today. Add it alongside clocks. Signed-off-by: Jiaxing Hu --- .../bindings/power/rockchip,power-controller.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/power/rockchip,power-control= ler.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controlle= r.yaml index b41db576f..f23c1a118 100644 --- a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml @@ -136,6 +136,14 @@ $defs: A number of phandles to clocks that need to be enabled while power domain switches state. =20 + resets: + minItems: 1 + maxItems: 30 + description: | + A number of phandles to resets that need to be cycled once the p= ower + domain has been switched on, for domains whose logic does not co= me up + in a usable state by itself. + domain-supply: description: domain regulator supply. =20 --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 04CD140927A; Wed, 12 Aug 2026 09:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527725; cv=none; b=eotK6fMO58IRrWrtrDE1s2Yx7NbRfTSMDjIhIuvqfUkBBO0aY/5UoZUAHDYN8wuBg+sYf63sBBBIaKlLhKF72VIdoabm8EG8tAkQ6BWXDShPCUN2XuHpaSy7en37+jEIk8XVeQhHIijU9fwRkwRDjftg5AWEN5eOgt0RhGw2Aq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527725; c=relaxed/simple; bh=Df5AHuktF9fz7Jm/CYNfDKMnRCGULu7pvSBW6EFPH5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NINGsjNCT+8u6GgxlE/wsnfyYsOZ0hXO5BTfp9yrmqxSIHoZ4pQEF4CTPJx8dK7iiHMn7tcMsIo+0EF5sMqtqPWqVZspieWPTuT82MOwwUkwF+RxYnx6SECDSz6v5f4Jc3RCEC6Pj+0oWXSl+FIDF/CogH/29i8zwmgX8RbE0Ys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=lais61UW; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fRYs+Ls+; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="lais61UW"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fRYs+Ls+" Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailflow.stl.internal (Postfix) with ESMTP id D202D13000EE; Wed, 12 Aug 2026 05:42:02 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 12 Aug 2026 05:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527722; x= 1786531322; bh=dz4911OQ/U9WwE2DmYwJp/fanXix6/EOPELe//q1LB4=; b=l ais61UWwaCLyylBkSoQphf/cIqF2NPA99s2v7ku1itX2K2YMEqHDsMypyC6WA7Zd Jn3cFOeyiWyyuRjqcfGCiK0X2J6uo3TgmBDjVXCfRbGjP6tunzIPylavKGJLarjq fWQC3TniAdbYGijiV07CavkkwtHLuH//H7oZelPq0yqzP7lW1+FJy1hZVsBfXzT3 FWtNoTUAYtprmjIGjZSxjC39WZOpNPrC7xolDMaS0B6r1ayB0dUPMPGYMrMXZRiS ch9WC4v5xgV+stzsA+SEmo9CJKG+STSVHSwNEDlypSbWbavShVi1iLDnL0VjbE6Z g5QkbqjLoPs6xJyXgppMQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527722; x=1786531322; bh=d z4911OQ/U9WwE2DmYwJp/fanXix6/EOPELe//q1LB4=; b=fRYs+Ls+wOVhBcsVq env/uVeeU2m/oj9gXTWhu7Uc7xO4SnQmW3IVkYr3qEId5kbewhdSXb9NFsotmjVc xzv3IYhmf3UfaWiXdwET22tx1HjRGstoNbtB5F5AC+cKXjiLAMkQiMDp9J6sUjLK UnmBF2+EDB7nm3iBySvjzBwvNGpfSyJ7KnnUy0AySs1KHLE1gpDHBtinYH8VF6G9 qxyaEwgIL8WZjuyq/OD+L1IeQvs7A+eLwtxX4pbVYnWArPuUkqcVcJPjVU4WezNv aUMdUbx0Cowno1F2JH/WsE+i0O+ZdqEjImIWuXg+2e+EMYzRZAFe+E4i0+J27Ugt vy2+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEYvpdseLajXWUr1gL0M738NU2iCql6I+cfa9FIs4o2b1w02bNCHerinoxzaTZtlB i3JmzYV7kDt82Fjkba304pAgMI6zthPVMj0KUas/ulgVDYM2ahl8MOoZQikFukOGelpnnl H5n0QN2jPNupPSzuU2pHQwuSAw2W7/32UZkPSSDDRERO+Kgv9afvOYwY9PmVH9gTM6PDK/ r2at23GMPp04dCk/KJj96WqbecHo8PaDJ9uhhz+jK/nMwkSI3Qgvli1PV4tKoqDCBQ/sVQ j/Qmeb1L+0vgs4Mo+TbQvDHYr71jJj44D4q7FcqCoxvk0BZ7a/N2iqA0aeAAvAiMbFRDFt yhegdjWM8HklAQUH3C/7BCaoVxoGr2prZm1ciKyuGUS8a+4AoeACDjscO6tll7GLwSxNs9 5AUEK1ssZJNKas4lRVzk5nJSfiwtJa0uLf/TAnQc+b1p3imMsz19pswppsK451u3kkTq86 XWhmo8GFqshY9v7NbQ08mCy2+7vKrnhZR40kj+TG0HlwxiFJDZNkncI15itMFjgYWa7ccw fAJvXc39abNylyupLmHwggKJgZagDnZgUJo7b5NtMLxFWIxQgHRy4vofCg7FUllENvnJPa 4t4zHbseMTD8Xjg3/AtmrI4m4vxn3GtMAWbj7/1box0OAH2E7LOBI5Mj6uTQ X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:41:55 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 04/10] dt-bindings: iommu: rockchip: allow the RK3576 NPU MMU clock set Date: Wed, 12 Aug 2026 21:40:59 +1200 Message-ID: <20260812094106.1391698-5-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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 RK3576 NPU MMUs need more than aclk and iface. With only those two enabled the MMU accepts reads but silently drops register writes: a DTE_ADDR value written from the power domain, while the domain clocks are still on, reads back correctly, and the write rk_iommu_resume() does microseconds later does not land at all. The vendor DT names the CBUF clocks as that MMU's interface clocks and its driver keeps every NPU clock on for as long as the device is powered. The driver side of this is already upstream, commit 841363ebb508 ("iommu/rockchip: Take all DT clocks"), which switched rk_iommu to devm_clk_bulk_get_all(). Widen the schema to match so those nodes can be described. minItems stays at 2, so every existing devicetree, which all carry exactly aclk and iface, is unaffected. Signed-off-by: Jiaxing Hu --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml b/= Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml index 6ce41d11f..a3cedcaaa 100644 --- a/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml @@ -42,14 +42,22 @@ properties: minItems: 1 =20 clocks: + minItems: 2 items: - description: Core clock - description: Interface clock + - description: Compute clock, RK3576 NPU MMUs only + - description: Convolution buffer core clock, RK3576 NPU MMUs only + - description: Convolution buffer interface clock, RK3576 NPU MMUs o= nly =20 clock-names: + minItems: 2 items: - const: aclk - const: iface + - const: npu + - const: aclk_cbuf + - const: hclk_cbuf =20 "#iommu-cells": const: 0 --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 854D040F729; Wed, 12 Aug 2026 09:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527736; cv=none; b=CLK61PMTZqvoLZzKue4jEMCtKN8yr2V+j56EmYtoNtoCTi5R4ptRGY9shVOFZFi4YKZUj6P0rmrclBNzzgnJYnXRJSxywsbvOV0ePaP3nirmcWKJUqg/3lmMlFLS9YgPHD2Fr3q1Ik4RIS6l76G3Yy0zH3/AkvX8kSplQ/hmotI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527736; c=relaxed/simple; bh=Nqr6CHpbpiWW3sfNMJPrm+iAevtY2L63F6/aYqFMSg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Prwh76tjTg5Uf8mPdzD/MZZbmwWklj4XDVDwAbaKbuAzDgDo6dzd8rj6QKa+8BOzkgvQVd80EtrRS0kGBCrJyZ6Vbbp1JbZsnwxBAFjaR+wZ8ElNEa9H/GpzN9LhHiUyHofSEVjqBIXpmIFck0NZ0zFB6Br26fy6xrSxvylPtUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=GFT5g87V; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=krf4k/gk; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="GFT5g87V"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="krf4k/gk" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailflow.stl.internal (Postfix) with ESMTP id 47BC913000EE; Wed, 12 Aug 2026 05:42:13 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 12 Aug 2026 05:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527733; x= 1786531333; bh=VvFxDkgIfF4tDBD9QKpFN4dgXBjYLgU2XHjl6k+8r/M=; b=G FT5g87VxVsjwH38z9nFsEnRbXgQ6u2CviLiT1CgIzl0Rv53iu2WxZw17BcvudQw6 lmc0U60gc1rx15DYVqhuV0+NpUogT2XAk/PU/MMkCRw/9WtB7axl2HLX+XINPW2T vtooVgZEjC6WoPOXYN4ncfJbtWtluQlgPvTKW6Mqt+5VtcEfrCa+qOEcn4mo6Sj7 nZduQzxXHjtSmLixih8cf39MmL/4f23/BOdIWPoXGS2IoGb6lJgT12dnfbFRTw4w PdqCYpodq/StxjTMqvvIyWCe3sf1YoFOEVBPMZeZSeBma521n52Lsdoxw2JAx6mt 9FUnBJxn1nmMpXeY4k21w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527733; x=1786531333; bh=V vFxDkgIfF4tDBD9QKpFN4dgXBjYLgU2XHjl6k+8r/M=; b=krf4k/gkGYZTKWHYp 2c+i65gmuv/Ipvz/ZqfCTMY0CGPkCqWekI9EXaesgU4SsezXuC8LVMBU65CjSBpv NTjihxqPHWncl37PDs7hdCGMZi3939y3cn04OiGvK1NbNMBFV47sWj0cf6AXVSfk dlp8Wp8QD+rPg+JoP/Zqd6rekGRen7UoFoxz9Sg5s4A6QONr78D5qNjZPvUPLSXF SQwY74kRox48f4pyaTa/rf2Sg5ax5+1IBMGGrj/gbBRQslasDhGFX8cqyxJaKXSG RO2m+vTOj9ZTg16iiMKSbAo2M58QCGhTYDokdwmiB8wmiE+FPvHJ4Rv1BNYsx4Cd oj/kg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEPBq1l3vFlyW0vKyyzWbsEa8EjIJrLsZFQa+nnMaKW9vbMVF1o3VXk/fr8PXXfwo EHGGBPBVgnGNQ4MZA+j3T+aCPWSOGEzAvjDORzQTfgPB/Ainylhn3owwbGK9va5TERblfI pZC1Z9NgyoofcMrcorhTINRDtTJvhbtCpv4Cgf4bCaPcZhnbvMaCed02P82qQB69ERAnMu jJ3Xu0AR6n3Rt452d42hgFmHGx5kk8HXgHeV5NQkgbxlDfToVJV8iUy3qTKNY0qUCY3BG/ aaNQSHMLtlJ9/cSg7vuYjBeElNsZYw8heCP9G/4EgRkJkAPO+nbLXZ1pSvU0kIewZmBOQH nFWxW9OICU/XsflE5jQqjJwaRWuBaM9Ytq8NrOWlxeYhT7JmkwWNHGcSZKL5RYnyLmLvh3 QbTYt7p5V1TuWixWW1iahM2UQFaNxFg4YC1I7Fq0yW5USc5uFCu9zsYDmwbWrypUt+/bub aOF5X14Y880Fln0dUguOlrtwjK1E9sQbLZEN0u2GL8Va23w9xtaJLpcsU4Lwlbz8azY0b+ G9Jf4eFEfbYVltErFtvq3F40gaoj5ZR/ZZQACTW7Nbl4uW3JjlVJlJJZ/uF404ZVnMUFQP x+2rD8z9B35cfkTeWlP2BoV12Y5Q9JrbakVS9qazhTqU3uxYHSaLw0w26FDA X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:42:05 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 05/10] pmdomain/rockchip: add optional per-domain power-on settle delay Date: Wed, 12 Aug 2026 21:41:00 +1200 Message-ID: <20260812094106.1391698-6-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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 RK3576 NPU domains need a short settle time after the idle request is released before the QoS registers behind the domain answer. Without it rockchip_pmu_restore_qos() reads back zeroes, and the NPU throws an async SError on the first cold power-on. Give rockchip_domain_info an optional delay_us and wait for it between releasing idle and restoring QoS. Rename DOMAIN_M_O_R_G to DOMAIN_M_O_R_G_W, since the suffixes name the fields the macro sets and this one now also carries a wakeup delay; RK3576 is its only user, so the old spelling is not kept around. Signed-off-by: Jiaxing Hu --- drivers/pmdomain/rockchip/pm-domains.c | 52 +++++++++++++++----------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rock= chip/pm-domains.c index ba66ae719..e1857f878 100644 --- a/drivers/pmdomain/rockchip/pm-domains.c +++ b/drivers/pmdomain/rockchip/pm-domains.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ struct rockchip_domain_info { u32 pwr_offset; u32 mem_offset; u32 req_offset; + u32 delay_us; }; =20 struct rockchip_pmu_info { @@ -185,7 +187,7 @@ struct rockchip_pmu { .need_regulator =3D regulator, \ } =20 -#define DOMAIN_M_O_R_G(_name, p_offset, pwr, status, m_offset, m_status, r= _status, r_offset, req, idle, ack, g_mask, wakeup) \ +#define DOMAIN_M_O_R_G_W(_name, p_offset, pwr, status, m_offset, m_status,= r_status, r_offset, req, idle, ack, g_mask, delay, wakeup) \ { \ .name =3D _name, \ .pwr_offset =3D p_offset, \ @@ -200,6 +202,7 @@ struct rockchip_pmu { .req_mask =3D (req), \ .idle_mask =3D (idle), \ .clk_ungate_mask =3D (g_mask), \ + .delay_us =3D (delay), \ .ack_mask =3D (ack), \ .active_wakeup =3D wakeup, \ } @@ -258,8 +261,8 @@ struct rockchip_pmu { #define DOMAIN_RK3568(name, pwr, req, wakeup, regulator) \ DOMAIN_M_R(name, pwr, pwr, req, req, req, wakeup, regulator) =20 -#define DOMAIN_RK3576(name, p_offset, pwr, status, r_status, r_offset, req= , idle, g_mask, wakeup) \ - DOMAIN_M_O_R_G(name, p_offset, pwr, status, 0, r_status, r_status, r_offs= et, req, idle, idle, g_mask, wakeup) +#define DOMAIN_RK3576(name, p_offset, pwr, status, r_status, r_offset, req= , idle, g_mask, delay, wakeup) \ + DOMAIN_M_O_R_G_W(name, p_offset, pwr, status, 0, r_status, r_status, r_of= fset, req, idle, idle, g_mask, delay, wakeup) =20 /* * Dynamic Memory Controller may need to coordinate with us -- see @@ -681,6 +684,10 @@ static int rockchip_pd_power(struct rockchip_pm_domain= *pd, bool power_on) if (ret < 0) goto out; =20 + /* Some domains need to settle before the QoS registers answer. */ + if (pd->info->delay_us) + udelay(pd->info->delay_us); + rockchip_pmu_restore_qos(pd); } =20 @@ -1300,25 +1307,26 @@ static const struct rockchip_domain_info rk3568_pm_= domains[] =3D { }; =20 static const struct rockchip_domain_info rk3576_pm_domains[] =3D { - [RK3576_PD_NPU] =3D DOMAIN_RK3576("npu", 0x0, BIT(0), BIT(0), 0, = 0x0, 0, 0, 0, false), - [RK3576_PD_NVM] =3D DOMAIN_RK3576("nvm", 0x0, BIT(6), 0, BIT(6)= , 0x4, BIT(2), BIT(18), BIT(2), false), - [RK3576_PD_SDGMAC] =3D DOMAIN_RK3576("sdgmac", 0x0, BIT(7), 0, BIT(= 7), 0x4, BIT(1), BIT(17), 0x6, false), - [RK3576_PD_AUDIO] =3D DOMAIN_RK3576("audio", 0x0, BIT(8), 0, BIT(8= ), 0x4, BIT(0), BIT(16), BIT(0), false), - [RK3576_PD_PHP] =3D DOMAIN_RK3576("php", 0x0, BIT(9), 0, BIT(9)= , 0x0, BIT(15), BIT(15), BIT(15), false), - [RK3576_PD_SUBPHP] =3D DOMAIN_RK3576("subphp", 0x0, BIT(10), 0, BIT(= 10), 0x0, 0, 0, 0, false), - [RK3576_PD_VOP] =3D DOMAIN_RK3576("vop", 0x0, BIT(11), 0, BIT(11= ), 0x0, 0x6000, 0x6000, 0x6000, false), - [RK3576_PD_VO1] =3D DOMAIN_RK3576("vo1", 0x0, BIT(14), 0, BIT(14= ), 0x0, BIT(12), BIT(12), 0x7000, false), - [RK3576_PD_VO0] =3D DOMAIN_RK3576("vo0", 0x0, BIT(15), 0, BIT(15= ), 0x0, BIT(11), BIT(11), 0x6800, false), - [RK3576_PD_USB] =3D DOMAIN_RK3576("usb", 0x4, BIT(0), 0, BIT(16= ), 0x0, BIT(10), BIT(10), 0x6400, true), - [RK3576_PD_VI] =3D DOMAIN_RK3576("vi", 0x4, BIT(1), 0, BIT(17)= , 0x0, BIT(9), BIT(9), BIT(9), false), - [RK3576_PD_VEPU0] =3D DOMAIN_RK3576("vepu0", 0x4, BIT(2), 0, BIT(1= 8), 0x0, BIT(7), BIT(7), 0x280, false), - [RK3576_PD_VEPU1] =3D DOMAIN_RK3576("vepu1", 0x4, BIT(3), 0, BIT(1= 9), 0x0, BIT(8), BIT(8), BIT(8), false), - [RK3576_PD_VDEC] =3D DOMAIN_RK3576("vdec", 0x4, BIT(4), 0, BIT(20= ), 0x0, BIT(6), BIT(6), BIT(6), false), - [RK3576_PD_VPU] =3D DOMAIN_RK3576("vpu", 0x4, BIT(5), 0, BIT(21= ), 0x0, BIT(5), BIT(5), BIT(5), false), - [RK3576_PD_NPUTOP] =3D DOMAIN_RK3576("nputop", 0x4, BIT(6), 0, BIT(= 22), 0x0, 0x18, 0x18, 0x18, false), - [RK3576_PD_NPU0] =3D DOMAIN_RK3576("npu0", 0x4, BIT(7), 0, BIT(23= ), 0x0, BIT(1), BIT(1), 0x1a, false), - [RK3576_PD_NPU1] =3D DOMAIN_RK3576("npu1", 0x4, BIT(8), 0, BIT(24= ), 0x0, BIT(2), BIT(2), 0x1c, false), - [RK3576_PD_GPU] =3D DOMAIN_RK3576("gpu", 0x4, BIT(9), 0, BIT(25= ), 0x0, BIT(0), BIT(0), BIT(0), false), + /* name p_offset pwr s= tatus r_status r_offset req idle g_mask delay wakeup */ + [RK3576_PD_NPU] =3D DOMAIN_RK3576("npu", 0x0, BIT(0), BIT(0), 0, = 0x0, 0, 0, 0, 0, false), + [RK3576_PD_NVM] =3D DOMAIN_RK3576("nvm", 0x0, BIT(6), 0, BIT(6)= , 0x4, BIT(2), BIT(18), BIT(2), 0, false), + [RK3576_PD_SDGMAC] =3D DOMAIN_RK3576("sdgmac", 0x0, BIT(7), 0, BIT(= 7), 0x4, BIT(1), BIT(17), 0x6, 0, false), + [RK3576_PD_AUDIO] =3D DOMAIN_RK3576("audio", 0x0, BIT(8), 0, BIT(8= ), 0x4, BIT(0), BIT(16), BIT(0), 0, false), + [RK3576_PD_PHP] =3D DOMAIN_RK3576("php", 0x0, BIT(9), 0, BIT(9)= , 0x0, BIT(15), BIT(15), BIT(15), 0, false), + [RK3576_PD_SUBPHP] =3D DOMAIN_RK3576("subphp", 0x0, BIT(10), 0, BIT(= 10), 0x0, 0, 0, 0, 0, false), + [RK3576_PD_VOP] =3D DOMAIN_RK3576("vop", 0x0, BIT(11), 0, BIT(11= ), 0x0, 0x6000, 0x6000, 0x6000, 0, false), + [RK3576_PD_VO1] =3D DOMAIN_RK3576("vo1", 0x0, BIT(14), 0, BIT(14= ), 0x0, BIT(12), BIT(12), 0x7000, 0, false), + [RK3576_PD_VO0] =3D DOMAIN_RK3576("vo0", 0x0, BIT(15), 0, BIT(15= ), 0x0, BIT(11), BIT(11), 0x6800, 0, false), + [RK3576_PD_USB] =3D DOMAIN_RK3576("usb", 0x4, BIT(0), 0, BIT(16= ), 0x0, BIT(10), BIT(10), 0x6400, 0, true), + [RK3576_PD_VI] =3D DOMAIN_RK3576("vi", 0x4, BIT(1), 0, BIT(17)= , 0x0, BIT(9), BIT(9), BIT(9), 0, false), + [RK3576_PD_VEPU0] =3D DOMAIN_RK3576("vepu0", 0x4, BIT(2), 0, BIT(1= 8), 0x0, BIT(7), BIT(7), 0x280, 0, false), + [RK3576_PD_VEPU1] =3D DOMAIN_RK3576("vepu1", 0x4, BIT(3), 0, BIT(1= 9), 0x0, BIT(8), BIT(8), BIT(8), 0, false), + [RK3576_PD_VDEC] =3D DOMAIN_RK3576("vdec", 0x4, BIT(4), 0, BIT(20= ), 0x0, BIT(6), BIT(6), BIT(6), 0, false), + [RK3576_PD_VPU] =3D DOMAIN_RK3576("vpu", 0x4, BIT(5), 0, BIT(21= ), 0x0, BIT(5), BIT(5), BIT(5), 0, false), + [RK3576_PD_NPUTOP] =3D DOMAIN_RK3576("nputop", 0x4, BIT(6), 0, BIT(= 22), 0x0, 0x18, 0x18, 0x18, 15, false), + [RK3576_PD_NPU0] =3D DOMAIN_RK3576("npu0", 0x4, BIT(7), 0, BIT(23= ), 0x0, BIT(1), BIT(1), 0x1a, 15, false), + [RK3576_PD_NPU1] =3D DOMAIN_RK3576("npu1", 0x4, BIT(8), 0, BIT(24= ), 0x0, BIT(2), BIT(2), 0x1c, 15, false), + [RK3576_PD_GPU] =3D DOMAIN_RK3576("gpu", 0x4, BIT(9), 0, BIT(25= ), 0x0, BIT(0), BIT(0), BIT(0), 0, false), }; =20 static const struct rockchip_domain_info rk3588_pm_domains[] =3D { --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 9A218411689; Wed, 12 Aug 2026 09:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527747; cv=none; b=sjC7Vf/wP6o5k5fq72pKf9wRySWNMb2ibNhlsGX3kppJhOozreooFgeiz24joVVX3i4VYzG3OtL4MoJnAAUjaMZ51ICWjGsWi6KGmtWQz4NiEQ1x1TNzbFcX2MWuqdHQCalafPeRsr5A7ikzan5om72pk47CJwuz0esbXZ/QJys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527747; c=relaxed/simple; bh=MOAl+6wW7KPWYXjQOBWfhd8nNouh77QqKrD9SZCDtqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W5FNDi+UBhbfLhR4FX6dzxheYYXCZM22FQFdkDRgQcI95g4Jq1lHS0T+fbCXK0Sq69IzHWQf4jGbKngOTI1RkgzCBzHEWE8S/vUGCFv2WYNrspJ0bpWSpul2Y7ZBE6F4XQcEFfD07eOuEAbe9MuZqNpA5mkbe8RL41PuYrydzvg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=jKYU88/1; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Hd3njpte; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="jKYU88/1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Hd3njpte" Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailflow.stl.internal (Postfix) with ESMTP id 6FC1D13000EE; Wed, 12 Aug 2026 05:42:24 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 12 Aug 2026 05:42:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527744; x= 1786531344; bh=t5ehuwu+R3IZPenGVdecVG/3J4bVeduLS34R82/gLXE=; b=j KYU88/1HQB38tEHGPcOZxSZI/xIdBKKz7rItHffOfva9EdpFTK4RSWN+1vwCvp5T NAkfq4z9H3NUgK6c+Qyv2bc4wgOJfynN7qjvq+ymekbzbqB3Sd6Z/p71pTsLDgUF eH7fseMYlgx3QcUcemyB2y3chb+YBJxbnDrtwN+PqhG7X7sNTXit1Qla4/fpHrZN VLrnHb/40wUzvfXWd2qAchF8vcAz65cCm/+KfuC2moieBcqRdr4qmBjcKF86oko7 KjROGHFlxUn0zl7S0EUOoi120xb3XYLDwTxI8e+Mp0AGmlw25DQ85z/SSa6O/e9V BrkhuNOKslGZZrlz7eJmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527744; x=1786531344; bh=t 5ehuwu+R3IZPenGVdecVG/3J4bVeduLS34R82/gLXE=; b=Hd3njptejXd1e1zIU mWb5J3QCaxUQwCyti8aXcW7qCJjZuj1tTfV6z7WApmoSap84s6z2zVcDcome1P0o wcKvmJA5yZP/JDwN8U67G3T/psIHsFn4eJJffW3Vp7lDOqvXY+6BGqu2YRuwqRi2 +1ert89lDoIEB3y9dmfajxbhW0C5d0QpyTN+Zf2C42isYV4ZYCY5r1Xm9jUkq67u PskCw29fSn1DICEviDGC4tJSZ1Ox6B9C3ewpYrV/ytOUZs2UyDFiZAYRVJP14yvF HEVc/YUB29L8GEdkP31UUQ0YK3WgVP7sb629rFYtZQu3Y+OKQzJoHjCfx9Xvz6Vh Xln8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGwgEiQ82b/vslvxu748yQUK6wPursKF8fMIVbz67wiFGHgA47PKoO/uGXMsZMxLx gFPIgLOcY7P5CngkkiK3BYsM+NSvuArVGUEmY/S//Od5HX6j19/B4vsjpf5HveubJ3pf// pWCcY4ceqdx0GtHj0WCQ0o6J65xdr5brIk0MpFgwd1OnJb0OJtZbfDBehL90KckpJx/ici /427xioY7E6zKhb2nnVrNb5/eVe38u0ELJVPMEpl79CB4mXXIS+TOXwQ2vG5Pe68Rd3XXD xmR8fAtcy04eoj5dkZNb571/YdUoGmvjFo0tW/6wl1YthjyIcmyfW3v1C+VPOybfcM4wDu /FpDxAXbbfECzEXrxC0iSVGXGLdN2ejFzFEYHu13ZdLzrEMHd3VYdvZ/Y1IaOHzN8Xo8h+ XqirhsQgGOv/203VZQXUdeJ0RJ3kHrEjaNOt7etJMSG5yf2X81nPo7aPw3PqfFG4W5AKK5 BJD88GMjZF5mOGYU89FPCwExFIvdlLX1Y/M/CddXG8UoTWA8c6cLnP4wados4DZAu6Krp7 U1fyQZQzlVsslfIUV007mMHP9XN1KQ8ZYnEdOvQe/IRwsgRa3Tys2yQdhpwBCjbZKoW3df 0ysHur7hldRJnBMlMbToA+lGqA5aCrTM+3fYH6Lowpe3Q3gsdU81NIDUNWDQ X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:42:16 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 06/10] pmdomain/rockchip: cycle optional power-domain resets on power-on Date: Wed, 12 Aug 2026 21:41:01 +1200 Message-ID: <20260812094106.1391698-7-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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" Some Rockchip domains come out of power-on with their bus interface in an undefined state. On the RK3576 NPU this shows up as a hang on the first register access after the domain is switched on, and pulsing the domain's resets at this point clears it. Take the domain node's resets if it has any, and pulse them between releasing idle and restoring QoS. The resets are optional, so domains that do not list any are unaffected. Signed-off-by: Jiaxing Hu --- drivers/pmdomain/rockchip/pm-domains.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rock= chip/pm-domains.c index e1857f878..4eebb5d99 100644 --- a/drivers/pmdomain/rockchip/pm-domains.c +++ b/drivers/pmdomain/rockchip/pm-domains.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,7 @@ struct rockchip_pm_domain { struct clk_bulk_data *clks; struct device_node *node; struct regulator *supply; + struct reset_control *resets; }; =20 struct rockchip_pmu { @@ -688,6 +690,13 @@ static int rockchip_pd_power(struct rockchip_pm_domain= *pd, bool power_on) if (pd->info->delay_us) udelay(pd->info->delay_us); =20 + /* Optional: some domains need their resets cycled after power-on. */ + if (pd->resets) { + reset_control_assert(pd->resets); + udelay(10); + reset_control_deassert(pd->resets); + } + rockchip_pmu_restore_qos(pd); } =20 @@ -857,6 +866,14 @@ static int rockchip_pm_add_one_domain(struct rockchip_= pmu *pmu, if (error) goto err_put_clocks; =20 + pd->resets =3D of_reset_control_array_get_optional_exclusive(node); + if (IS_ERR(pd->resets)) { + error =3D dev_err_probe(pmu->dev, PTR_ERR(pd->resets), + "%pOFn: failed to get resets\n", node); + pd->resets =3D NULL; + goto err_unprepare_clocks; + } + pd->num_qos =3D of_count_phandle_with_args(node, "pm_qos", NULL); =20 @@ -927,6 +944,7 @@ static int rockchip_pm_add_one_domain(struct rockchip_p= mu *pmu, clk_bulk_unprepare(pd->num_clks, pd->clks); err_put_clocks: clk_bulk_put(pd->num_clks, pd->clks); + reset_control_put(pd->resets); return error; } =20 @@ -945,6 +963,7 @@ static void rockchip_pm_remove_one_domain(struct rockch= ip_pm_domain *pd) =20 clk_bulk_unprepare(pd->num_clks, pd->clks); clk_bulk_put(pd->num_clks, pd->clks); + reset_control_put(pd->resets); =20 /* protect the zeroing of pm->num_clks */ mutex_lock(&pd->pmu->mutex); --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 E8D5941169F; Wed, 12 Aug 2026 09:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527760; cv=none; b=ONgUhYFYx/4qXoS4/xeCJ8pEC0JP1QNI9LfSLGpXsph54K/xgyJiCBVvPHp7/vUi/LKIELoQ6apy4SdR+RT2mb9Sw83gttsYAu/Pxj3u5Hrt2HUhcrOUEQSddwWtT5gaddaqUkfAVRSG0NbOWFTM1K0Bazf5xbTzCgMeOrprM4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527760; c=relaxed/simple; bh=kN06lZ9HD0pj4xFD/f2Qilt0vzfMYrJJB1Lsh3PgnAY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ODv0C6MpXgIUUYXupGPzaLtuk1tS5Bmk7lS8hmS7Af8qvUeZXEjBVfPKD1wIwna59OvR1eHVFXB3Zss1+2zRxPw0GLzAGlKVyJbX2bdEXh0GdMyf3ZWnGPHt94Ba6+lc26Qem97HqOiKMOSAvSs1Orlq0eFSI3pKCmpdrqy5RU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=1VBY1rel; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=GivkY+kQ; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="1VBY1rel"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="GivkY+kQ" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailflow.stl.internal (Postfix) with ESMTP id 99A171300228; Wed, 12 Aug 2026 05:42:36 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 12 Aug 2026 05:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527756; x= 1786531356; bh=mPwoBZVvD5IiMKU/tQGUb6tRYFOiIEKnit/tY33hzAg=; b=1 VBY1rel3Bzytp7cOXfRfTvaqK0NDsWRZhVvU76tRhtMJnnbucxOjqWea/VxBfylT CPSKkm3pC02/QGtIogbUom1hjkofP1xzRIM75mFKHmovVyZ307q+OdPWkcyDJi5v AZu8gdfxFYdtxsig52ZwUeNDSlbsIv31poYvNPwltHIFH53Ssk6BkUptjiczouq0 jjfSRgUiDKMfVRpjqfsOvnbuADokCbNEPAJAdrvPuU0zAWxGt4fm/NdmX7JrloUx 9mPidEOni+M20Qm1So52YMTFJ5MCUvxOxGmYOw8ms85CVZSo2TSWH0od2+9FK3cg qzPrNU4eZdK/dGgQvrVgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527756; x=1786531356; bh=m PwoBZVvD5IiMKU/tQGUb6tRYFOiIEKnit/tY33hzAg=; b=GivkY+kQwTzoyFVnY Ebt6TNPLZvdjwPSH4tcG7CRKeDxOTxiVDd1WPSK8+btmAN0BAQcJ0LEVCWNJZ8AW FeC51CGxcod2rxfAZHhhbjHLmcA5pel4s97J/KW7ugEtFPlpsJhC+I4748hTawwW PKm8neVFt2v62+vBlVed6rSDTr6PsLxe6TLEt1YnnAyQGe40rtq3qe6DGWK3/LVi IHK1NDUoB/Y7xgmax8dnzWnUXsfCUxQFGoN4bER4lXoSZUJZnUJdeu+1VZ3xEdXX agsG8Z8dYLqb7WAVBhabD/D2ay7HH5exdYevX0g9NKpjDcKEargYElL/blt3ifp2 g1jUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEPBq1l3vFlyW0vKyyzWbsEa8EjIJrLsZFQa+nnMaKW9vbMVF1o3VXk/fr8PXXfwo EHGGBPBVgnGNQ4MZA+j3T+aCPWSOGEzAvjDORzQTfgPB/Ainylhn3owwbGK9va5TERblfI pZC1Z9NgyoofcMrcorhTINRDtTJvhbtCpv4Cgf4bCaPcZhnbvMaCed02P82qQB69ERAnMu jJ3Xu0AR6n3Rt452d42hgFmHGx5kk8HXgHeV5NQkgbxlDfToVJV8iUy3qTKNY0qUCY3BG/ aaNQSHMLtlJ9/cSg7vuYjBeElNsZYw8heCP9G/4EgRkJkAPO+nbLXZ1pSvU0kIewZmBOcb UC8iEeF5sBBaoBOIiTxbJ/TcV0LTSws8eMY8P/UnZueAoDqKwwIxqCP8l3bPShA7oLvrl9 oUxkYpGhlsMtKIOk7QPE9EXrIG5v6ac4TB7jRVdY0Op7JKlxCUwPvfEVnIJoM2Big5jZ2M i3GBX0taGJEI0vVwTLy9GC927mXXByMZgCePj+1Ka6IU49bN3rkrVnAhpLCrpZX+4SCHwD 3NXuFIV2SqqNBHSklX+zj0ZuLym5iyhtHbGAU3qTH8LI/iQNAHTIPBUM4eTmkUddOOA9mh TYbl3clvq/F6rgp2lYw0p+GRfMWJN8B6Sw+LBMZWwwAIy++/N153nULJBQsA X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:42:28 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 07/10] accel/rocket: select the per-core clock and reset counts from match data Date: Wed, 12 Aug 2026 21:41:02 +1200 Message-ID: <20260812094106.1391698-8-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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 RK3576 carries the same RKNN block with a different set of clocks and resets, so the counts cannot stay compile-time constants. Add a soc_data struct to the of_device_id match data and take the bulk counts from it. RK3588 keeps four clocks and two resets, so nothing changes for it, and the arrays keep their present sizes: the SoC that needs a longer one grows it in the patch that adds the names. rocket_core_reset() is switched over as well. It is the same array, and leaving it on ARRAY_SIZE() would walk entries that were never acquired once a SoC asks for fewer. Signed-off-by: Jiaxing Hu --- drivers/accel/rocket/rocket_core.c | 8 ++++---- drivers/accel/rocket/rocket_core.h | 7 +++++++ drivers/accel/rocket/rocket_drv.c | 12 +++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/accel/rocket/rocket_core.c b/drivers/accel/rocket/rock= et_core.c index 5dd260bac..b202d1581 100644 --- a/drivers/accel/rocket/rocket_core.c +++ b/drivers/accel/rocket/rocket_core.c @@ -23,7 +23,7 @@ int rocket_core_init(struct rocket_core *core) =20 core->resets[0].id =3D "srst_a"; core->resets[1].id =3D "srst_h"; - err =3D devm_reset_control_bulk_get_exclusive(&pdev->dev, ARRAY_SIZE(core= ->resets), + err =3D devm_reset_control_bulk_get_exclusive(&pdev->dev, core->soc->num_= resets, core->resets); if (err) return dev_err_probe(dev, err, "failed to get resets for core %d\n", cor= e->index); @@ -32,7 +32,7 @@ int rocket_core_init(struct rocket_core *core) core->clks[1].id =3D "hclk"; core->clks[2].id =3D "npu"; core->clks[3].id =3D "pclk"; - err =3D devm_clk_bulk_get(dev, ARRAY_SIZE(core->clks), core->clks); + err =3D devm_clk_bulk_get(dev, core->soc->num_clks, core->clks); if (err) return dev_err_probe(dev, err, "failed to get clocks for core %d\n", cor= e->index); =20 @@ -109,9 +109,9 @@ void rocket_core_fini(struct rocket_core *core) =20 void rocket_core_reset(struct rocket_core *core) { - reset_control_bulk_assert(ARRAY_SIZE(core->resets), core->resets); + reset_control_bulk_assert(core->soc->num_resets, core->resets); =20 udelay(10); =20 - reset_control_bulk_deassert(ARRAY_SIZE(core->resets), core->resets); + reset_control_bulk_deassert(core->soc->num_resets, core->resets); } diff --git a/drivers/accel/rocket/rocket_core.h b/drivers/accel/rocket/rock= et_core.h index f6d738285..ba74c5339 100644 --- a/drivers/accel/rocket/rocket_core.h +++ b/drivers/accel/rocket/rocket_core.h @@ -27,9 +27,16 @@ #define rocket_core_writel(core, reg, value) \ writel(value, (core)->core_iomem + (REG_CORE_##reg) - REG_CORE_S_STATUS) =20 +/* Per-SoC differences, selected by the of_device_id match data. */ +struct rocket_soc_data { + unsigned int num_clks; /* clk_bulk count */ + unsigned int num_resets; /* reset_bulk count */ +}; + struct rocket_core { struct device *dev; struct rocket_device *rdev; + const struct rocket_soc_data *soc; unsigned int index; =20 int irq; diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocke= t_drv.c index 8bbbce594..6e7dc91c5 100644 --- a/drivers/accel/rocket/rocket_drv.c +++ b/drivers/accel/rocket/rocket_drv.c @@ -176,6 +176,7 @@ static int rocket_probe(struct platform_device *pdev) =20 rdev->cores[core].rdev =3D rdev; rdev->cores[core].dev =3D &pdev->dev; + rdev->cores[core].soc =3D of_device_get_match_data(&pdev->dev); rdev->cores[core].index =3D core; =20 rdev->num_cores++; @@ -213,8 +214,13 @@ static void rocket_remove(struct platform_device *pdev) } } =20 +static const struct rocket_soc_data rk3588_soc_data =3D { + .num_clks =3D 4, + .num_resets =3D 2, +}; + static const struct of_device_id dt_match[] =3D { - { .compatible =3D "rockchip,rk3588-rknn-core" }, + { .compatible =3D "rockchip,rk3588-rknn-core", .data =3D &rk3588_soc_data= }, {} }; MODULE_DEVICE_TABLE(of, dt_match); @@ -240,7 +246,7 @@ static int rocket_device_runtime_resume(struct device *= dev) if (core < 0) return -ENODEV; =20 - err =3D clk_bulk_prepare_enable(ARRAY_SIZE(rdev->cores[core].clks), rdev-= >cores[core].clks); + err =3D clk_bulk_prepare_enable(rdev->cores[core].soc->num_clks, rdev->co= res[core].clks); if (err) { dev_err(dev, "failed to enable (%d) clocks for core %d\n", err, core); return err; @@ -260,7 +266,7 @@ static int rocket_device_runtime_suspend(struct device = *dev) if (!rocket_job_is_idle(&rdev->cores[core])) return -EBUSY; =20 - clk_bulk_disable_unprepare(ARRAY_SIZE(rdev->cores[core].clks), rdev->core= s[core].clks); + clk_bulk_disable_unprepare(rdev->cores[core].soc->num_clks, rdev->cores[c= ore].clks); =20 return 0; } --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 50C3341379E; Wed, 12 Aug 2026 09:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527774; cv=none; b=ebekYJbVuyp0lQS80vQ3EABHnpIvzNk5ZuR78/e/1QG1lYEOj37UksCJ6HpnRuWjOopqrwKNpTxTr9NJQ7WcICQJ2IsO7NYGdAKbY0i2MyWdSO1xI899sYdHTMo+rPcBw43mcTDV4FcuALmCD13JGnvwTd6xY4ePdWB87kUHIdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527774; c=relaxed/simple; bh=w2QX+grqyRheRd96qiMhEOC+89UCTzv+j2xK0OU0fuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P49SugAN19bJ8eyfgcmhCvQpA3xcHRs5abXrRCgizQbRR3PoMfmfBD23Yo4CqMlyFbdRFIsuRNIOuRCsL82gXsCKbkQYDCgEmG0GMYmWtTlCKh70TxFLwJD/MtPM4Z/3IapzBNHFQYHnPOgwLHR2yXBp5RT1zIw2yiqZn4Glyl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=OSFMji2X; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=hy/7+4ZM; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="OSFMji2X"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hy/7+4ZM" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailflow.stl.internal (Postfix) with ESMTP id 1B9121300228; Wed, 12 Aug 2026 05:42:51 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 12 Aug 2026 05:42:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527770; x= 1786531370; bh=Ati4Eflk6xp2IrUggBs6aXWkanzDwAoo1oh6SFMUrR8=; b=O SFMji2XgfNMg+uVkN5hdjKYD7sVzCrZYuGHqngRCh7BdyLjv3rOTbJNRk/xUZHJU tF6E6fwDlYvjaOxU84g9KNKCbJ3IDMN+hWEPzjI01lmFrBntaY63xJHWAlAptWMo vIsDH9L9wYDOMcsJPPuF+DKmpKVD/cQ/l8NEqHLlupIGnsj5+IlUs4NobSvJfo14 8wNQQqD6ggSF61gIDUQJq3EvMCj/jr9ahnQGbM3OHonW+2hMH5BrGAowaMOAVx++ EOv4YrsjPrsQRKPdgSGp8FUewDhnr7nyrmjB66ftLG+QInXuu3xIdAKKzolmh4jJ n4KWznR1lKApugZvTMNiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527770; x=1786531370; bh=A ti4Eflk6xp2IrUggBs6aXWkanzDwAoo1oh6SFMUrR8=; b=hy/7+4ZMfaAcm0QlI OLboT4+0+6LXaed1DvZKZ38Tg4JGCdnfcArTnJT88HqZOgG7Y8k5QMi/mxVOeltT F2ZV/CiEPtMx+vjJ3ZF6Ofg/oz+p8cSHg/REF1wAbH/0hWPljgMC2PyvHRQPMQR+ sYGnbhyn4wDI5TUo1l2rWSPZtm06uDYiiixfrPzT823rhRpCXMJxb6i5vdy3v46M PC11zZT4akzG8ySiL729lu12nLwFK8mzmDUeby2PgqYJ/SdKpHHUDlnmEdQrjJ3d t8YEMFPzuHmpVtmvJaaTGynzpkZ6VmC1wcfIbQ5oisl8IFDQlunc5IV6QCXm5vIg vc4fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDFg2YYgRuZDKXyF65GRSgCQx0Oa6STfe6GS/YD81051fgilENCaCeauLVmePeeQ Xfs+tmV31ZNOdQgrJ8wE2ZWDp08nCZhe5yK0hU0NWYXlF84X5HrdmUBwmj879MQZ5ylTNX 0ZgYCXUoSgR0sXClW7HpRe/nOITVe6ebubQjQr4vz6adj1FQ/k/zcemH7K9Es2jxhVEQPo lVXQbf/+wybzKFQnTbLBTrnDm+XasQ+0WE73ss72oMg71PWsNiDitFUd15Ibu9E+FvIeKK MPbFOlaFw21sZr682VJJXOyDtzel7G+Yct0NwP/uSCJqgLbCVhhMmls8X1PdVCdt3XGIG1 W/z0E6lLK5L2k78xr3D2648D5ts14m5R/Dnr5WaAJkK+YgNdTHH0H12G7UxAEaP65jxyVm vKPfKHmLzzzhpSBfBWRgPDpsq6ftubSCkxpzk15RxSRRNO4Fdiv2tpLewYO0BwLVLmq7Kz KBbhtwI1HKNT+qC2AndK//xwW/cqeNi4Hkv3qvlR+bDckEYoMGwoOgDBBj5EonhJvASW60 hK7HaBjULkLvBQw420k9wwZsK4t4kUV5Fs8MIWRQHQAG2dE2/+W2/Nac45HC8YcLm+CL4N ze30PhCvP2nO1BZfCXOhEPp41pfiBR0xXbDkg0w6kFz1An6A7hwxsca8Grkw X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:42:39 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 08/10] accel/rocket: add RK3576 NPU (RKNN) support Date: Wed, 12 Aug 2026 21:41:03 +1200 Message-ID: <20260812094106.1391698-9-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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 RK3576 has two cores of the same RKNN block and a few platform differences: - the CBUF (convolution buffer) has its own clock domain, so the core needs six clocks rather than four; - the BIU reset moved into the power domain, leaving one reset here; - the NPU spans two power domains, and a device with more than one is skipped by the driver-core single-domain auto-attach, so the list has to be attached explicitly; - PC_TASK_CON packs the task number with sixteen bits rather than twelve, moving the three controls above it up by four. That last one is the reason this series has been reporting, since v3, that the block accepts exactly one task per reset. rocket_registers.h is generated from the RK3588 description, so writing it unchanged to an RK3576 asks for task_number 0x7001, which is 28673 tasks, and puts TASK_COUNT_CLEAR on a bit that does nothing. The counter is then only ever cleared by a reset. The layout was confirmed by Chaoyi Chen of Rockchip, including a fourth control at BIT(18), task_last_layer_clear, which belongs on every submit alongside the count clear: https://lore.kernel.org/all/4f300b78-d96d-4d98-8819-dc292b0c9b97@rock-chi= ps.com/ With that written correctly a job of several tasks runs to completion, the completion interrupt arrives, and /proc/interrupts counts up. A convolution submitted three times with three different inputs is byte exact against the CPU reference each time, with no reset in between and with nothing retiring the job but the interrupt. All of it hangs off the soc_data added earlier, so the RK3588 path keeps its existing counts and behaviour. Signed-off-by: Jiaxing Hu --- drivers/accel/rocket/rocket_core.c | 20 ++++++++ drivers/accel/rocket/rocket_core.h | 8 +-- drivers/accel/rocket/rocket_device.c | 4 ++ drivers/accel/rocket/rocket_drv.c | 10 ++++ drivers/accel/rocket/rocket_job.c | 76 ++++++++++++++++++++++------ 5 files changed, 99 insertions(+), 19 deletions(-) diff --git a/drivers/accel/rocket/rocket_core.c b/drivers/accel/rocket/rock= et_core.c index b202d1581..5f3155135 100644 --- a/drivers/accel/rocket/rocket_core.c +++ b/drivers/accel/rocket/rocket_core.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include =20 @@ -21,6 +22,7 @@ int rocket_core_init(struct rocket_core *core) u32 version; int err =3D 0; =20 + /* RK3576 moves the BIU reset into its power domain and takes only srst_a= . */ core->resets[0].id =3D "srst_a"; core->resets[1].id =3D "srst_h"; err =3D devm_reset_control_bulk_get_exclusive(&pdev->dev, core->soc->num_= resets, @@ -32,6 +34,9 @@ int rocket_core_init(struct rocket_core *core) core->clks[1].id =3D "hclk"; core->clks[2].id =3D "npu"; core->clks[3].id =3D "pclk"; + /* RK3576 clocks the CBUF separately; the compute path stalls without the= se. */ + core->clks[4].id =3D "aclk_cbuf"; + core->clks[5].id =3D "hclk_cbuf"; err =3D devm_clk_bulk_get(dev, core->soc->num_clks, core->clks); if (err) return dev_err_probe(dev, err, "failed to get clocks for core %d\n", cor= e->index); @@ -60,6 +65,21 @@ int rocket_core_init(struct rocket_core *core) if (err) return err; =20 + /* + * RK3576 spans two power domains, and a multi-domain device is skipped + * by the driver-core single-domain auto-attach, so attach the list here. + * This goes before the first thing that would have to be unwound, so a + * failure can simply return. + */ + if (core->soc->multi_power_domain) { + struct dev_pm_domain_list *pd_list; + + err =3D devm_pm_domain_attach_list(dev, NULL, &pd_list); + if (err < 0) + return dev_err_probe(dev, err, + "failed to attach NPU power domains\n"); + } + core->iommu_group =3D iommu_group_get(dev); =20 err =3D rocket_job_init(core); diff --git a/drivers/accel/rocket/rocket_core.h b/drivers/accel/rocket/rock= et_core.h index ba74c5339..8c8d1f453 100644 --- a/drivers/accel/rocket/rocket_core.h +++ b/drivers/accel/rocket/rocket_core.h @@ -29,8 +29,10 @@ =20 /* Per-SoC differences, selected by the of_device_id match data. */ struct rocket_soc_data { - unsigned int num_clks; /* clk_bulk count */ - unsigned int num_resets; /* reset_bulk count */ + unsigned int num_clks; /* clk_bulk count: 4 base, 6 with CBUF */ + unsigned int num_resets; /* reset_bulk count: 2 base, 1 on RK3576 */ + bool multi_power_domain; /* device spans more than one PM domain */ + bool task_con_16bit; /* PC_TASK_CON uses the 16-bit task number */ }; =20 struct rocket_core { @@ -43,7 +45,7 @@ struct rocket_core { void __iomem *pc_iomem; void __iomem *cna_iomem; void __iomem *core_iomem; - struct clk_bulk_data clks[4]; + struct clk_bulk_data clks[6]; struct reset_control_bulk_data resets[2]; =20 struct iommu_group *iommu_group; diff --git a/drivers/accel/rocket/rocket_device.c b/drivers/accel/rocket/ro= cket_device.c index 46e6ee1e7..bfb00f967 100644 --- a/drivers/accel/rocket/rocket_device.c +++ b/drivers/accel/rocket/rocket_device.c @@ -31,6 +31,10 @@ struct rocket_device *rocket_device_init(struct platform= _device *pdev, if (of_device_is_available(core_node)) num_cores++; =20 + for_each_compatible_node(core_node, NULL, "rockchip,rk3576-rknn-core") + if (of_device_is_available(core_node)) + num_cores++; + rdev->cores =3D devm_kcalloc(dev, num_cores, sizeof(*rdev->cores), GFP_KE= RNEL); if (!rdev->cores) return ERR_PTR(-ENOMEM); diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocke= t_drv.c index 6e7dc91c5..f333fe466 100644 --- a/drivers/accel/rocket/rocket_drv.c +++ b/drivers/accel/rocket/rocket_drv.c @@ -217,10 +217,20 @@ static void rocket_remove(struct platform_device *pde= v) static const struct rocket_soc_data rk3588_soc_data =3D { .num_clks =3D 4, .num_resets =3D 2, + .multi_power_domain =3D false, + .task_con_16bit =3D false, +}; + +static const struct rocket_soc_data rk3576_soc_data =3D { + .num_clks =3D 6, + .num_resets =3D 1, + .multi_power_domain =3D true, + .task_con_16bit =3D true, }; =20 static const struct of_device_id dt_match[] =3D { { .compatible =3D "rockchip,rk3588-rknn-core", .data =3D &rk3588_soc_data= }, + { .compatible =3D "rockchip,rk3576-rknn-core", .data =3D &rk3576_soc_data= }, {} }; MODULE_DEVICE_TABLE(of, dt_match); diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocke= t_job.c index 4c01b703e..493b3bf97 100644 --- a/drivers/accel/rocket/rocket_job.c +++ b/drivers/accel/rocket/rocket_job.c @@ -21,6 +21,35 @@ =20 #define JOB_TIMEOUT_MS 500 =20 +/* + * RK3576 arms the same DPU completion as RK3588, but the interrupt never + * reaches the GIC. The completion itself is visible in INTERRUPT_RAW_STAT= US, + * so sample that instead. The tick cap bounds jobs that never raise it at= all, + * which is the same open problem as the wrong inference results. + */ +/* + * PC_TASK_CON packs the task number with three controls, and the field wi= dths + * are not the same on every SoC. rocket_registers.h is generated from the + * RK3588 description, where the task number is twelve bits: + * + * RK3588 BIT[11:0] task_number, BIT[12] pp_en, BIT[13] count_clear + * RK3576 BIT[15:0] task_number, BIT[16] pp_en, BIT[17] count_clear, + * BIT[18] last_layer_clear + * + * The RK3576 layout was confirmed by Chaoyi Chen of Rockchip: + * https://lore.kernel.org/all/4f300b78-d96d-4d98-8819-dc292b0c9b97@rock-c= hips.com/ + * + * Writing the RK3588 layout to an RK3576 therefore asks for task_number + * 0x7001, that is 28673 tasks, and lands the count clear on a bit that do= es + * nothing. The task counter is then only ever cleared by a reset, which is + * exactly the "one task per reset" behaviour this series has been reporti= ng + * since v3. + */ +#define RK3576_PC_TASK_CON_TASK_NUMBER(n) ((n) & 0xffff) +#define RK3576_PC_TASK_CON_PP_EN BIT(16) +#define RK3576_PC_TASK_CON_COUNT_CLEAR BIT(17) +#define RK3576_PC_TASK_CON_LAST_LAYER_CLEAR BIT(18) + static struct rocket_job * to_rocket_job(struct drm_sched_job *sched_job) { @@ -142,10 +171,17 @@ static void rocket_job_hw_submit(struct rocket_core *= core, struct rocket_job *jo rocket_pc_writel(core, INTERRUPT_MASK, PC_INTERRUPT_MASK_DPU_0 | PC_INTER= RUPT_MASK_DPU_1); rocket_pc_writel(core, INTERRUPT_CLEAR, PC_INTERRUPT_CLEAR_DPU_0 | PC_INT= ERRUPT_CLEAR_DPU_1); =20 - rocket_pc_writel(core, TASK_CON, PC_TASK_CON_RESERVED_0(1) | - PC_TASK_CON_TASK_COUNT_CLEAR(1) | - PC_TASK_CON_TASK_NUMBER(1) | - PC_TASK_CON_TASK_PP_EN(1)); + if (core->soc->task_con_16bit) + rocket_pc_writel(core, TASK_CON, + RK3576_PC_TASK_CON_LAST_LAYER_CLEAR | + RK3576_PC_TASK_CON_COUNT_CLEAR | + RK3576_PC_TASK_CON_PP_EN | + RK3576_PC_TASK_CON_TASK_NUMBER(1)); + else + rocket_pc_writel(core, TASK_CON, PC_TASK_CON_RESERVED_0(1) | + PC_TASK_CON_TASK_COUNT_CLEAR(1) | + PC_TASK_CON_TASK_NUMBER(1) | + PC_TASK_CON_TASK_PP_EN(1)); =20 rocket_pc_writel(core, TASK_DMA_BASE_ADDR, PC_TASK_DMA_BASE_ADDR_DMA_BASE= _ADDR(0x0)); =20 @@ -341,6 +377,25 @@ static struct dma_fence *rocket_job_run(struct drm_sch= ed_job *sched_job) return ERR_PTR(ret); } =20 +/* Start the job's next task, or retire it. Caller holds job_lock. */ +static void rocket_job_next_locked(struct rocket_core *core) +{ + lockdep_assert_held(&core->job_lock); + + if (!core->in_flight_job) + return; + + if (core->in_flight_job->next_task_idx < core->in_flight_job->task_count)= { + rocket_job_hw_submit(core, core->in_flight_job); + return; + } + + iommu_detach_group(NULL, iommu_group_get(core->dev)); + dma_fence_signal(core->in_flight_job->done_fence); + pm_runtime_put_autosuspend(core->dev); + core->in_flight_job =3D NULL; +} + static void rocket_job_handle_irq(struct rocket_core *core) { pm_runtime_mark_last_busy(core->dev); @@ -354,17 +409,7 @@ static void rocket_job_handle_irq(struct rocket_core *= core) rocket_pc_writel(core, OPERATION_ENABLE, 0x0); rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff); =20 - if (core->in_flight_job) { - if (core->in_flight_job->next_task_idx < core->in_flight_job->task_coun= t) { - rocket_job_hw_submit(core, core->in_flight_job); - return; - } - - iommu_detach_group(NULL, iommu_group_get(core->dev)); - dma_fence_signal(core->in_flight_job->done_fence); - pm_runtime_put_autosuspend(core->dev); - core->in_flight_job =3D NULL; - } + rocket_job_next_locked(core); } } =20 @@ -644,7 +689,6 @@ int rocket_ioctl_submit(struct drm_device *dev, void *d= ata, struct drm_file *fil } } =20 - for (i =3D 0; i < args->job_count; i++) rocket_ioctl_submit_job(dev, file, &jobs[i]); =20 --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 BED04411689; Wed, 12 Aug 2026 09:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527784; cv=none; b=UFElZ7ietEF4Ttu0ArnWPwtsfSoQSlSxISR0RFUAX/aIfbnCiLnt98K9ZBEdoU7q8LAIwYYL5ARQrqljXjQW5IqiPQ6H6is8lPxLyOrg2CKAiQze4n4sQhqTAvzl04RROB5Otgq6gXXz30MWvWL4ukMWvulnB11CxLZ8Hxm5ZWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527784; c=relaxed/simple; bh=bRfSreLpjR5f/JeBfk/8tUDRhux1Y3bOx/ZKnvAmEko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FvhCBrGHGMtThojkVzPvVA5q5w0hg8QMPFwcTnIxtHdZspEWzCCRzHnIWTr0js16BKk/YIySRikBRtENeWywEmNGGaLafa/7eNAE1cb8IIPaCWvxESf+Rm5OwWPHRp9nIMwH31TMAkgClqoVE3vo0q+HhEIPZ3/scZ1mnuRH9cY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=e258z2J6; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AnlZ/5+J; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="e258z2J6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AnlZ/5+J" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailflow.stl.internal (Postfix) with ESMTP id B0E901300277; Wed, 12 Aug 2026 05:43:01 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 12 Aug 2026 05:43:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527781; x= 1786531381; bh=MCdVFBzoMQYqXVrZeC1sFHbOAswgeJFeoPQ04J47ZjA=; b=e 258z2J6AqsmCHjc1Dop95DilQy+XR+UoPr6XkrxtyBAhLeRquhr/RZn/Y03YXF2l T8axbpVHu/fOyUW1IpGKZqTG2KFLQKDT23P7zQjHSCinkkpZnHa2hBRSWuPK/6gY eO9I0E9W50h/pf4blluCNOAtWQOlDS0FbYiU/tfP5wHUJEf2IU9Ds/SAB4LEVjsN 4j2VeH78jTT0YXMFcF5yE5ebZZQAekM8QP/oLQ2S6hmJAcsJJh3dasZNVwuIriUs PTZVIBSVxu+19fv5xt9PMlQg01ukYa+zTh1qhrcyibzNQtw/xhRb7Gc4R8yU9vBO 5zmzofluHnHVqK8++r55Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527781; x=1786531381; bh=M CdVFBzoMQYqXVrZeC1sFHbOAswgeJFeoPQ04J47ZjA=; b=AnlZ/5+JyDNbx5gsz 8oOESIQmWoetQRbPAPGauZPPjt6ik6GnPKWKbhT9HHCsD/rsfb6px2MmQjO104I7 1GfDRwoepmIEaCOb/A+KmTPGYqOcFyAGJr3yz+zTC85VT9qxRNxWF9u+cbHsDZPN DehSVYAUfG8x+qVYZWQQL2X311uFu3BZcB6BuhvtXpKyQM4TIU7WzQBJqP0XBCbH hyFzDOKLHHvPxcrshGAVv3lorLvI5tyU539XhZ3pUJIDYc8BJLFjOKlS7sAaDXCl FBgzaOsiWIwgcFDaHGHtlqkFdo0saAkep/6PXCXsKmZ7TYp/gNLtMCdTfWTPKc+8 8zaEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFYxnYK7Q2ECfgrFvZDLHupbKEwB0KzlHGkD4bVUz8dV5bJotNng9zomczRjzyJrI 2Q0jwEuwUiPlDx6uthfnpWWjS0LZR7uLVOiJJSjrc/rCnI4umf2nP077Aj0HFKuzFXdOO9 iq/wRRLw1AF2WoSq7ZjbeFNHtxmGwjkgBk+d3ju3t10sSZ6mkdvh7svM+pGmjmXD7Qap7H CKqt28oxZvPxroO59AJgRLBVwmC+DUtNsXlIXcAYiH7rBLa9NJaOJ2Tla671rl3Pan2a9T 5ig8QAlu2Li8SgD2rvFRiw2W5Ipr4nP3B3+Pt6WTk56AnufdQ9sOFRYCMXpvD3CSt+86Vi cucoLZp2tMxa6t4wewhn3F/ApVFFprxiAPtH9eOK3mEK5JtKHmxfecIWsUaiXQqkFX7sFo NSdoUq+vhZWnFxTnwJWFWN9uB+SYxqL31tgJSazDiv8cTYc6Bz5TRi0U+ix72SEwuwTNUi dEHT0kPMg/6JAnvYRp8rLBTxL5wvNqD2Nkfl3lVCFGnOSGT0HO9HvwfUpkOHHmYtRS0Oqi LnpiYPzBP0A6xAeW7FCT3DABV8xWiqyee6Ih2mNp0GnPaG/r/C3Ph70yv6hqWhoc4jttHF fvAtxhuDvVOlT+8sqYli5u+anExVstOH9jPLIo4opw5k3ZHwiLC/5zT0abgA X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:42:54 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 09/10] arm64: dts: rockchip: rk3576: add NPU (RKNN) nodes Date: Wed, 12 Aug 2026 21:41:04 +1200 Message-ID: <20260812094106.1391698-10-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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" Add the two RKNN cores and their IOMMUs, plus the NPU power-domain resets the pmdomain driver now cycles on power-on. Both cores are disabled by default; boards enable what they wire up. Each core lists both NPU power domains, its own first. The compute path needs NPU1 powered even when only core 0 runs, and a node with a single domain would be auto-attached by the driver core before the driver can attach the list itself. The IOMMUs keep one domain each, since they rely on that same auto-attach. Signed-off-by: Jiaxing Hu --- arch/arm64/boot/dts/rockchip/rk3576.dtsi | 80 +++++++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts= /rockchip/rk3576.dtsi index b0c0d3c8b..1e6dd039f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi @@ -1070,14 +1070,22 @@ power-domain@RK3576_PD_NPUTOP { power-domain@RK3576_PD_NPU0 { reg =3D ; clocks =3D <&cru HCLK_RKNN_ROOT>, - <&cru ACLK_RKNN0>; + <&cru ACLK_RKNN0>, + <&cru CLK_RKNN_DSU0>, + <&cru ACLK_RKNN_CBUF>, + <&cru HCLK_RKNN_CBUF>; + resets =3D <&cru SRST_A_RKNN0_BIU>; pm_qos =3D <&qos_npu_m0>; #power-domain-cells =3D <0>; }; power-domain@RK3576_PD_NPU1 { reg =3D ; clocks =3D <&cru HCLK_RKNN_ROOT>, - <&cru ACLK_RKNN1>; + <&cru ACLK_RKNN1>, + <&cru CLK_RKNN_DSU0>, + <&cru ACLK_RKNN_CBUF>, + <&cru HCLK_RKNN_CBUF>; + resets =3D <&cru SRST_A_RKNN1_BIU>; pm_qos =3D <&qos_npu_m1>; #power-domain-cells =3D <0>; }; @@ -1832,6 +1840,74 @@ qos_npu_m1ro: qos@27f22100 { reg =3D <0x0 0x27f22100 0x0 0x20>; }; =20 + rknn_core_0: npu@27700000 { + compatible =3D "rockchip,rk3576-rknn-core"; + reg =3D <0x0 0x27700000 0x0 0x1000>, + <0x0 0x27701000 0x0 0x1000>, + <0x0 0x27703000 0x0 0x1000>; + reg-names =3D "pc", "cna", "core"; + interrupts =3D ; + clocks =3D <&cru ACLK_RKNN0>, <&cru HCLK_RKNN_ROOT>, + <&cru CLK_RKNN_DSU0>, <&cru PCLK_NPUTOP_ROOT>, + <&cru ACLK_RKNN_CBUF>, <&cru HCLK_RKNN_CBUF>; + clock-names =3D "aclk", "hclk", "npu", "pclk", + "aclk_cbuf", "hclk_cbuf"; + resets =3D <&cru SRST_A_RKNN0>; + reset-names =3D "srst_a"; + power-domains =3D <&power RK3576_PD_NPU0>, <&power RK3576_PD_NPU1>; + iommus =3D <&rknn_mmu_0>; + status =3D "disabled"; + }; + + rknn_mmu_0: iommu@27702000 { + compatible =3D "rockchip,rk3576-iommu", "rockchip,rk3568-iommu"; + reg =3D <0x0 0x27702000 0x0 0x100>, + <0x0 0x27702100 0x0 0x100>; + interrupts =3D ; + clocks =3D <&cru ACLK_RKNN0>, <&cru HCLK_RKNN_ROOT>, + <&cru CLK_RKNN_DSU0>, <&cru ACLK_RKNN_CBUF>, + <&cru HCLK_RKNN_CBUF>; + clock-names =3D "aclk", "iface", "npu", + "aclk_cbuf", "hclk_cbuf"; + #iommu-cells =3D <0>; + power-domains =3D <&power RK3576_PD_NPU0>; + status =3D "disabled"; + }; + + rknn_core_1: npu@27708000 { + compatible =3D "rockchip,rk3576-rknn-core"; + reg =3D <0x0 0x27708000 0x0 0x1000>, + <0x0 0x27709000 0x0 0x1000>, + <0x0 0x2770b000 0x0 0x1000>; + reg-names =3D "pc", "cna", "core"; + interrupts =3D ; + clocks =3D <&cru ACLK_RKNN1>, <&cru HCLK_RKNN_ROOT>, + <&cru CLK_RKNN_DSU0>, <&cru PCLK_NPUTOP_ROOT>, + <&cru ACLK_RKNN_CBUF>, <&cru HCLK_RKNN_CBUF>; + clock-names =3D "aclk", "hclk", "npu", "pclk", + "aclk_cbuf", "hclk_cbuf"; + resets =3D <&cru SRST_A_RKNN1>; + reset-names =3D "srst_a"; + power-domains =3D <&power RK3576_PD_NPU1>, <&power RK3576_PD_NPU0>; + iommus =3D <&rknn_mmu_1>; + status =3D "disabled"; + }; + + rknn_mmu_1: iommu@2770a000 { + compatible =3D "rockchip,rk3576-iommu", "rockchip,rk3568-iommu"; + reg =3D <0x0 0x2770a000 0x0 0x100>, + <0x0 0x2770a100 0x0 0x100>; + interrupts =3D ; + clocks =3D <&cru ACLK_RKNN1>, <&cru HCLK_RKNN_ROOT>, + <&cru CLK_RKNN_DSU0>, <&cru ACLK_RKNN_CBUF>, + <&cru HCLK_RKNN_CBUF>; + clock-names =3D "aclk", "iface", "npu", + "aclk_cbuf", "hclk_cbuf"; + #iommu-cells =3D <0>; + power-domains =3D <&power RK3576_PD_NPU1>; + status =3D "disabled"; + }; + gmac0: ethernet@2a220000 { compatible =3D "rockchip,rk3576-gmac", "snps,dwmac-4.20a"; reg =3D <0x0 0x2a220000 0x0 0x10000>; --=20 2.43.0 From nobody Tue Sep 29 04:40:05 2026 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 4E0C0415F3B; Wed, 12 Aug 2026 09:43:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527794; cv=none; b=MVX0rewBlsFePiNtBHHymVdSHLbRFTx0u/BdcF3bAjEa9wbl71Yu0YNuoILOAlijQ11/dc0lRzW1+67eLGEm67V9+IgJKxr7jVBFpnIgrErKkpVvzr+jgEI0HTqKQ7GUkoHtPGnAEMUHYbkP56Lr+yXGlUcruXZC4IepGn302tA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527794; c=relaxed/simple; bh=U4X+rhj/sXR+vtuG+XLMw3JDpabQzZVg4RMgkgdiYpU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WM5WHRChNAR1wJt54nr0rzX2N3y8pZwxpbr4ibCC9S9giJuXZcHE1rPxQTbpNosPwv/CjFAcnO1FW52UNJI9XQWA8ke5splVVrqWVCqKw1y7AUgXcF2kLB+/9RFePTbf/3AFQI6x7qIYiCQ9e5z+2RTeWbhgN0z+iIAAVWig2Ek= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com; spf=pass smtp.mailfrom=gahingwoo.com; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b=kZrsis23; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fj9Wn+op; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gahingwoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gahingwoo.com header.i=@gahingwoo.com header.b="kZrsis23"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fj9Wn+op" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailflow.stl.internal (Postfix) with ESMTP id ED79A1300228; Wed, 12 Aug 2026 05:43:11 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 12 Aug 2026 05:43:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gahingwoo.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1786527791; x= 1786531391; bh=sgu7nAbq8Yx5koaOMKJWboxHdobCAGSow6z6pMfKPGU=; b=k Zrsis232bZfkHFr1KDQEA5RwQSh3Y+f3GqvVYV7nKQF+6G0Db3fpwDhWBdtp3lDq 51zIJWwgEXcvKId6UezziixDbqKveDd6V1ji4kHTgSOF26xGwYCj0PcUHFEZa71k iTH8ZYcceh7LhhvZwL41kxlsdVUgIP2Be8z0ESAYFnC2DexiqoU3EcreOKbm8Uj/ CICkhL73XQ2G1xyhOtKjLVvNHT9VLmqDB+npmjB3hwgkItvYSxAUMAaWIRRLgPK2 tccFNYPinP0Y2ZihHkYA9cAlXoYPw3fk267y+9RCWiXz3K1/w/PAkyAIQq5h9jMU bLQiOC7C/anypjjDOKaFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1786527791; x=1786531391; bh=s gu7nAbq8Yx5koaOMKJWboxHdobCAGSow6z6pMfKPGU=; b=fj9Wn+optE2/3n76F GwQmq0VW+w7empB07ErfPqBxlWq9ur47tekxJR6whVcMUm1hAmYtmqN4yM4+99jq xirk16UW8EvC2ZjyK0EzOFKZaGg8I3j84XXmvFYl2dera6KFC0HgA/TS7NI/wTxf RG5xxr/Kkj4NB+NmgIgxy+gfczwrRE6ljtMWREL9fxY7cScuIoSCuwUqdAM1ahdI X5w099A9V9iCdYhr5XBONEUrsd/GY5fb3FnO1mm769rUsuRJBwTxJ7h7SvQABjc7 KDnoc+dctpJpQ3eoNBB+W0nq63hciWa4hAjo1UKinI/AxGIAN29fdMJlbqV3UIgJ EqAPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTF94piGrtEjR6BqnUD01iAoRBrq3noUWIXMrqVxBmNdzc8ysXT9N2YVYtRNqawTRu 5Tl3rQYplDYkQz64yVDsKNFMVYgL9BKpjjZZz3bLRD/+XGC1BZ3Esv0AwJfhbuLnvweNXe XninG/a9vIk48teTHN+BtpEclMrlsHF+QX/6PBrRNtzjC6rQ0Gl0MN/erogFMCvHGI9gfF BkOzoGqrWELCUvV5BiizkhvRpEK4YW2BzI/XolsWW1gtttmqOJiC2cJo6UXJpqakqxIwIs 8bcD7GpDqISPzyFOIa2Ga/vPqf873UUD6g1hGqz8oQ9p48/ytHS5CEh/RcSEIGrpol2DrH 6wED6MbxOsSxo5qHTy3DjNvG9D1ESABJOX1YgrTau1f828XznckthGzgOJFm/VJerZ2KRh 6MYj74k9l/GCR+f5kepX73FH4E4lIhikDx1yVrlQzT8cnR6Qg4t5bOfaxDulRH3zgGGY4Z qdQmvzP+L8MZyiqj1/viBgy3hq0FbbB6zuhmk/7mOIITFHjCVIvKwV4Ure2tXfpUiyk69M CGKgSuV5whQWF3SlRMam8TUpON6jdVgzZuAWsTJey+xSYXzXSA2Iq4fqo0AxIGV0kOHTsK ob0JPKE7vP38iddd4Xe8UTkkvVRsKIVtBc6I5J3qyAKvUkmBRHB6Y1Gu/TUw X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 05:43:04 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org, zhangqing@rock-chips.com Cc: royalnet026@gmail.com, alchark@flipper.net, chaoyi.chen@rock-chips.com, diederik@cknow-tech.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [PATCH v7 10/10] arm64: dts: rockchip: rk3576-rock-4d: enable NPU Date: Wed, 12 Aug 2026 21:41:05 +1200 Message-ID: <20260812094106.1391698-11-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812094106.1391698-1-gahing@gahingwoo.com> References: <20260812094106.1391698-1-gahing@gahingwoo.com> 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" Enable rknn_core_0 and its IOMMU on the Radxa ROCK 4D and supply the core from vdd_npu_s0. The supply is marked always-on because the NPU power domains are what gate the block here, and dropping the rail underneath them takes an async SError on the next power-on rather than a clean retry. Only rknn_core_0 is enabled: the driver binds one core per node and the second core is left to whoever can test it. Signed-off-by: Jiaxing Hu --- arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts b/arch/arm64/b= oot/dts/rockchip/rk3576-rock-4d.dts index 272af1012..965e0906b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts +++ b/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts @@ -442,6 +442,7 @@ regulator-state-mem { }; =20 vdd_npu_s0: dcdc-reg2 { + regulator-always-on; regulator-boot-on; regulator-enable-ramp-delay =3D <400>; regulator-min-microvolt =3D <550000>; @@ -869,3 +870,12 @@ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { remote-endpoint =3D <&hdmi_in_vp0>; }; }; + +&rknn_core_0 { + npu-supply =3D <&vdd_npu_s0>; + status =3D "okay"; +}; + +&rknn_mmu_0 { + status =3D "okay"; +}; --=20 2.43.0