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 A309CC7EE32 for ; Tue, 30 May 2023 08:18:00 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S224TIbrM08d4nEUbE7E3hrrOX3h5v86okUM32a2lHI=; b=F4BLA+QkcdrgNk tt1POFwJ4rQ6flXzVGZACcY2DJAurbAfT7z6O/SE/ZxGFheVP7sizn9V35P3XVIbj7rhv31TXFsZc PgCfsou1a/EUS11yt/d4+jUSHOD/LmXkYHUJ1OPtlzbdLvUPv0EGwJh9Sz0/vYuCmw3upU+46h+7B a6lMim8GwDhzd903+OSdKUVJpm/4Ult51mR/THrrfk6iMmLbFPDvPrH14HGOArExHKoDja8ai6e80 Mi9rU1hC6fI9S12y1nWbPtFzADut40yXnuWEIB6Tnq5f+b1P0xwmmort5+/j4Ci0f4iYmbFWm18zw nCANiwQTrcT15se5Eopg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3uXx-00CtW0-0m; Tue, 30 May 2023 08:17:37 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3uXt-00CtS8-16 for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2023 08:17:34 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-974265a1a40so47698566b.0 for ; Tue, 30 May 2023 01:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1685434648; x=1688026648; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8Dej/FFOhlE209KZmIstjtLDQxOMnp2DLbpIJPYah0A=; b=rEufenXkmE+fxdBlKUC1YtyC9X07+Ci2rPmXRsV3WUV9jRjRbQuIrPDnNZvxSM2mxf X3RNTWjoWWpRxl8BL/JW5dYXMmPsneBLDl1Dmc6BP2bPa1lDf2bE33qwb4Prv3FsTbML /71z6JhU30309RGtVFkstiUwREa1kJ5ofNQ6vN5Dlh/dhVBM23xvaiD/ufCjCYPAjBF3 XI4+MVi9AXdyxrFKwYuvqgdQ96YEo1lXf5Xs7b+rTjAiHGiy8iOscayzY2bWxOH5iwrW pLzGv8SgZ58jXBhoR0tSMtOHn3g+APVxq/t6A9dCV+PFv/YPhbCNsejnl+LzPM1udCKI 1dZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685434648; x=1688026648; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8Dej/FFOhlE209KZmIstjtLDQxOMnp2DLbpIJPYah0A=; b=lkZ5KcP4F3VWBEH1wVirv/S3P51vixfH5HYtq/voskA44RzzpO/9Z+RfthKjyzc3cP y2nTJkUywowGatjBqdTb2nICkAXiKSuVHcPIc9fCNXQryNHq0P47QMe9sg8i/cE07sQR Fd7pVFk6RBB7FG2ZIL+qu6Pfs3UUjp+Zwf8FxVsoQe5p73jyXhbiOlqi1IyRsajI7d5+ y75UAvWSCwr63E5YNAYCntLY7iAQLzW8YH+tCvYJEuQH3e5/d0DRX1kBDrPR/S0tG+6I xl4fsxo7XkD3rXpiVGbkNG9HyCDQoAN3IkuoqsveYh6CUzQtBVw1t+34fSS+O7xYPXTi yyHQ== X-Gm-Message-State: AC+VfDwxrMrHeVvBxSay+B7Wb2mumYG99zxsPe6M9A0aEesV++pdgq5C mg6gXvqZQt9D/EfHRZiD0uTBJw== X-Google-Smtp-Source: ACHHUZ4yZU/IUfHWVCAaHSvVKWusYU73uAxcR1RUnuf/v1Ip6xt3HYUd1Y/9cpLkPOB1X4DLiH0K1A== X-Received: by 2002:a17:907:784:b0:96f:a412:8b03 with SMTP id xd4-20020a170907078400b0096fa4128b03mr1486035ejb.5.1685434648674; Tue, 30 May 2023 01:17:28 -0700 (PDT) Received: from blmsp ([2001:4090:a245:802c:bc2b:8db8:9210:41eb]) by smtp.gmail.com with ESMTPSA id f7-20020a170906494700b0095807ab4b57sm7116229ejt.178.2023.05.30.01.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 01:17:28 -0700 (PDT) Date: Tue, 30 May 2023 10:17:27 +0200 From: Markus Schneider-Pargmann To: Alexandre Mergnat Cc: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno , Chen-Yu Tsai , Conor Dooley , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v3] clk: mediatek: mt8365: Fix index issue Message-ID: <20230530081727.br3fm6zombgipjer@blmsp> References: <20230517-fix-clk-index-v3-1-be4df46065c4@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230517-fix-clk-index-v3-1-be4df46065c4@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_011733_380877_FDE3F3F3 X-CRM114-Status: GOOD ( 20.08 ) 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 On Fri, May 26, 2023 at 03:10:43PM +0200, Alexandre Mergnat wrote: > 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 Reviewed-by: Markus Schneider-Pargmann Tested-by: Markus Schneider-Pargmann Best, Markus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel