Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp372479rwd; Wed, 14 Jun 2023 17:45:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5R3MhBsZzaRiTScF9mJyvnX4HwZ3ZUjgOZ/nQNskT0z70Eot6IL+fqMk4jA7npE+aCbfqy X-Received: by 2002:a17:907:36c8:b0:973:d84a:33a4 with SMTP id bj8-20020a17090736c800b00973d84a33a4mr16326687ejc.6.1686789925664; Wed, 14 Jun 2023 17:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686789925; cv=none; d=google.com; s=arc-20160816; b=gGu7ZZwtAufJ7L9Mi4sgUfMgbVpvUnicWF1HgdDB3iBJ4YuGx+3WgaQrbg4jx4PYB+ O7Syc0q8r3Ar/ZgHKoXShSktXXeVLISZ8FYBRx+v1J5h5FI8XP9IlsuEBNM6bR+CXqUt XE0aSbRl7IlixYLyG50/H+lskwOZB8Z1wpHGcoOYqLYDmFbG4ho46qx6/TZ1dCS/hiKT nMDx0piFSYwm8V5c9LnlwspzUWJOv7ucxOQ/C1Bf2yMRBgiXgmyXti0iNOawmzBnM2HR tMuygKYTLJMPJ7rpq96HiAzDD4p74sFkavgwbjOA9P8dLuyCYYn/HbLU4vRMk8l0C/Ld UhSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=/VdPcUvx2RFO6hW87m+5oE9VDuJXblbpsIgDAHyC1fY=; b=SBF3H2tcQ/zDAanNeUiMQ37j3Fu3TZEc7qX+FwhUZW/tlAFs9Sq6uicsIZuPaa+gai p5m0bf9Yj7jcLWsi8DgSm4anAYw07rErRSCn3841r8S6sTM+9W8xsIz5R5/+hbjq7k8a JdvfjDbyyvux25HlAe6cwC3fM3fgUYWT5Qy3Q88/8j6aL+4XW7AdOXRqIrL70TNmOFLU RWvOgs4MK3OzJN9+ATTSRW13Ms8PsVOC+VMg28NM+PmB6L4uAVMpZdBai156Os7zY3It 2s/rAOvsGOcBkw/JSW/iyBUwmvDnF38/eu8zoEdog2is0AhKM6XOcrCV2faxlz804K2L VeiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PJqStyRI; 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 kl17-20020a170907995100b009780cfaae1bsi9057530ejc.32.2023.06.14.17.45.01; Wed, 14 Jun 2023 17:45:25 -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=PJqStyRI; 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 S236802AbjFOA2O (ORCPT + 99 others); Wed, 14 Jun 2023 20:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjFOA2N (ORCPT ); Wed, 14 Jun 2023 20:28:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 395F3268A; Wed, 14 Jun 2023 17:28:12 -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 C512463A6C; Thu, 15 Jun 2023 00:28:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29DDDC433C8; Thu, 15 Jun 2023 00:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686788891; bh=XaltGBrfhglFbHY3ssTTjmpnwDD40AZoGcQsyArt+K0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=PJqStyRIv9SMNSfgk1rsrgtw6kU92JWbqqwwV4OPd+PIUgkzH9hsoTHjEX0cjvjS6 G+nH222bmJChSzvXTdsbNeGzn3iwk/FGMW3W8AerGXXaJ6bHFgQhLVC0BzepKEYb0q E9LDO9mD9Ok47vmkoZV2COvyVahocmXo1akA3PSGh1ZR0MekB2h/fzuxGAJtaDhrMM LeuzRLNDdb1D6tjziJm1WvDKosfL2vQ6fA8RQf3duZgk2yRnw5LxtrhzKjYXxJSjGy q7YSa1qC+kSEDS623HCp4iP+xukbu2iVfIvTNl2LGeyiRCQxgM+Gdm3fTI57QwsBL5 ivUzAHyJWn6gA== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <64749bf4.5d0a0220.325c0.64b5@mx.google.com> References: <20230427150717.20860-1-ansuelsmth@gmail.com> <20230427150717.20860-3-ansuelsmth@gmail.com> <82072c2b-8483-6fb6-a9d1-c9882825c9cb@linaro.org> <6473e34c.df0a0220.33a79.6c95@mx.google.com> <4afbcdd0-a11c-4826-d669-2ffc9488a8b6@linaro.org> <64749bf4.5d0a0220.325c0.64b5@mx.google.com> Subject: Re: [PATCH v4 2/3] clk: qcom: clk-rcg2: add support for rcg2 freq multi ops From: Stephen Boyd Cc: Andy Gross , Bjorn Andersson , Michael Turquette , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org To: Christian Marangi , Konrad Dybcio Date: Wed, 14 Jun 2023 17:28:08 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Quoting Christian Marangi (2023-05-29 05:34:57) > On Mon, May 29, 2023 at 02:12:23PM +0200, Konrad Dybcio wrote: > > On 28.05.2023 14:37, Christian Marangi wrote: > > > On Sat, May 27, 2023 at 06:11:16PM +0200, Konrad Dybcio wrote: > > >> On 27.04.2023 17:07, Christian Marangi wrote: > > >>> + * Force the first conf if we can't find a correct config. > > >>> + */ > > >>> + if (unlikely(i =3D=3D f->num_confs)) > > >>> + best_conf =3D f->confs; > > >> Is that a supported scenario or would it be a device driver / clock > > >> driver error? > > >> > > >=20 > > > It's to handle case for the 2 continue in the loop and arriving in a > > > situation where best_conf was never set? > > >=20 > > > Should we return a warning and an ERR_PTR? Idea was to provide a best > > > effort selection. > > Hm.. I'm not sure what's the expected behavior here.. Stephen? > >=20 >=20 > I have this implementation rady, if you want I can send this revision > and discuss that in v5 directly. It's WARN and returning -EINVAL. I'd only have a WARN if you never expect to hit that case. Otherwise, it should return -EINVAL and not warn. At a quick glance it sounds like some sort of rounding policy, so just make sure the round_rate/determine_rate implementation agrees with what set_rate() will do and it should be good.