From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2B9A3246BCD; Sat, 12 Sep 2026 09:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789206678; cv=none; b=KiQRpSo/S9yr5gidMhoO4Zy0lkMHNmRnbA4Hi/9YE0b3SqYHb5OErHlrcy7H1/cJ9+LpipznT8qytGWdBcFbakjOQERdPfacS9dMd05OV/S55JsE+CEu7St3D9c9FjG4jYJwzSCG8gCz90GIPO3C3i3W8+aJcoY6uiSSfzNukiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789206678; c=relaxed/simple; bh=gdyZEdk8VG9zanJ7OGMe50Nunt7pATXvG3eHKdEjjxI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GNYyOWsHyywFUS+7br8/H6WHGYnn4XS2EgsR9VUtIjOdGsxA07XgXauNJlIIpoAZDp9PQfzolqAlfpf0a7aOMBQziTvLXLjYCJBXl1+djeoRQ2w+zygg4wwV8Tj9CgYjbHOl1RETtlDqe35pllKYpKfghhFtecpVGGiLlyspjTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aJ8rV/G8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="aJ8rV/G8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 109A31F000FF; Sat, 12 Sep 2026 09:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789206675; bh=po1/Yl28xucosBxPjmhW9FHNSoU8W8Haicj3c+H8bAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aJ8rV/G801fTTns/QxDUI8StfV1u6RnJu6bKdruQjRLX3W62gGBMqCpKPodQdG9Ag 8sG1zhFetFPxuxF/7s533d4isAhVanfzoD0HcaF9EQW3Wl8F6XFcb67Fbhu+QzhJDT ki7m4a0uM4tpO/z+O/lECFk3udqz5B5YTMznUVHA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Herman van Hazendonk , Dmitry Baryshkov , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.18 0256/1518] clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains Date: Sat, 12 Sep 2026 08:40:25 +0200 Message-ID: <20260912065629.274799581@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Herman van Hazendonk [ Upstream commit eea55fc694e132aacbe2cf4be7f345115e3d1801 ] GENPD_FLAG_ALWAYS_ON requires the underlying domain to be on at genpd_init() time -- the framework will refuse to register the domain otherwise. When the cold readback in gdsc_init() finds an ALWAYS_ON GDSC powered down, the driver tries to bring it back up: } else if (sc->flags & ALWAYS_ON) { /* If ALWAYS_ON GDSCs are not ON, turn them ON */ gdsc_enable(&sc->pd); on = true; } but discards the return value: if gdsc_enable() fails (regmap write error, the long-form sequence's status poll times out, or the HW_CTRL hand-off errors) the code still sets on=true and falls through to pm_genpd_init(..., !on) -- which then registers the domain in the ON state and sets GENPD_FLAG_ALWAYS_ON, even though the silicon is actually off. Subsequent consumer probes will see genpd report "on" while accessing dead registers and hang or read garbage. Catch the failure and surface it: returning the error from gdsc_init() makes the provider probe fail with the underlying errno, which propagates to consumers as -EPROBE_DEFER (or fatal if the hardware really is broken) rather than silently lying about the rail state. Signed-off-by: Herman van Hazendonk Fixes: fb55bea1fe43 ("clk: qcom: gdsc: Add support for ALWAYS_ON gdscs") Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20260602140934.796697-3-github.com@herrie.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/clk/qcom/gdsc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index b9b47f584f6d1..a80a489763edc 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -481,7 +481,9 @@ static int gdsc_init(struct gdsc *sc) } else if (sc->flags & ALWAYS_ON) { /* If ALWAYS_ON GDSCs are not ON, turn them ON */ - gdsc_enable(&sc->pd); + ret = gdsc_enable(&sc->pd); + if (ret) + return ret; on = true; } -- 2.53.0