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 B82C72F531B; Sat, 12 Sep 2026 12:10:02 +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=1789215003; cv=none; b=l1uJkjjNlXiVqb8SfExfx2o0cxm9z0UURlVIPKRTBQnI1KHOl3z1yGBIQY0JcMCsWkzFWZyfoBw6CLKF0iFeNZxizpXfGJ/p+0c6RA6mVb18bPgDxLcX09bQ5WzyZgwZnYKf+dDxn2VGBMKiWMnRdp84+EJXfBgI/6RX8EUIgLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789215003; c=relaxed/simple; bh=80eEmhhFviTxeGnqlAZJH7gbc2bfPlWYOB7f9o7dxdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j+1LhPmHs8k26Dn1UmPwRPsC05P9kmhz3O04Lf3JpuQ6yVceiC3mDoNxiBWs1yU2iUaCr4hwu315c3iF9wG5UjFKvsL+3n8xCH6LMdbTK6Jzp57iypVRWfIQ84c4OFyS4q8xnIQgNimRXSyGMCVAzqpSJC7j+1V31n8mIsN+FH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yZyEEmVl; 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="yZyEEmVl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC8F71F000FF; Sat, 12 Sep 2026 12:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789215002; bh=PAOgxwEShuZu5W9SKvZ4Fapi0reN0DWTd06jnZFYm+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yZyEEmVl89rACC/EVwRHaTCCpob2c0WOzc46BHSaq3u0QV/TelRS5pDbHYvuH9wmR r/vtiC+XaV7SEfbUUB2NRlr1cEbdicQ1exlLou7WdI2KsoK94Y2Sf3i+EKsccymN6y HMQzs+EXDz2BbpmQcN/pXKbH4/COudeAIQAWOmLE= 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.12 0442/1376] clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains Date: Sat, 12 Sep 2026 08:47:48 +0200 Message-ID: <20260912065617.384838039@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@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.12-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 c17aebb020706..119d96dfa853e 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