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 C37FB33EAF3; Sat, 12 Sep 2026 18:41:18 +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=1789238479; cv=none; b=fNKJ/tmGEteFx8I7ZgiKtJHufxoB9oV6IA+l6/cteWujuS9VX7MMuJCRCG+uc9SbBTzmBY2MvpHs8ZRbYqjWTKP+4bWkdJmYcDbIITuTnmjs3B/LTWpvrOl6o0fnu0Fua0mK56hHicQMsVuIC4XQPaN8HO5YxhbmC63CIHKMUzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238479; c=relaxed/simple; bh=xBNtBCjltLZVdrFDj6Uz1HB6pwpq3R/0xJv9idaJRBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fH33YfkMCtB24aAsF4B9lTe7pkzgGjg5nR3SH0CguC2ePzGPQx6xuE/ViAx5/kcpGYqDAmRjzEwReXbbNTZ2NSo+mHXiU/2ugjFDWaXBAgWwuDOO/0ekzOC6hgUFXMvLOMeTZr7idNGYBqtIpyS2x1b+ihWNe7huCDC9nxFi8BU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H7Aqj4hX; 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="H7Aqj4hX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F5471F000FF; Sat, 12 Sep 2026 18:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789238478; bh=CPK9XPOsaQdd14HkX1r8kHmObW33dFATqFyvLSkSpQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H7Aqj4hXOPbJAnFVRxySf0gUR8+OBXg/0OClyvBEeRf856bqK0V7tMy4bUfjN+8zX /ZQ0EVw8uoFtP+ujNDS05Kceo9KQ+MqNlGUzFyCzs7jwppx1IV0hlV40Z3PS75u+CM dEtJ5/YfwgR7CUvPvMME7YaBRpCJOgZFXqkDCiPU= 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 5.15 470/935] clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains Date: Sat, 12 Sep 2026 08:58:20 +0200 Message-ID: <20260912065537.608043520@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@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 5.15-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 8dc3f70ef2e43..8282f27647168 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -416,7 +416,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