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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D0BB1C7EE2E for ; Mon, 12 Jun 2023 19:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hq2pPFvgcsyW2e0q+HKC9VptsLY9gDlAXKI/Cap2j5w=; b=o8ylsILUVEIfWM +LKoo7arpnzzBq1ypgEMohxXyhaYy1jBlR7/4Co8hxxbf4GuSwfH6B24kwJbyFL7NWVQTdZ6gowHJ N17hiSn1c2w/PwpJh9Ytm64aPHX93a4H+LIDRQt+CXq3lDjSQ2z14QgPgWTbXZoXxvGbeHhV1ld5j MrYQuLcFs8pigbLzhyJ5BPSJl0/jU8pjbDdl6NJQt61fasyyb5Aqbf41cSIb6D1/zsUW5Na1gJXO3 2bK2EZ2H71Qc0OYWpT8qOVsVRQ6s6xYMtic/TRYUNLKb/B6Xsbhv7DSWvCvR5LbikHy39wGYpx6tJ WlEhFWgBRegTedodZnoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8n7O-0056Aq-0Y; Mon, 12 Jun 2023 19:22:22 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q8n7L-0056A8-33; Mon, 12 Jun 2023 19:22:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 781416177E; Mon, 12 Jun 2023 19:22:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D019DC433D2; Mon, 12 Jun 2023 19:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686597738; bh=i1X/5SIkx3TUQH2BftjUID6RqLc4AaNJ8SVBxImU+qM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=bi2/l7I3uexfPYcwzwPjmP6WlInrVSOIEPErDHEfmau5FFgzTv3XURlQ+XrDoOhqR BNeWLd4rf47bCIVqERocPaVAZtBvSONw8W8uqjG07XKI53IceZJsdRSsTu0kXdVGSf AA6ZqVIB50Pqg5I2rADg/IaqWRza3RPDVSCrqJsUrdiEUg5E6b4i+ArFwKKHbduA8O xbk5glj70s1aLaOgIsgNvtIwR2tw1uS6Udl/nAEQOlH5T/Nl43Vq599cgJqub29A8G Ul8iJDHEk9iUsUj/KuMRa/lT3TlreilB0X96l4Yp5LvIKCZYkA4u1xPPgwwazfR/sq oCXuKjX6fW+Rg== Message-ID: <83fa171f45654606c1911d2c0d8b5871.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <20230517-fix-clk-index-v3-1-be4df46065c4@baylibre.com> References: <20230517-fix-clk-index-v3-1-be4df46065c4@baylibre.com> Subject: Re: [PATCH v3] clk: mediatek: mt8365: Fix index issue From: Stephen Boyd Cc: Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Alexandre Mergnat To: Alexandre Mergnat , AngeloGioacchino Del Regno , Chen-Yu Tsai , Matthias Brugger , Michael Turquette Date: Mon, 12 Jun 2023 12:22:16 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230612_122220_023547_82D1FECC X-CRM114-Status: GOOD ( 17.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Alexandre Mergnat (2023-05-26 06:10:43) > Before the patch [1], the clock probe was done directly in the > clk-mt8365 driver. In this probe function, the array which stores the > data clocks is sized using the higher defined numbers (*_NR_CLOCK) in > the clock lists [2]. Currently, with the patch [1], the specific > clk-mt8365 probe function is replaced by the mtk generic one [3], which > size the clock data array by adding all the clock descriptor array size > provided by the clk-mt8365 driver. > > Actually, all clock indexes come from the header file [2], that mean, if > there are more clock (then more index) in the header file [2] than the > number of clock declared in the clock descriptor arrays (which is the > case currently), the clock data array will be undersized and then the > generic probe function will overflow when it will try to write in > "clk_data[CLK_INDEX]". Actually, instead of crashing at boot, the probe > function returns an error in the log which looks like: > "of_clk_hw_onecell_get: invalid index 135", then this clock isn't > enabled. > > Solve this issue by adding in the driver the missing clocks declared in > the header clock file [2]. > > [1]: Commit ffe91cb28f6a ("clk: mediatek: mt8365: Convert to > mtk_clk_simple_{probe,remove}()") > [2]: include/dt-bindings/clock/mediatek,mt8365-clk.h > [3]: drivers/clk/mediatek/clk-mtk.c > > Fixes: ffe91cb28f6a ("clk: mediatek: mt8365: Convert to mtk_clk_simple_{probe,remove}()") > > Signed-off-by: Alexandre Mergnat > --- Applied to clk-fixes _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel