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 93F395013C9; Wed, 30 Sep 2026 16:07:09 +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=1790784431; cv=none; b=Tg8PKt9tLGOZGqSNq8/v5QPJBeERwXz2G8eIvxfv1e9f1Irfe5Amha5Kq0wJ5AtJDVTYWfnHvahViRibp9cuvecCK/JscQmKkimDHO6doht2a2t5sCqK4crFTdCcKH1pqQtoMir+sKW7+7QhjjjPgu77m1lj4yXelr0yvLqDbC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790784431; c=relaxed/simple; bh=qTAF7jn4L3zrmJIbTFp9WhJgTw7TXLo7bwdwQRwtZBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UVM9y4qNWwYqPDTymsvRkdp5HwgXtyc91UTr3hMtGX6fXEHvr7CFziEb1EqsdsvM9r4NURrQeXSob6jKJtmfHd+RwT9UqKL/pUpu1JwosK8ZUQhEBAs/WrXqqpGQ/J/ZsVMinmdDQrbXvSKSDBX2YrK4x+2bKfvE0oPfyKXs5r0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BeN/fN/K; 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="BeN/fN/K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE0211F000FF; Wed, 30 Sep 2026 16:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790784428; bh=JANyNZxGAP9Sqqd4H8USp1epUmxPMvDdgy+QD0T5x9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BeN/fN/Kz4CMKH96JfIJmo2utEBPRm6f5p40gF/A0YvE57s2vf2cIAIqUJPBOlki5 0qyMBpTHEtBVZ+Cszhhen05v+EjnkZ8gOQGAwSZ2Yz8jOfUvSFifIlwF7FMvBF97pw zKs+eV3iSUdCIZ8IRFh1IODv5g5OzaH0e3nBM5GA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Walle , Kevin Hilman , Randolph Sapp , Nishanth Menon , Antonios Christidis , Brian Masney , Sasha Levin Subject: [PATCH 6.1 151/982] clk: keystone: dont cache clock rate Date: Wed, 30 Sep 2026 17:14:47 +0200 Message-ID: <20260930152420.057594683@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Walle [ Upstream commit a80b32a140c8612bbaed27009c383d43304db6d5 ] The TISCI firmware will return 0 if the clock or consumer is not enabled although there is a stored value in the firmware. IOW a call to set rate will work but at get rate will always return 0 if the clock is disabled. The clk framework will try to cache the clock rate when it's requested by a consumer. If the clock or consumer is not enabled at that point, the cached value is 0, which is wrong. Thus, disable the cache altogether. Signed-off-by: Michael Walle Reviewed-by: Kevin Hilman Reviewed-by: Randolph Sapp Reviewed-by: Nishanth Menon Signed-off-by: Antonios Christidis Reviewed-by: Brian Masney Link: https://patch.msgid.link/20260507-clk-sci-v2-1-38f59b48777a@ti.com Signed-off-by: Nishanth Menon Signed-off-by: Sasha Levin --- drivers/clk/keystone/sci-clk.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sci-clk.c index 254f2cf24be21..e1d5c08564c2c 100644 --- a/drivers/clk/keystone/sci-clk.c +++ b/drivers/clk/keystone/sci-clk.c @@ -334,6 +334,14 @@ static int _sci_clk_build(struct sci_clk_provider *provider, init.ops = &sci_clk_ops; init.num_parents = sci_clk->num_parents; + + /* + * A clock rate query to the SCI firmware will return 0 if either the + * clock itself is disabled or the attached device/consumer is disabled. + * This makes it inherently unsuitable for the caching of the clk + * framework. + */ + init.flags = CLK_GET_RATE_NOCACHE; sci_clk->hw.init = &init; ret = devm_clk_hw_register(provider->dev, &sci_clk->hw); -- 2.53.0