Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1456927pxj; Fri, 18 Jun 2021 07:33:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt/tWQPHWZqqkE99Aw0O1NTry9onoyY4PJT6DlUw/rurSBtWj/WJyowrFjWP2Ie5B3ipqf X-Received: by 2002:a05:6602:25da:: with SMTP id d26mr8243505iop.106.1624026780061; Fri, 18 Jun 2021 07:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624026780; cv=none; d=google.com; s=arc-20160816; b=nuxEm8tDDQ7hOqYbylFkzCYWGv0/dV/Y7s3ikV2vbB9ZLNNhsw2OV2btjc7qOrDhEU YWQr8bbl+YtpL/f2bJwVkUuFkdcWQddOIztFlcxz2na8hbOxQeLx8/Q3cRcSwVQURwXZ 3uUacJjuanp4qcviifwZyObqxRSVL7fsE0Uz/nqXujIAqbIfrSR+c0+IBtGi0S7OEozH 2BDNdAdJj+yw4Yw2As9WyA+VEDmkM1HrRWwu8zkxHgG41mIn0MLmD8f2IRHQessAdxqn FRzu3dlpHEUp8irGXiPbz0rgni7J0pJKXS8YTDROh5+KRhp+E/c1rTlj9GkSPYf1hPhy 6Trg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:date:message-id:in-reply-to:subject :cc:to:from:user-agent:references:dkim-signature; bh=YSr1xCzITLF/CWHeqxDLjzvl354aJ3tXZwCogE8rb8c=; b=T7Ekk1EtCzQnXyLxjgqkHNG2B86NB0tofpwOhXV1BuQrE0QIzBUVWsROd4U9dDCwj1 8MVUDShjqrjbSOVLHevlaMrGQYKt9QUeoW/kr0iwrdZp6LRwMQ2/uazj+j+c2fZPC+Nh /mL7/2K5kFChiANkNsjdyOci9ceMibtFxP/XD6s/pEFIXMgjzFYJOqtPxN7aKbw8Oq35 DmN5gBuOk1s24UTI4r9lIJAKd33tk2Y5xcikZ75qbrsEPteuZIPCjQPlezI8ppqGZIyX geV+GI6Dkn2uA3DGvW8bluS2c6QoVDq4Qxr2e3KtiTQe3zPwMorpH4mYO5L5/x4gUFbY H4Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Jgi1NBFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si2286346ilq.122.2021.06.18.07.32.47; Fri, 18 Jun 2021 07:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Jgi1NBFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234504AbhFROdM (ORCPT + 99 others); Fri, 18 Jun 2021 10:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232052AbhFROdM (ORCPT ); Fri, 18 Jun 2021 10:33:12 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F3AC06175F for ; Fri, 18 Jun 2021 07:31:02 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id y7so10959078wrh.7 for ; Fri, 18 Jun 2021 07:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=YSr1xCzITLF/CWHeqxDLjzvl354aJ3tXZwCogE8rb8c=; b=Jgi1NBFwn0O29BGpktjuEhMh7FpWKz1Q4Sy067SvtCk0yg7PmyHMl5/4VuN8azjOhX 1Bykr3U62EdMum+0t1GEO72SZ7zqhTGWgTHbplhglmDwm4E9UhGfqfuyMVfgEQdJ9uCb M7DWIL+SCoFnw8xPYyBzp3dbqpSjKAWMNbI3MtZ4rGgnWpTE6Znr6cuVPwXdk9tFoi0q v2Yq0VK40fae8TqVeN7V1dx8YHyI7dAV0JP138Xxr1chO+XjcHBkK1oEUiAhtr+yHIGo zXQeywxUJ6W31/CCW59z7k5Y3ZDlAXp7uIcj6+mD1cVnFjPcy8LSABNDTROB9xv/hq0F 1rMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=YSr1xCzITLF/CWHeqxDLjzvl354aJ3tXZwCogE8rb8c=; b=t7FT1DhQgRCnLnerQymLdcrFGcoI04C5+bjZysPQqQTSMQXEY/Q6UEExyPT5BcVOHD vrsiaOdpmABTLm+Po34cdH+djdM4jhOkztEUn2oG97Tuy2WaEvvsHQpbCb19fku166ES IuxyjHfCcflnbGwGBAVO6SdMR07YNBiXk2jajv/BZTwD7AN6CIsCT2N2SVkFKEfgkXiu 8+z3A/96wOH0IlrebsJKmSdH42/zecvROWR6qLgrPCRRDyhOoWlhorC+VxuOcfMjT/uE YYEvYFVYrzldoTWMl0eQPK/H3UcULVXpCvGFWp+IlSGpeCT8iYGWqQxbheLI6Vl1qTi0 90wA== X-Gm-Message-State: AOAM530Tax70HP8PL0RUMjUEd7+Vp8QuCaKdLpleYlx4HKpjMaTOhpln qmPfqGfTNuUxA5zbI8OSppbEBw== X-Received: by 2002:a5d:440a:: with SMTP id z10mr2019653wrq.269.1624026660412; Fri, 18 Jun 2021 07:31:00 -0700 (PDT) Received: from localhost (82-65-169-74.subs.proxad.net. [82.65.169.74]) by smtp.gmail.com with ESMTPSA id v18sm9157091wrb.10.2021.06.18.07.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 07:31:00 -0700 (PDT) References: <20210528113403.5374-1-peng.fan@oss.nxp.com> <162262192433.4130789.1017942859005253343@swboyd.mtv.corp.google.com> <1j1r9kobln.fsf@starbuckisacylon.baylibre.com> User-agent: mu4e 1.4.15; emacs 27.1 From: Jerome Brunet To: Marc Kleine-Budde , Stephen Boyd , "Peng Fan (OSS)" , mturquette@baylibre.com Cc: Peng Fan , linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 0/3] clk: support regmap In-reply-to: <1j1r9kobln.fsf@starbuckisacylon.baylibre.com> Message-ID: <1jzgvnfdng.fsf@starbuckisacylon.baylibre.com> Date: Fri, 18 Jun 2021 16:30:59 +0200 MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 02 Jun 2021 at 11:32, Jerome Brunet wrote: > On Wed 02 Jun 2021 at 10:21, Marc Kleine-Budde wrote: > >> On 6/2/21 10:18 AM, Stephen Boyd wrote: >>> Quoting Peng Fan (OSS) (2021-05-28 04:34:00) >>>> From: Peng Fan >>>> >>>> To i.MX8ULP, a PCC register provides clk(mux, gate, divider) and peripheral >>>> reset functionality, so we need make sure the access to the PCC register >>>> be protected to avoid concurrent access from clk and reset subsystem. >>>> >>>> So let's use regmap here. >>>> >>>> The i.MX specific code will be posted if this patchset is ok for you. >>> >>> We have a couple regmap clk drivers in the tree. Either combine the >>> different regmap clk drivers or duplicate it into the imx directory. I'd >>> prefer we combine them but last time I couldn't agree on the approach >>> when Jerome wanted to do it. Maybe now is the time to combine them all >>> into one common piece of code. >> >> IMHO for the basic drivers, such as gate, divider, mux, mux-div, etc... it makes >> no sense to have them in an arch specific subdir, like meson. > > Indeed, those basic types were not meant to remain platform > specific. Some framework (ASoC for ex) make heavy use of regmap and > could welcome regmap based basic clock types. > > At the time, Stephen (qcom) and I (meson) had slightly different > approaches. Before having those types spread through the kernel, I think > testing things out was a good thing ... this is why these are platform > specific ATM. > > It's been 3 years now ... and it has not been a total disaster :) > > In the end things are not so different. Let's compare: > a. Both have a generic "clk_regmap" type common to all regmap based > types. This is very useful to easily fix the regmap pointer in static > clocks (which are heavily used by both platform) > > b. Meson uses a generic pointer to store the type specific info. > Qcom embeds the generic clk_regmap into the specific type one. > => In the end, I don't see any advantage to the meson > approach. Switching to the qcom method would be quite a big bang > for meson but it is doable (nothing difficult, just a huge line count) > > c. Qcom basic regmap type deviates a bit from the regular basic ones > when it comes to the actual data. The qcom "clk_regmap" also provides > the gate, mux have the qcom "parent_map". In meson, I tried to keep as > close as possible to regular basic types ... at least what they were 3 > years ago. Only the register poking part should be different actually. > => I'd be in favor of keeping close to meson here. > > A possible plan could be: > 1. Rework meson as explained in [b] above. > 2. reword types in qcom where necessary to avoid name clashes (add > "_qcom" extension for ex) > 3. Move the clk_regmap implementation out of meson to drivers/clk > 4. Things are yours to play with ... > > I can take care of 1. and 3. I would welcome help for 2. especially since > I won't be able to test it. > Hi Stephen, What do you think of the proposition above ? There rework is going to take some time to do. I'll start only if this OK with you. Cheers Jerome >> >> regards, >> Marc