Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9783831rwp; Thu, 20 Jul 2023 09:35:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlFgNNyhao8wI0piKKO8t2WajvzM0JvJsub46m0OK3aLgpkb6h0P5385NYzA2Wfbp+8ThL3A X-Received: by 2002:a17:906:1001:b0:997:e998:2d42 with SMTP id 1-20020a170906100100b00997e9982d42mr3056510ejm.20.1689870936564; Thu, 20 Jul 2023 09:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689870936; cv=none; d=google.com; s=arc-20160816; b=NJqgaPLcRDk9hdweSWCq8W4fZxh4qWgfcEjihvtSi7tsjP+tncjXjx8n1tkoAukpa+ dDufml0miXyQlfOHEi++G4Kl0PYWJgYmzgEzKOTlkFgZTtDcw3L0xBz+9s4sj+Z7ni+x WF0reNOr9wfx2LVBzn9HS3M9Ap0HKNfTLAUhisIRIr7lT0OX4Ms/IeJFizyIqZPV8sV3 ZYmGClNV1/4d7jbwn1oAHJjRTnLnbPW5bB6cgRdZifODMRnF6qgsmHgHNhoAVlNbMTr0 9Jp+VuWTpY73Cnyoc7X6ZnjnkblChAcbsXnGodh07DOmRlc+bpdVIScx3VFC4v3hxFy4 K4LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9aMlr2TJ9tqE4DxlY8mGGNPP5sVlQc3y0Pn8B34oL9c=; fh=LTWXkwssMvFuhGAoEX3zuLYFtKe9LWzQYC0Rgi/8vK8=; b=kSCfqlZJhGreXIWFQwNIgwGmNOPi4j/oeqTnuK9RUCGhXqlyCH0wzVvWlBtABuEXTX gqU27KxKitAlDcp/uW5a0ua37a75aTNbvfO0niBDX9FoQlY8CD/lqONpDVzGUHFhch/4 GvFbw122f0mfpOhdM4+4HG6khChZFlKbjy+3ViNjG6yG216OPnPyOJfFB3LJIXpGYmxN ME7r/2zUDl08dY7fLUwndX5jDYmaoCsYgROuKTZm0KdtDEYgcifJ/QNi6FF9wdqAD5Yw DgrbGaIjnaECnqdvWN9Bz+jPDcqj3+1yKTivKB8Te8Kx6HZfxCb60OExw76NFiNHi+LO eM1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bC+3WEN9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg10-20020a170906a04a00b0096633b5c0aesi875648ejb.809.2023.07.20.09.35.12; Thu, 20 Jul 2023 09:35:36 -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=@kernel.org header.s=k20201202 header.b=bC+3WEN9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232943AbjGTPqP (ORCPT + 99 others); Thu, 20 Jul 2023 11:46:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbjGTPqN (ORCPT ); Thu, 20 Jul 2023 11:46:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1012B134; Thu, 20 Jul 2023 08:46:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8082A61B5A; Thu, 20 Jul 2023 15:46:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2428CC433C9; Thu, 20 Jul 2023 15:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689867971; bh=a1PV8QZG/zqz27VM8jDoaoMF8mIYuM9C7Vx0332VoZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bC+3WEN9ZI0wkwc7yGRoolWyc3ChzR2nMBJZC/Cjqixxc4KDFlbDHxDaRXH9oAfFC dl+Kkb/qIwWjAMYhhh1iD3xZ+IrJCW6TL4sI9Eor6Is9ASrUIyx1UyhYUqsZgF3CbN cXAjFChx0VsNjBGHwKS1J/HZwmcYjSmVCwY/dvH/K96gDisIapllbW227oslHHCrAv bHDiYWA9m9WGb/m64LCLtTNFhKIT+T1Nh4bsOlNnSf0XIaMbfE/IacLkY4Y9dewRTU PDPKag7MFeYItwqXg84yXip/m2ZHwjZrTVZ3KNL30U/10TcVxpNiIgpmEF58GJUc0o p8zgiptEO42Lw== Date: Thu, 20 Jul 2023 16:46:06 +0100 From: Mark Brown To: Martin Kurbanov Cc: Jerome Brunet , Neil Armstrong , Andy Shevchenko , linux-spi@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru Subject: Re: [PATCH v2 2/2] spi: amlogic-spifc-a1: add support for max_speed_hz Message-ID: References: <20230706110331.19794-1-mmkurbanov@sberdevices.ru> <20230706110331.19794-3-mmkurbanov@sberdevices.ru> <1jlefm6h8g.fsf@starbuckisacylon.baylibre.com> <5dc58681-d89f-8a8d-4da5-ccfa142fa15a@sberdevices.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rIgO7hjWxljNfj4v" Content-Disposition: inline In-Reply-To: <5dc58681-d89f-8a8d-4da5-ccfa142fa15a@sberdevices.ru> X-Cookie: Ginger snap. X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 --rIgO7hjWxljNfj4v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 20, 2023 at 06:41:11PM +0300, Martin Kurbanov wrote: > On 11.07.2023 10:25, Jerome Brunet wrote: > >> + ret = clk_set_rate(spifc->clk, freq); > >> + if (ret) > >> + return ret; > >> + spifc->curr_speed_hz = freq; > > There is no guarantee that clk_set_rate() has set the rate you have > > requested, at least not precisely. You should call clk_get_rate() here. > Are you referring to a situation where there is a change in the rate due > to a request from another client, such as a sibling driver with the same > parent clock? The clock may simply not be able to generate exactly the rate you requested, the rate will be rounded to some value that the clock can actually generate. --rIgO7hjWxljNfj4v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmS5Vr4ACgkQJNaLcl1U h9BanAf/TAsXNc+hfSP68yz4+OEr+7uK3DVU9ymeAUuAi/ksybVR0vSqYlZeDm0c 7Ilfl/jVxnXfF/NBA8tQdNu8qIX67fVhIWVxBLWA2p1/idx+cAa98gTeTr33Fg/5 dP/J/oqqWCmc7+lIOlyCQfyQelGqalUXRcWwkwj5aYo2gd1rez49E1/SCybQKqYR UTJrHjRtKvkAoTPJ2/u4CK872i4PyDfcYqmClW6i/v3D9CF39nOo6/QJYx2fZuMn napO9rczG5ViMNbt+37LYT1rsDAi9hk31doyxeFSp+MsvsFtDb5W5myMJbbbrEXc 6227n7xCLQ5H+LSYD56sTHyAr/H4IA== =MtQJ -----END PGP SIGNATURE----- --rIgO7hjWxljNfj4v--