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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 849EBC79F82 for ; Tue, 8 Sep 2026 22:05:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 862AD10EDB3; Tue, 8 Sep 2026 22:05:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="caULk3RE"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id D902010EDA0 for ; Tue, 8 Sep 2026 22:04:57 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 586D16022B; Tue, 8 Sep 2026 22:04:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D072D1F00A3A; Tue, 8 Sep 2026 22:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788905097; bh=pMwdKDpEcWsTGjIiaUuqOVn+pPdk1SNCMZVTViM1TFA=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=caULk3REutEieb20hePXT+BBppeQHgxSaquW6i8m0kent+gWkj2fk1cG6x82iMZfy LgUbSlO2x0WomwE0CGXy2nO/9GMNcSVUOkkJ8/gp5dWQ5UP750WJMiZYvK66xI93q8 uCo7RlC1ZH2SUw5twkRM24ZTjIcUvwa0IPqDW0BRb0FtjD2kWOXImKyHsaCYkUbpUV nu60jvCNSeGXjHiWMAw8vAWGbAMOGRWcwQGIATXyhAEs9psH045S7RiLuEOqGfOWFC FJnX9D/RZCu+tMfg5VmIxl1BZepCCoqQYfzIi8rxwLjuzG9+37gd/y+DVynNRolaH+ CmbhLp7hlIj8Q== From: "Rob Herring (Arm)" Date: Tue, 08 Sep 2026 17:04:41 -0500 Subject: [PATCH v3 04/22] accel: ethosu: Disable clocks on PM setup failure MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260908-ethosu-fixes-v3-4-490fe215286f@kernel.org> References: <20260908-ethosu-fixes-v3-0-490fe215286f@kernel.org> In-Reply-To: <20260908-ethosu-fixes-v3-0-490fe215286f@kernel.org> To: Tomeu Vizoso , Oded Gabbay , Frank Li , Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16-dev X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" ethosu_init() enables the clocks directly to reset and query the NPU before runtime PM takes over. If runtime-PM setup fails, the error path returns while those clocks remain enabled. Disable the clocks before returning the setup error to balance the initial direct resume. Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Rob Herring (Arm) --- v2: - new patch --- drivers/accel/ethosu/ethosu_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c index 2c8d735767b2..9d063daa1aa7 100644 --- a/drivers/accel/ethosu/ethosu_drv.c +++ b/drivers/accel/ethosu/ethosu_drv.c @@ -311,8 +311,10 @@ static int ethosu_init(struct ethosu_device *ethosudev) pm_runtime_set_autosuspend_delay(ethosudev->base.dev, 50); pm_runtime_use_autosuspend(ethosudev->base.dev); ret = devm_pm_runtime_set_active_enabled(ethosudev->base.dev); - if (ret) + if (ret) { + ethosu_device_suspend(ethosudev->base.dev); return ret; + } pm_runtime_get_noresume(ethosudev->base.dev); ethosudev->npu_info.id = id = readl_relaxed(ethosudev->regs + NPU_REG_ID); -- 2.53.0