Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp425490iob; Wed, 18 May 2022 05:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+MXG62elMezldNMKeNXsNjUggU/H60faz9A+7mMynA2Eu01xSV8Vc1bl47fIOWYwGLrvC X-Received: by 2002:a17:902:a415:b0:161:74b2:c1c2 with SMTP id p21-20020a170902a41500b0016174b2c1c2mr15083169plq.2.1652876519250; Wed, 18 May 2022 05:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652876519; cv=none; d=google.com; s=arc-20160816; b=shIgjCGqFMzQs8E3009jflqfwtIOC5f8uAL0B80A5GRgVsMtf5yS4fqnWV+Nw9wekK Ygf/4ZD3R6OUFIKoFo3AqSBDrjWtq9BPAYWQCUIHgDH36Cjm0PG5lLQpoCyx+gV9sEfz wV5T0PRYY08JiqnZMvgk/uhWM/gLR8hrIx/YNOKRU9Pmarh8TIHcTN4QLQOQhoxXThuM 76J1e3oY/CbJybz0tK5lfPduE1TwhSvSN6FM/BiYS14WY7AYq2wX6V2mOHEWDEn0ude8 HAwnaWOQwUleTcjeyLfP0hBPevaDf/yrKK8kMfBg7yKIt81Maq8lV750VyeJZ4Xt7jTC nPow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6g0kogVIq/wF8pvtP3dRUN/tVHLIqz87goTHmFF0PuI=; b=IeWGk9kCk+D0eeekKGg4zx5g37jjLBoQQHdLzMpfU+xHz5NR4OQzRDgtt8qIgubHDc s5z1aWJU0nMR6KW8OYwcdK5kQUFOYVi/Yx1Bth9zyDuVLMoy9JyRbUQFs201hGD3hNHG ryeUdBbDWvsRENZORmYx/RT3Rj34c5GHxXctQ27NoWov9kPGQ0fclakfcxj8y5wemxQA QI7Rj0auBgpwYt7K56RyhtLJasVnFTvahvs+IsxOVJCl2D24OQtLs8O+T5wdDMMpPV/M iuNg7wfOMGkvYzsAnfb/2uqxZPC+HaVDPlsqF8o0gKGdVLB9snafDngVBjOFfEs0RYIj 2CLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aW57lKMy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b15-20020a17090a990f00b001debd181bb9si2601862pjp.138.2022.05.18.05.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 05:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aW57lKMy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C423D188E72; Wed, 18 May 2022 05:15:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236265AbiERMPW (ORCPT + 99 others); Wed, 18 May 2022 08:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236253AbiERMPT (ORCPT ); Wed, 18 May 2022 08:15:19 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C637D188E77; Wed, 18 May 2022 05:15:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id C929E1F45027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652876116; bh=FtVu2AuXw/AthOSnF4m9ZOeWkCS8FD3CfCIxTGildz4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=aW57lKMy568QDyibKHFp8KIuYtoEcTU9ZlysDg7TgOISJeQkR21ZzG6i6rm7EdkXp imamVhyO/QUhVa/GJhgXyfjHbhKOAWr7n0NB13CmQGEkiW6E8fmUXOy3Rl0Mc7A01I dUeRGME6DL6YM55g6xEdzyawSTicaFE99npv3YmHrfNlSDiqE32AIrR2uu6uO8ZE1C sC1bgLitM8tZY4IOPt1yeCXAtgs6YIG6WBneFohHm2TH9xUuQPXOsUbjE+qARBVU4l 5tHC/JSN11roernrhQW2ggVmJnnDtWG3KVXUhO9RhmT+9G1lN04eNRIvS0EUkNSUo9 pAkVqgogKF3jw== Message-ID: Date: Wed, 18 May 2022 14:15:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] clk: mediatek: Fix unused 'ops' field in mtk_pll_data Content-Language: en-US To: Boris Lysov , arzamas-16@mail.ee, mturquette@baylibre.com, sboyd@kernel.org, matthias.bgg@gmail.com, wenst@chromium.org, miles.chen@mediatek.com Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20220515122409.13423-1-arzamas-16@mail.ee> From: AngeloGioacchino Del Regno In-Reply-To: <20220515122409.13423-1-arzamas-16@mail.ee> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 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,UNPARSEABLE_RELAY autolearn=unavailable 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 Il 15/05/22 14:24, Boris Lysov ha scritto: > From: Boris Lysov > > Allow to specify optional clk_ops in mtk_pll_data which will be picked up in > mtk_clk_register_pll. So far no already supported Mediatek SoC needs > non-default clk_ops for PLLs but instead of removing this field it will be > actually used in the future for supporting older SoCs (see [1] for details) > with quirky PLLs. > Hello Boris, I disagree about this change and would rather see the ops pointer removed with fire. I got that you're trying to do something about "quirky PLLs", but is it really about the PLLs that you're mentioning being "quirky", or are they simply a different IP? Also, if it's just about a bit inversion and a bigger delay: 1. Bigger delay: Depending on how bigger, we may simply delay more by default for all PLLs, even the ones that aren't requiring us to wait for longer... ...after all, if it's about waiting for 10/20 *microseconds* more, that's really not going to affect anyone's UX, nor make things slower for real, as the .prepare() ops for MediaTek PLLs are seldom called.. and even if that wasn't true, I don't think that a total of 30uS would be that much detrimental to the system's overall operation latency. Besides, if you see a case of a PLL not just switching on and off, but preparing and unpreparing continuously, there must be some big issue in some driver, or in the clock framework somewhere (and that ain't the case); 2. Bit inversion: that can be solved simply with a flag in the prepare/unprepare ops for this driver... and if you want something that performs even better, sparing you a nanosecond or two, you can always assign an "inverted" callback for managing that single bit; 3. Different IP: mtk_clk_register_(name-of-the-new-ip)_pll() - I don't think that there's anything to explain to that one. Regards, Angelo > This patch depends on series "clk: mediatek: Move to struct clk_hw provider > APIs" [2] by Chen-Yu Tsai. > > [1] https://lists.infradead.org/pipermail/linux-mediatek/2022-February/035093.html > [2] https://lists.infradead.org/pipermail/linux-mediatek/2022-May/040921.html > > Signed-off-by: Boris Lysov > --- > drivers/clk/mediatek/clk-pll.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c > index cabdf25a27f3..509959a325f0 100644 > --- a/drivers/clk/mediatek/clk-pll.c > +++ b/drivers/clk/mediatek/clk-pll.c > @@ -347,7 +347,10 @@ static struct clk_hw *mtk_clk_register_pll(const struct mtk_pll_data *data, > > init.name = data->name; > init.flags = (data->flags & PLL_AO) ? CLK_IS_CRITICAL : 0; > - init.ops = &mtk_pll_ops; > + if (data->ops) > + init.ops = data->ops; > + else > + init.ops = &mtk_pll_ops; > if (data->parent_name) > init.parent_names = &data->parent_name; > else >