From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF2ECC55167 for ; Fri, 31 Jul 2026 04:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wQHmp6l4HrKAkS20G7O9iAMKKJTBCspwe1oz0p0ounE=; b=paD+5BtP2tEL7d +6JePntMHTHOBAM6hlQq0t0oM2Pnyko8B+oHNXwrJJud5LNBvjYBdUb5jSm54BULpH7ECUryRtNl3 HxfnCOL2wq/UAnKjZk7oErJ5V4kK/cApSJoa8iq7f5YL6kJZW6bcg46D13tBKqsyplXpI2EOVgk9p jbdDc5mMBLDHVjiGqvy/aqPpQxwknUXgglX9sABwFakuXt+99sJ+LorLYfakq2BEx4fxujXG/TTWt +BGqHUUzObKzU4Z5yEsKhFEUnpQUqhL0W78/WFCr9pHq+xXnASGL92G+5rhe07B4rnsc9aK5fImHq mzN6zh9Yvy59nP/AJkJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpeyT-0000000BkS9-1qDV; Fri, 31 Jul 2026 04:35:57 +0000 Received: from flow-a8-smtp.messagingengine.com ([103.168.172.143]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpeyD-0000000BkKe-2ClR; Fri, 31 Jul 2026 04:35:42 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailflow.phl.internal (Postfix) with ESMTP id BCDAD1380308; Fri, 31 Jul 2026 00:35:40 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Fri, 31 Jul 2026 00:35:40 -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=1785472540; x= 1785476140; bh=vfiH5V16AyO9stikNxuMC7UErEwVoICawUpn+9ckh+U=; b=L QpdNp8QE2ar35yEgP6yb6E4HWWAMOyaURlf2TfWLSE+weEgswKn9rengcJz3HcmH AA9MkKb1HYL1SMPduP/hSmmL0Y5348mqSVNDFNf7aS17bFh9AhwweCuLOGHkwi0U eEwCKDjBSieWoRjol0pyUGUL5H/ACCjnJ5MwcD3DQWxoU6S1GFRD+f76drHTVtWB JokOds7Gvb+r8z5fcXl1rNuLyN52PVErhFIjs0L4H1UnQPPYcqhoWvnfvmbJk6BR By6pkj/4KMM2rwBDBEDcqBhcEDWpezdyH89hp7OeCcyh4H6NIywf05Zo8cH0US6u hOfxSwFaRx3CkuJfEjyvQ== 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=fm2; t=1785472540; x=1785476140; bh=v fiH5V16AyO9stikNxuMC7UErEwVoICawUpn+9ckh+U=; b=CuMO39coTUAyumyaj SlaAcZC/Mymx3wM6Wfe/0iTWY3fR7Tmv+4BmtQpR1DgDGy7QiZ6cEF6thFK12gHe yHN8ZsyZOF/ICa9hxhfHvoH0odRAU4gEj66uH6h7VFIMeW4dYtApH+3GzdaPtyOE 81HxkK1xjnGSA3WBcfI5mt+ayIDzNAiN5e9JGr3UdhYzqUr3HTgMcefPOOzprzvA 1r5KVuhTPl92foC1TzJhwGAVYlq6YTg0Dn6pbL2ZQ3vW3Py/dGlTQ9T6CdMxFjOJ bae+bbkAcK6SO/4fjftJecHcANBfY8qgTMA4i1cgF3fnzkYNeCtOpt65sdPFRh+c /35Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGYT4kL28qB16BISDukPuRI13bgUTT3tZ+FwfFOi9iyRIQ4cdWQvs+qtyjYhb8aZv 7ZNLDkjsiNZpV57v6b2mii/c57NwdcNZfLGFST9tf2uM8u59dW+Prl9GdDUx4nV+E4lAra SQEwebYcIunW3qRo5j2tIFm46bFqTUlJGjqQ9G9vA9CMpIOxOxZMoG/yT+2+8464KOGHAY 8imDrR7vRedTQm5ukLhDfImc5hqq/PMdpFBDkbYJy2uWgqM9NADLHcVQwbEaQMfbuf/RMq 10+PB7Nd2itAuYvcdzVTZtUYUQ86psUPJqGvTKqOSymMowMLYjogTDdmqQ1+5Yqwyb6wmf JSvlG9/5D0DLlR/pyNn3qNI9clPJUCIQPSfVrLbDEDy12Hwb2Ew02t95WcEyH8rdV+gPQ/ KAStDW8gD0OCH+yNXkUruoT7cYZT7HBChdQ60aZSQpmrpUufga0MoYA8JEajqHUNZGhL/d K3RwtxLR+63GPIWLaxadlrNg3eGp8xSfFKV6DeQxnRVL71n3/5GVEHlnDG5N/diQKeLoZi UaAZteLXnMfFHiGWmemLlJWxwSNq6z4J9uoergRTA6AxAoz4g+HzQzztTkiozDSsWMmdNT t02O46JPd2qSwhloLX6Ah5iWO20ConyGtqVtw62rNAkZ5vTmNBC4k+PGQrMA X-ME-Proxy: Feedback-ID: i7a5e4b5f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 31 Jul 2026 00:35:34 -0400 (EDT) From: Jiaxing Hu To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, ulfh@kernel.org, p.zabel@pengutronix.de, ogabbay@kernel.org Cc: chaoyi.chen@rock-chips.com, alchark@flipper.net, royalnet026@gmail.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiaxing Hu Subject: [RFC PATCH v3 3/6] pmdomain/rockchip: cycle optional power-domain resets on power-on Date: Fri, 31 Jul 2026 16:35:04 +1200 Message-ID: <20260731043507.1832277-4-gahing@gahingwoo.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260731043507.1832277-1-gahing@gahingwoo.com> References: <20260731043507.1832277-1-gahing@gahingwoo.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260730_213541_636549_716D3B59 X-CRM114-Status: GOOD ( 13.41 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 access after a cold power-on; the vendor kernel cycles the domain's resets at this point and that 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 declare any behave exactly as before. 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/rockchip/pm-domains.c index e1857f878..82051f600 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; }; 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); + /* 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); } @@ -857,6 +866,14 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, if (error) goto err_put_clocks; + pd->resets = of_reset_control_array_get_optional_exclusive(node); + if (IS_ERR(pd->resets)) { + error = PTR_ERR(pd->resets); + dev_err(pmu->dev, "%pOFn: failed to get resets: %d\n", node, error); + pd->resets = NULL; + goto err_unprepare_clocks; + } + pd->num_qos = of_count_phandle_with_args(node, "pm_qos", NULL); @@ -927,6 +944,7 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *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; } @@ -945,6 +963,7 @@ static void rockchip_pm_remove_one_domain(struct rockchip_pm_domain *pd) clk_bulk_unprepare(pd->num_clks, pd->clks); clk_bulk_put(pd->num_clks, pd->clks); + reset_control_put(pd->resets); /* protect the zeroing of pm->num_clks */ mutex_lock(&pd->pmu->mutex); -- 2.43.0 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip