Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3309483pxp; Mon, 14 Mar 2022 16:12:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM9D2wKObRYO4pepJcEiM2l9gpkPFZi4fxyYb5OBemdZ/ugNXwD12DWq9q2jgmT0RZqjtB X-Received: by 2002:a17:906:c141:b0:6da:b786:3fd4 with SMTP id dp1-20020a170906c14100b006dab7863fd4mr20038498ejc.16.1647299578063; Mon, 14 Mar 2022 16:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647299578; cv=none; d=google.com; s=arc-20160816; b=kZpkbhZq+LMPsBZkbkFpPjEHOom8dffGko/n8uqVmhkOrnaOxBXHSjbKD4Ff26SkbY doN6VXt+L9m695hKqH4e1d2oN/bT46GRwEyxf+xK8mRfGThQcV6Nvu4/G1Uo3PnSY/U3 2voeO+qLax7VZ7QUE5QRM+Nt1ub1JfH91Ntwng362X4QS8N8xiwp3LWKqQ/pv2Bn3F8w m7u+L2j1/ZUdeUDm0zvlqCv6VKNc2fT5neNnU0OXXSOqXbg8BaTtBZV4lgILyou633zo bAONUBL6kobr06uCXSk633GBOc0Iik3fT9741BViJ+4uBs6bnAsDH3H021hGt4qacbIr dp+A== 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=eh6S6WcpijNuaXbX4Ps3Z3zqtZd8wXLyqQ8RkHAPiLY=; b=rpIKR7OyKXOZAxDZhjWx3xQqRw0pWfjZANTg0ff+W+uiWq6xgy7oF3eEOVW2VSyjsU I8YxqVgcZ05E9Ew0FWWph0eQjXUcmaZxd3KY+j4jletzj6RyE3f5N4Pe/tRroQHG3+uo vTVlxhmCQCg/gtCRXupaY1cKl51O0qjkA8+6lgAgYVgN4KYAeyG1GL0iFNVmYkUw4PEW jj0TdQ5IHn2H4pz74lEfnD4eM2+HNI+aGBR77VtLuDBHHSFaJ+QZMlDbKSh378k9UxhS IRuEhDMa0+6ibU1ydU+puYxHCpVKiW1/jejbHqyI3d7ri6f7nApwQSsGHc2sNt3lXV7B MtgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mleia.com header.s=mail header.b=AgZiSbFW; dkim=pass header.i=@mleia.com header.s=mail header.b=AgZiSbFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a056402070900b0041288e4c9c7si9879183edx.425.2022.03.14.16.12.31; Mon, 14 Mar 2022 16:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mleia.com header.s=mail header.b=AgZiSbFW; dkim=pass header.i=@mleia.com header.s=mail header.b=AgZiSbFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239673AbiCNLwK (ORCPT + 99 others); Mon, 14 Mar 2022 07:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237669AbiCNLwJ (ORCPT ); Mon, 14 Mar 2022 07:52:09 -0400 Received: from mail.mleia.com (mleia.com [178.79.152.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA8894248A; Mon, 14 Mar 2022 04:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mleia.com; s=mail; t=1647258628; bh=GtsB4TOTZnpDMJPELTq7dOZ3rmRKKz7l2a4k/YVXQvQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AgZiSbFWqG/k3zSDKqmLUjtMw5Jej+nIYcXmKQmEABKFf3Y/+uZr0qAx4Pi4stSuA Lh+bChPOqa6KHj8inngZTROaxCxwgxWYneV7TnJTwcU0XokSfy6PBlaNfuubu9I9ao ipOzjPU+JKAXba+A7P0j2JSIDZ9Ov6fJdFi6LV2E1kpy/9Mm1yOlO9raV6/wOKWHXI gejv1dKdW4jbUEgI777zo8s4wmiKt+JHJU0QhufasvGMCsiRb/6soRNvziMa/YLHxh 9nAQ/wzeEO3sRypTWJ/nJB2zQrbNiWd7tWPwGNQgBPpGfFsIUYk021JcMIeCO5RJ2Z uKqtktF9gGzrA== Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 3898339F2BB; Mon, 14 Mar 2022 11:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mleia.com; s=mail; t=1647258628; bh=GtsB4TOTZnpDMJPELTq7dOZ3rmRKKz7l2a4k/YVXQvQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AgZiSbFWqG/k3zSDKqmLUjtMw5Jej+nIYcXmKQmEABKFf3Y/+uZr0qAx4Pi4stSuA Lh+bChPOqa6KHj8inngZTROaxCxwgxWYneV7TnJTwcU0XokSfy6PBlaNfuubu9I9ao ipOzjPU+JKAXba+A7P0j2JSIDZ9Ov6fJdFi6LV2E1kpy/9Mm1yOlO9raV6/wOKWHXI gejv1dKdW4jbUEgI777zo8s4wmiKt+JHJU0QhufasvGMCsiRb/6soRNvziMa/YLHxh 9nAQ/wzeEO3sRypTWJ/nJB2zQrbNiWd7tWPwGNQgBPpGfFsIUYk021JcMIeCO5RJ2Z uKqtktF9gGzrA== 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 C772F39F095; Mon, 14 Mar 2022 11:50:27 +0000 (UTC) Subject: Re: [PATCH v2 3/3] ARM: dts: lpc32xx: Update spi clock properties To: Robin Murphy , 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> <4f39f086-1932-1729-8761-d5c533356812@mleia.com> From: Vladimir Zapolskiy Message-ID: Date: Mon, 14 Mar 2022 13:50:27 +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: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20220314_115028_255450_969A516C X-CRM114-Status: GOOD ( 26.74 ) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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/14/22 1:43 PM, Robin Murphy wrote: > On 2022-03-11 14:07, Vladimir Zapolskiy wrote: >> 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. > > No, "apb_pclk" is part of the common AMBA binding, and is required by > the "arm,primecell" compatible. You won't (usually) find it referenced > in drivers because it's dealt with by amba_get_enable_pclk() via > amba_probe(). > Thank you, it explains, why "apb_pclk" is required for all PrimeCell controllers on the SoC. Nevertheless, in commit 93898eb775e5 it was misidentified with the sspclk clock, the latter one is the only clock explicitly utilized by the driver in 2015 and till today. Fixes in dts files should be preceded by a fix in the driver. -- Best wishes, Vladimir