From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3956BC47254 for ; Tue, 5 May 2020 17:31:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19315206CC for ; Tue, 5 May 2020 17:31:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ke1ddssf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730644AbgEERbi (ORCPT ); Tue, 5 May 2020 13:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729199AbgEERbi (ORCPT ); Tue, 5 May 2020 13:31:38 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE6DAC061A10 for ; Tue, 5 May 2020 10:31:37 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id e10so1760083vsp.12 for ; Tue, 05 May 2020 10:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EQsoLSVjLAyR/M3Ocg/DHLH6pm0RmX/436FGjF6WTao=; b=Ke1ddssfTsxp0iPhblhR8uitz3u+NzVLxty3wGO22LNbm/oHweSwOoglBCDtTP/BIT nV1QFq59DQfSmb6KnLtJ20O65z/eG/stUQHHvO8IH4EjGKYIUy9p4mmslme/tNVh5Flm 6cGsK5McFrzX89tb9oXS6LtVMITgWloKe3SwFt3NmJYkPMWNvHfXt2Ie7uhSd+23n+/8 ATV6FtzN+kcQJYmd3TQIVidF4Kn9qkk/B5Pp0RJ4v+8tQh2QN5nO4biP92tJ6VPwRAnT Gj9H12bpBzqp+B/l/ZfQsusyeGTwkTsHyDvj43JP5reauKAVSHVR8hvyiuB885U4ug4L ZUZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EQsoLSVjLAyR/M3Ocg/DHLH6pm0RmX/436FGjF6WTao=; b=mAX0Heq8ozkAfuqLwy0nDhnWvPC/nGnOy2IUPOSMsaUM00dcCIGxHBTBCRmQq6NymD TGKj/HlM1p3xD2MBsT+A3n0GWGbbFNf3GGqyiOuytseA4duNThZ5Z9STu5mek2sN8ruu R31fW34fyL5F7Tw3yWS0g72uB5AHFvWnLz9UMgrrsQt03g233uWIjiApE2Z9UCm9i9Ls HCEPN7BbL6u92lF9a++HFfcw+Iiy6GwTPIL/Ypt9c5SMAOjZOQ3/bnhQnyj2LUHBNFEE YBuFI5twWGBQhxPvHWi2XtOltYrdkUCAaQozd2vhgjyQ+RZm28uLXrGe03KsQIIc9wu1 LAAg== X-Gm-Message-State: AGi0PuaqnHk6y6RIDB/UebiXbp7KseW1WhIXQrTB94M0uCtxtfamm6Lp uhdDSnNcQnSiMqDDsScSm8kp7ErGdBHN/E0azZpRqw== X-Google-Smtp-Source: APiQypKY+Ec0L+QALIPDIkzOQ4WXjg5IcZuMySRts7hkgSJWNuiacaOPr1fNLfnrg/Vc3j1c0VN+v2jbTt5wryigOLM= X-Received: by 2002:a67:302:: with SMTP id 2mr3875137vsd.165.1588699896206; Tue, 05 May 2020 10:31:36 -0700 (PDT) MIME-Version: 1.0 References: <20200428210229.703309-1-martin.blumenstingl@googlemail.com> <20200428210229.703309-3-martin.blumenstingl@googlemail.com> <1jlfmdi9uw.fsf@starbuckisacylon.baylibre.com> <1jh7x1i3hj.fsf@starbuckisacylon.baylibre.com> <1j1rnygye6.fsf@starbuckisacylon.baylibre.com> In-Reply-To: <1j1rnygye6.fsf@starbuckisacylon.baylibre.com> From: Ulf Hansson Date: Tue, 5 May 2020 19:30:59 +0200 Message-ID: Subject: Re: [PATCH v6 2/2] mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host To: Jerome Brunet Cc: Martin Blumenstingl , Stephen Boyd , "open list:ARM/Amlogic Meson..." , "linux-mmc@vger.kernel.org" , DTML , Rob Herring , Jianxin Pan , Linux Kernel Mailing List , yinxin_1989@aliyun.com, Linux ARM , lnykww@gmail.com, Anand Moon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 May 2020 at 18:05, Jerome Brunet wrote: > > > On Tue 05 May 2020 at 10:17, Ulf Hansson wrote: > > > [...] > > > >> >> > + > >> >> > + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, > >> >> > + onecell_data); > >> >> > >> >> I think registering a provider for a module that does not provide clocks > >> >> to any other device is a bit overkill. > >> >> > >> >> I understand the matter is getting the per-user clk* pointer. > >> >> Since this is the module registering the clock, you can use clk_hw->clk > >> >> to get it. > >> >> > >> >> Once you have the clk* of the leaf clocks, you don't even need to keep > >> >> track of the clk_hw* since you are using devm_ > >> >> > >> >> Afterward, we should propably discuss with Stephen if something should > >> >> be added in CCF to get a struct clk* from struct clk_hw*. > >> >> > >> > > >> > [...] > >> > > >> > Hmm. > >> > > >> > I am not sure the above is a good idea, at all. Unless, I am > >> > misunderstanding your point, which may be the case. > >> > > >> > I think above "shortcuts" could lead to abuse of the clock framework > >> > and its internal data structures. When going forward, this could make > >> > it unnecessary harder to maintain the clock framework. > >> > > >> > I know, it's not my responsibility, but from my experience with MMC > >> > and SDIO interfaces, is that those have been too easy abuse - since > >> > most of the data structures and interfaces have been exported. Now, > >> > it's hard to roll back that, if you see what I mean. > >> > >> Indeed, it worth clarifying this first. > >> > >> With clk_register deprecated in favor of clk_hw_register, we are likely > >> to see that case rise elsewhere. > >> > > > > So, according to the separate discussion [1], I think we can let > > Martin decide what option to implement at this point. > > > > 1. Implement the "clk_hw_get_clk()" approach. The preferred option, > > but requires wider changes of the clock subsystem as well. > > > > 2. Keep the existing approach, with devm_clk_get(). I am fine with > > this as well, we can always switch to 1) later on. > > I have a problem with this approach. > The dt-bindings would include "#clock-cells = <1>" for a device that > does not actually provide and only needs it has a temporary work around. > Those bindings are supposed to be stable ... I agree, the bindings need to be stable. What is the problem of keeping "#clock-cells = <1>" around, when we move to a clk_hw_get_clk() approach in the next step? > > I have proposed 2 other short term solutions, let's see how it goes Yes, seems like we need to wait for Stephen's input then. Kind regards Uffe