Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp441615ybj; Tue, 5 May 2020 01:19:53 -0700 (PDT) X-Google-Smtp-Source: APiQypKMlirhHkl/V+s8egoLkAPzzA08ib9BQAeHA4+HRmD8FXQfSJlllBKmGAq2KEyQ56rj9GQ/ X-Received: by 2002:a05:6402:1496:: with SMTP id e22mr1531994edv.301.1588666793457; Tue, 05 May 2020 01:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588666793; cv=none; d=google.com; s=arc-20160816; b=q6nXbCnrDRNlgvHSJKawQOZzLq3EleVbxDbXJpKMZ+3XOrxLnDCGXAJ9M9Ar1GQtPF gmgdEFpSu3KvawQTKS9OORRa0+FQHx9IEmBzD8VbsrG3g6jllQjdb9CMIIOt7I4RDkLb 8kDtQkxpixXroyWY8RC9Mjk49KyhW1KmP0c/fJtGfnushTMwH9TEM98p9hCHTHeiDN0T Wq+Qd7YFWZYldlwfrNbkP8NYnbbOUIzLFZFohQgDDfdC1mopwZ1tb59cFrD4x6ljBEiy 4faIVuBd2nTidlhUPNhpgj1qvrnUBwz6vT/L8m6CmKmoBsTZLPhVYlsmpJry5qoGFVZk xo0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TbQ/NUsTl64Wiv4a1ipzIuD3CBdf0yc6n6AHT0AzX6s=; b=e1vnlwY2Ohid+Q4bl+QLR+1s08TfBqAmy0psSxuxLVnx1sauBct0XmXcqxED971gm9 9stX4LYaT+hh2lHdUIXVSg2t97/1vSeMHs/dRbLIYKVV9mpzJnDAACDDaFRBpyBovQ3X C98IUMwL+paR9kg1ZP7H1h1Elof9O4DectzpPSUKnVRj6F1TAqf411oc+rFXEs+E/LVX iQm/i6DamCi4g3MYQy/IgGBYlo4XwlLhkSuluEr44tmmYEMq6jKVWALs9axj7KaI1Lp0 GHCjpBCbfm+gPrZgr6QdADbFqPe5cfWH5ZTaC/Jg61BhfJDh5eLxHtXX5nJZrYuHsoOk d6MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lizeE891; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si667600eje.107.2020.05.05.01.19.30; Tue, 05 May 2020 01:19:53 -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=@linaro.org header.s=google header.b=lizeE891; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728329AbgEEIRy (ORCPT + 99 others); Tue, 5 May 2020 04:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725833AbgEEIRy (ORCPT ); Tue, 5 May 2020 04:17:54 -0400 Received: from mail-vk1-xa41.google.com (mail-vk1-xa41.google.com [IPv6:2607:f8b0:4864:20::a41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00AF4C061A41 for ; Tue, 5 May 2020 01:17:53 -0700 (PDT) Received: by mail-vk1-xa41.google.com with SMTP id v192so276194vkd.3 for ; Tue, 05 May 2020 01:17:52 -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=TbQ/NUsTl64Wiv4a1ipzIuD3CBdf0yc6n6AHT0AzX6s=; b=lizeE8913OsCMHce51oPvAyEnSr00jzla8Wj9ZJX8Yj4J1Psb7aJ12HDbUuxzEASuV CJOcUf/1RPpJ18db073V2gTXAgZrhjOiqKsFQTtxkRjpOYi7p+8iPI6IgM2MLiGzaKLy cLIvq0bhk4yEFz1lkPgzduKThkyI9/FNNBUECjt00MMWx/SmSy1QyuQ90mKXKVovzmJ9 4fKGh0hJnh1TGnDmYd/ZhNdLxC+6X+tPCtAfmgDvTlLfG9iZKYS2tw377gR8NwBlvma+ N8uaPL/HAJq4slF/CQIAr93/bDUWK4Xy5o9CeYh1dInheigK6z+mx2xsFNL4I2ItVIiH Sw4w== 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=TbQ/NUsTl64Wiv4a1ipzIuD3CBdf0yc6n6AHT0AzX6s=; b=UBU+MXW4cyeGOR3Kvg3TakdfF+VrYRoC7vuWeINlA7D7rF2XDiDW0A0Ag9H2dGJTdE 7bRkdOTcgB+JO6XDvRu8FTpoqH9StYtnrlNnYXLdHe4DM4xPjpTxZNh7z21hljgBQnLB xX6mIB9xXykP3x6O/EFhpa1QKI6WHFSCVO9eGMCgAlwLF91MXIHyftVYlrJGSoUTjCCH PdbbHp0cf2T+q0djMLgXV/EFKLfCiF/mwR8OMmsfXfp4jzFM8c+0IrIoT+hqh+IxkoY+ vBI5zscO1YspDyAr2lW6ZyaRstc7hPi+0mKfNE9psBuWRbo8p3ES89J58MPjaY/43m7M Gosw== X-Gm-Message-State: AGi0PuaSUoYNvNg2W//9y7AtJbaXNocHAukQhoHhY4BFDzVDUnogOaMS fSliS+lFRVxvqAWopO0NXLFS9sT4Jdu8NG0VFjhANg== X-Received: by 2002:a1f:a60b:: with SMTP id p11mr1325157vke.43.1588666671822; Tue, 05 May 2020 01:17:51 -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> In-Reply-To: <1jh7x1i3hj.fsf@starbuckisacylon.baylibre.com> From: Ulf Hansson Date: Tue, 5 May 2020 10:17:15 +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 , Martin Blumenstingl Cc: 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 [...] > >> > + > >> > + 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. [...] Kind regards Uffe [1] https://www.spinics.net/lists/linux-clk/msg48373.html