Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2489152ybk; Tue, 12 May 2020 00:13:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNCpoByLPTRH1BdOF2dpHnjGZ73llq3If9biaEyxhlamFwiL9Pg2t9QRGDKWFcyUkXAsZv X-Received: by 2002:a05:6402:3185:: with SMTP id di5mr481541edb.330.1589267620634; Tue, 12 May 2020 00:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589267620; cv=none; d=google.com; s=arc-20160816; b=uUnu9Hh2IiiVKaUe6updX3IM9PDViP2Mt2Q48GBosOC5ePLjUBbcpr6EwSn0sqtFxj TmGVyiMH40EytfW9YPYvt74/vu6zhX+3bMlqr2bWaTHXYzvbl/G5LTqw0nAYdabFrJbq LWs01aU42haTWSOQ4m0wasAqF82y6PdMByf7OnYnQnGQMR6xDRsbtIixaqarwDYsAp1z K5y9EFpNy0qkIN4vqcQQuiGUMiIhmdJC6aLg+1l0uvEslHgU9t1poJ9aawgNuP6ctLif s462Jaggvczd76X8kGKvFHebUzAlk/Yjw+vgCnJYPg9iJtrh2Qudpdo28q0ep2B1HUi2 iuhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=ne4G1hw7iuZLuKwIvm4TOsEkgQyVcIP6lOJe9NG9OX0=; b=w9Qf6gtjg7N6JDubxcG0gxRIz43GXx+EFgTUmzvqgM/TxSoaERlmMq+n4/1Wk2Vg6+ d+57QxO5cAnU9oBOhtiVAGi6h4gh6+p0LDSStLkKK2/ftpUcgk//aYnDvN1ITw7IyU4w 3nXEe+XP0qxL9Qyd4bWphI2Ehvx5IdgpJUDS43PE9VwH5iJkkPfILtQeln3xPe5Dl9yR OxCcjo3MxBgHETpf92mLHlaWeyKcHhSfFMsz5BkigFn7RzFxXFT49S1IjGD9WEaoRku6 k/A9fmCSO/lGzUDvAG+EvIhcouZgaXHlqd+VflihkFYOcS2DgjYj9H9bcy6Pj2fSEN1z 7gBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="c/AU81xd"; 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 o5si7225239ejr.501.2020.05.12.00.13.16; Tue, 12 May 2020 00:13:40 -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="c/AU81xd"; 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 S1728888AbgELHJN (ORCPT + 99 others); Tue, 12 May 2020 03:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbgELHJM (ORCPT ); Tue, 12 May 2020 03:09:12 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B65BC061A0C for ; Tue, 12 May 2020 00:09:12 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id f134so8325319wmf.1 for ; Tue, 12 May 2020 00:09:12 -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:date :message-id:mime-version; bh=ne4G1hw7iuZLuKwIvm4TOsEkgQyVcIP6lOJe9NG9OX0=; b=c/AU81xdLryWPyTaVh0+eW0JsKLbkkiWgEN20UkCWXLyadejFKrluqrbp8vt2dQyQX Q75VgyKXGQuVcsPkfs60ki1+4JY/BvC3BK38fko2EvEXHYClK1B3oLQ/brM1S/ZydJr0 /i1t81irAJaH4BkX9o3oIZoq1eiUg5QUbtazxL/OqXBKPFrPWsIqlPNg0Db6a7wTkSji eaQCMIiYzTmzCVSvqYKOwTeOuWZmLBO1b0+xVhEUl0tKJtE5k2wEyl9MnbPXLAUhpLSz UlWsQmoTfk6f1C3So6RcyBMhQvFjTub6Ap8yp0Mk0DQDrZQgMLfsb7H1J+GrzJx99h6O QbAw== 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:date:message-id:mime-version; bh=ne4G1hw7iuZLuKwIvm4TOsEkgQyVcIP6lOJe9NG9OX0=; b=VKdhqBtMXKXYmJbVWYi0ESxeGh+ypdR/QFnAYc6KWsstRs8/9K/ZMySw7b5rbsBH6K qIlVJ7jWrAwzuzF0egY9lRPYYfn6Z/2gTCmy5rZ6I4sKTeebQKKecnyIAm8ACenrqreZ 9zMWUur0qqNIXezmkGZ0Om4y4o8fXIxDuP4xLG6ikxEhbVRRh5+d6wCvJQDmPBMh4jIK mC0i2hhDCn0Gk1Ve1b7Eg3jkupHg/pnsYqmSsmkDmAxYIpsgWFr+5L9wwq4mcfAr8vLL hglb4m0ykK91A9mz4eCx11V0uV4XgsRA6NOOcOr8B46xSPCadKC533E8RZOl1c/9QQkH qIgw== X-Gm-Message-State: AGi0PubTNHYTnnR8G2SgSrVhkxBGFtXsHHZIVjllzJYY4m/ZXf9mNLdi 9+rZDEvao3XdXaZFQ5FwMva8HQ== X-Received: by 2002:a05:600c:2c0f:: with SMTP id q15mr38502498wmg.185.1589267350798; Tue, 12 May 2020 00:09:10 -0700 (PDT) Received: from localhost (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.gmail.com with ESMTPSA id i17sm30353895wml.23.2020.05.12.00.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 00:09:09 -0700 (PDT) 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> User-agent: mu4e 1.3.3; emacs 26.3 From: Jerome Brunet To: Martin Blumenstingl Cc: Ulf Hansson , 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 Subject: Re: [PATCH v6 2/2] mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host In-reply-to: Date: Tue, 12 May 2020 09:09:08 +0200 Message-ID: <1j1rnpfx4b.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 10 May 2020 at 22:52, Martin Blumenstingl wrote: > Hi Jerome, > > On Tue, May 5, 2020 at 6:05 PM Jerome Brunet wrote: > [...] >> > 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 ... > actually I don't see a problem here because this specific MMC > controller has a clock controller built into it. Clock controller is a bit exagerated. It's an MMC controller with a composite input clock and a couple of gates. A fairly common setup. Also the property does not indicate a "clock controller" (or any number of clock hosted by the device) but the ability to provide clocks out of the device. This device does not actually provide clock externally. Your provider is just meant to be used internally. It is a work around using DT for something missing in CCF. IHMO, it is not such a big deal but since the binding are supposed to be stable, I'm just pointing out that it is not great. > Rob also didn't see any problem with this when he reviewed the dt-bindings Again the bindings would be fine if the component was actually providing the clocks, AFAIU. > >> I have proposed 2 other short term solutions, let's see how it goes > since I was also curious how this turns out I first implemented your > suggestion to use a similar clk_hw registration style as > dwmac-meson8b. > That made the code easier to read - thank you for the suggestion! > > On top of that I switched from clk_hw_onecell_data to directly > accessing "clk_hw.clk". > Unfortunately the diffstat is not as great as I hoped, it saves 21 > lines (11 in the driver code, 6 in the soc.dtsi, 5 in the dt-bindings) > Once devm_clk_hw_get_clk() is implemented 8 lines have to be added > again for error checking. > I attached the patch for the drivers/mmc/host/meson-mx-sdhc* parts if > you are curious (it'll apply only on top of my github branch, not on > this series). Diffstat was not my concern, TBH > > Please let me know if you want me to submit an updated series where I > directly access "clk_hw.clk" I'd be happy if you did > to get the "struct clk" or if I should > keep clk_hw_onecell_data. > If it's the former then I'll also add a TODO comment for the > conversion to devm_clk_hw_get_clk() so it's easy to find. > Perfect ! > > Regards, > Martin