Received: by 2002:ac2:48a3:0:0:0:0:0 with SMTP id u3csp559698lfg; Fri, 11 Mar 2022 13:15:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8P7Dd1qBZQXa9gTtVMdIEyCy1jFJ6bJiNZhZtOzRxcVHjO0BB1eKpXRKM0RW+Z5e9KV0f X-Received: by 2002:a17:902:ccc1:b0:151:fbe6:4982 with SMTP id z1-20020a170902ccc100b00151fbe64982mr12349841ple.124.1647033351075; Fri, 11 Mar 2022 13:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647033351; cv=none; d=google.com; s=arc-20160816; b=g1WipID8OrGr6xEK45JLcVgY2iznLPZmRCBEzgSOpYaDVPznwCWnZjm0lNSfpBoJRB /dUyBLB7tFcgml8ZDhCSH4xTSuBn35a0AObAl7z20oUib6+CnA7ooNoQCIx8fyZb3Rtn rGfmF7PtzqbQ+1Ln26t7HqTeKk2oyy1ZzjHJf89tEGEPkm8s8Gcp/zOQ3Rz1O2jK5xvx VfOyl/OQ+W+qXY+yeekArDiiV3feR0b4dPWDqts0GtbVgTcjjXevUN628dNfVYN/W6iS RBlmIetG+4D0j9A3H/qOIUM2XAdEuXUW6kR2/yid2oVutyVqZLl8v7DfBbVlEscOaFNd GKqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=WwvaVhWqbBQhWF91M7hVQ+rVm8o4SZRRgF3+0T8i4gs=; b=iGq1QvJ2nVblC86z5jVkibJzOPS8LJFQyStBh8l8IX8GSM5K6EMbYSPNvVyDy4wG7Z aD90Si21RhDqt+y+p28BnDOBm6upClATYv5IbADfO35iXTeA2sVt5Hz1w9RVJkNWwREQ DVo1FqPaXAJWhplS8W4tzCmN0BG5rL6c3bRUx/HJSgL3OrZgVvWJ9DAiSrQjAOleUDIj PwSbeuL44f0NXP0IU+cCjWQbl8GxsWknV2YSx839HdNc2RyAwgIERJsIhRk/BIAwY8OK pcwTxToFdqU4h8drvhENTtECtizbCF8r3r2M+amS2BVhKpp3sc0F4mEaYXfLh60tkcUB 0F/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mleia.com header.s=mail header.b=kBKz9ja3; dkim=pass header.i=@mleia.com header.s=mail header.b=kBKz9ja3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d17-20020a170902b71100b00151edff7db5si8301805pls.264.2022.03.11.13.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:15:51 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@mleia.com header.s=mail header.b=kBKz9ja3; dkim=pass header.i=@mleia.com header.s=mail header.b=kBKz9ja3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61C7F202397; Fri, 11 Mar 2022 12:54:42 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349046AbiCKOII (ORCPT + 99 others); Fri, 11 Mar 2022 09:08:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241882AbiCKOIG (ORCPT ); Fri, 11 Mar 2022 09:08:06 -0500 Received: from mail.mleia.com (mleia.com [178.79.152.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17DBA1C57ED; Fri, 11 Mar 2022 06:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mleia.com; s=mail; t=1647007621; bh=X7QPQb+htRz7ijlZAL5/j6af/llFgL+z+jlTnD4er04=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kBKz9ja3yPteYgNxZud4I+jBYVWeHmLpYWX7faXPvY8ysYCgTW3HdxfoK6Ru26Ilp S3T/OJCsZG6LU72Iwb2B6bZztPdVGwdLfnRrbgJMOjFVyp0HCoZJgu55vnzXkaKakf fVz/G54FbP2iwqdVSH9e9C1kpJmGNqmjQ9J/ScAz9ygAhutzqN8DDrOdwOcFUs3G2N /Zuyx5DhuN85emmNwT9dgBWl2d3qOgnqlNNLumCbfv1tWAtUogTcCAtQu5uf2MoPCJ GC5yzsNRNFFPLwHDFcdn53ruuU7rPqOGc6DdHWnU3zRKbovRG1tpIgn+xJUF79Lqph U6udsEk3xTeQA== Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 993C339E985; Fri, 11 Mar 2022 14:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mleia.com; s=mail; t=1647007621; bh=X7QPQb+htRz7ijlZAL5/j6af/llFgL+z+jlTnD4er04=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kBKz9ja3yPteYgNxZud4I+jBYVWeHmLpYWX7faXPvY8ysYCgTW3HdxfoK6Ru26Ilp S3T/OJCsZG6LU72Iwb2B6bZztPdVGwdLfnRrbgJMOjFVyp0HCoZJgu55vnzXkaKakf fVz/G54FbP2iwqdVSH9e9C1kpJmGNqmjQ9J/ScAz9ygAhutzqN8DDrOdwOcFUs3G2N /Zuyx5DhuN85emmNwT9dgBWl2d3qOgnqlNNLumCbfv1tWAtUogTcCAtQu5uf2MoPCJ GC5yzsNRNFFPLwHDFcdn53ruuU7rPqOGc6DdHWnU3zRKbovRG1tpIgn+xJUF79Lqph U6udsEk3xTeQA== Received: from [192.168.1.102] (88-113-46-102.elisa-laajakaista.fi [88.113.46.102]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mleia.com (Postfix) with ESMTPSA id 371DA39E948; Fri, 11 Mar 2022 14:07:01 +0000 (UTC) Subject: Re: [PATCH v2 3/3] ARM: dts: lpc32xx: Update spi clock properties To: Arnd Bergmann Cc: Kuldeep Singh , Olof Johansson , SoC Team , Rob Herring , DTML , Linux ARM , Linux Kernel Mailing List References: <20220311093800.18778-1-singh.kuldeep87k@gmail.com> <20220311093800.18778-4-singh.kuldeep87k@gmail.com> <4aae560d-d266-d0d0-136f-32891b15bc01@mleia.com> From: Vladimir Zapolskiy Message-ID: <4f39f086-1932-1729-8761-d5c533356812@mleia.com> Date: Fri, 11 Mar 2022 16:07:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20220311_140701_650581_6E8DF4CB X-CRM114-Status: GOOD ( 29.83 ) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/11/22 3:38 PM, Arnd Bergmann wrote: > On Fri, Mar 11, 2022 at 2:20 PM Vladimir Zapolskiy wrote: >> >> On 3/11/22 11:38 AM, Kuldeep Singh wrote: >>> PL022 binding require two clocks to be defined but lpc platform doesn't >>> comply with bindings and define only one clock i.e apb_pclk. >>> >>> Update spi clocks and clocks-names property by adding appropriate clock >>> reference to make it compliant with bindings. >>> >>> CC: Vladimir Zapolskiy >>> Signed-off-by: Kuldeep Singh >>> --- >>> v2: >>> - New patch with similar changeset >>> - Send to soc ML >>> >>> arch/arm/boot/dts/lpc32xx.dtsi | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi >>> index c87066d6c995..30958e02d5e2 100644 >>> --- a/arch/arm/boot/dts/lpc32xx.dtsi >>> +++ b/arch/arm/boot/dts/lpc32xx.dtsi >>> @@ -178,8 +178,8 @@ ssp0: spi@20084000 { >>> compatible = "arm,pl022", "arm,primecell"; >>> reg = <0x20084000 0x1000>; >>> interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; >>> - clocks = <&clk LPC32XX_CLK_SSP0>; >>> - clock-names = "apb_pclk"; >>> + clocks = <&clk LPC32XX_CLK_SSP0>, <&clk LPC32XX_CLK_SSP0>; >>> + clock-names = "sspclk", "apb_pclk"; >> >> In fact I'm uncertain if it is the right change, could it happen that the commit >> cc0f6e96c4fd ("spi: dt-bindings: Convert Arm pl022 to json-schema") sets a wrong >> schema pattern? > > Good pointm this doesn't quite seem right: it is unlikely that the same clock > is used for both the SPI bus and the APB bus. > >> Apparently just one clock is wanted on all observed platforms and cases, this >> is implicitly confirmed by clock handling in the drivers/spi/spi-pl022.c : >> >> pl022->clk = devm_clk_get(&adev->dev, NULL); >> >> So, I would vote to fix the device tree bindings schema. > > Isn't this just using the wrong name? The name of the macro > LPC32XX_CLK_SSP0 might indicate that this is indeed the SPI clock > rather than the APB clock, so we only need to change clock-names > property here and leave it unchanged otherwise. Yes, the name is wrong, here I'm ready to take the blame: Fixes: 93898eb775e5 ("arm: dts: lpc32xx: add clock properties to device nodes") Noteworthy the commit above presets the same clock name to other PrimeCell controllers, namely pl110 (LCD), pl080 (DMA), pl175 (EMC) and pl18x (SD), plus this one pl022 (SSP), and all but SSP and SD are AHB slaves in fact. On LPC32xx the bus clock source and function clock source for SSP is HCLK. My guess is that the misnamed "apb_pclk" migrated into the schema from the lpc32xx.dtsi, so I'd suggest, unless some platform really needs it, firstly fix the schema by removing "apb_pclk" clock. It will leave just one clock, so "clock-names" property can be set as optional, and the drop the property from the lpc32xx.dtsi. > Looking at the driver, I also see that this refers to the clock as > "SSP/SPI bus clock", and it reads the rate from that. Yes, that's correct, it's a SPI bus clock with an option to set a rate. > In case of the LG platform, my impression is that the clocks listed > in DT don't reflect the system at all, they all refer to the same > fixed clock node at 198000000HZ, which is also used as for the > UART and timer nodes. Changing the name on that one doesn't > really make it correct, but should not hurt either. > > Arnd > -- Best wishes, Vladimir