From patchwork Thu Sep 19 09:12:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13807551 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 C8E1FCE8D63 for ; Thu, 19 Sep 2024 09:18:47 +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: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:In-Reply-To:References: List-Owner; bh=Sqd7Bel5pNcmuCFPnkH9MdtgnVW8OZ7obvp4g2RziPw=; b=UwWAjH+8nl4thn G03dtMparcRQkrwOwFX4VIqw27Y+73ESXKP6LilnlSRUQOzQ9bPi8HnI2dW69edww3UHap25ZqsZi 3FDFV9Zk+Tp8UYF0cL14AwDa8WZHq37TlEFMNRVpn7IPH8ELHTVeDa9KaWrAHNYhnMm2RpESXjonJ H8S7SLL7KglhE44lcrimioLXt445j8gfMbAaLt8d489PXw5QuhfU2beKMizZzN0pCM+r+89cLHvIA 0BZBHBgHNNK8O3XScjRPPBANv286+IoKqbqWIZv9VMjoQoMREZC0Xht/xI12KSSXpurKOUvCinjhc ipZVttrzstkFUNX3RRXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srDJD-00000009twl-3acR; Thu, 19 Sep 2024 09:18:43 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srDJ8-00000009tt3-2B0m for linux-rockchip@lists.infradead.org; Thu, 19 Sep 2024 09:18:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1726737516; bh=AskcAs/7IGdGwwichZGEUf19/IkDbJsPg1sXinT/vnQ=; h=From:To:Cc:Subject:Date:From; b=Uj+yZL48c+2/7dlNfodatrWifsQHci+kVXeEswOFafkbW1gaiSB3vmQRydJ4ky8UV SufYL/CT+xxHuwgiUygHAW12uyeAcMnmEQEJaaeWdht12cJ0YVV3TaLeUUkinG2M82 wNiJxjxhZEJ0QOGzA+xv24t/A0dcrKxkzAs5cbGO10JiQph3alHjrXVz33qcxt8M+/ UD8JeWsH1pGJWTGzobirC0ZDYGEk/5/hO1Pmm2cgnHXfSxaQslv5nSE9xGg/lxS7j8 ayrMKfnwXupOupdeCz7EJ6Gvgw0NRLFS+uZEr1drc07kKDQzYzUAt8ZOjVrZ3NXcP1 rVLbl/YwrMAUw== Received: from jupiter.universe (dyndsl-091-248-208-160.ewe-ip-backbone.de [91.248.208.160]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7B50117E107A; Thu, 19 Sep 2024 11:18:36 +0200 (CEST) Received: by jupiter.universe (Postfix, from userid 1000) id 57159480076; Thu, 19 Sep 2024 11:18:36 +0200 (CEST) From: Sebastian Reichel To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Ulf Hansson Cc: Elaine Zhang , =?utf-8?q?Adri=C3=A1n_Mart?= =?utf-8?q?=C3=ADnez_Larumbe?= , Boris Brezillon , Chen-Yu Tsai , devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v2 0/6] Fix RK3588 GPU domain Date: Thu, 19 Sep 2024 11:12:41 +0200 Message-ID: <20240919091834.83572-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_021838_930933_E0844CB7 X-CRM114-Status: GOOD ( 17.38 ) 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: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Hi, I got a report, that the Linux kernel crashes on Rock 5B when the panthor driver is loaded late after booting. The crash starts with the following shortened error print: rockchip-pm-domain fd8d8000.power-management:power-controller: failed to set domain 'gpu', val=0 rockchip-pm-domain fd8d8000.power-management:power-controller: failed to get ack on domain 'gpu', val=0xa9fff SError Interrupt on CPU4, code 0x00000000be000411 -- SError This series first does some cleanups in the Rockchip power domain driver and changes the driver, so that it no longer tries to continue when it fails to enable a domain. This gets rid of the SError interrupt and long backtraces. But the kernel still hangs when it fails to enable a power domain. I have not done further analysis to check if that can be avoided. Last but not least this provides a fix for the GPU power domain failing to get enabled - after some testing from my side it seems to require the GPU voltage supply to be enabled. I'm not really happy about the hack to get a regulator for a sub-node, which I took over from the Mediatek driver. I discussed this with Chen-Yu Tsai and Heiko Stübner at OSS EU and the plan is: 1. Merge Rockchip PM domain driver with this hack for now, since DRM CI people need it 2. Chen-Yu will work on a series, which fixes the hack in Mediatek by introducing a new devm_regulator_get function taking an DT node as additional argument 3. Rockchip PM domain later will switch to that once it has landed Changes since PATCHv1: * https://lore.kernel.org/all/20240910180530.47194-1-sebastian.reichel@collabora.com/ * Collect Reviewed-by/Acked-by/Tested-by * swap first and second patch to avoid introducing and directly removing a mutex_unlock * fix spelling of indentation * fix double empty line after rockchip_pd_regulator_disable() Greetings, -- Sebastian Sebastian Reichel (6): pmdomain: rockchip: cleanup mutex handling in rockchip_pd_power pmdomain: rockchip: forward rockchip_do_pmu_set_power_domain errors pmdomain: rockchip: reduce indentation in rockchip_pd_power dt-bindings: power: rockchip: add regulator support pmdomain: rockchip: add regulator support arm64: dts: rockchip: Add GPU power domain regulator dependency for RK3588 .../power/rockchip,power-controller.yaml | 3 + .../boot/dts/rockchip/rk3588-armsom-sige7.dts | 4 + arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 2 +- .../boot/dts/rockchip/rk3588-coolpi-cm5.dtsi | 4 + .../rockchip/rk3588-friendlyelec-cm3588.dtsi | 4 + .../arm64/boot/dts/rockchip/rk3588-jaguar.dts | 4 + .../boot/dts/rockchip/rk3588-ok3588-c.dts | 4 + .../boot/dts/rockchip/rk3588-rock-5-itx.dts | 4 + .../boot/dts/rockchip/rk3588-rock-5b.dts | 4 + .../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 4 + .../boot/dts/rockchip/rk3588s-coolpi-4b.dts | 4 + .../dts/rockchip/rk3588s-khadas-edge2.dts | 4 + .../boot/dts/rockchip/rk3588s-orangepi-5.dts | 4 + drivers/pmdomain/rockchip/pm-domains.c | 129 +++++++++++++----- 14 files changed, 143 insertions(+), 35 deletions(-)