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 6B2BFC4CECC for ; Mon, 27 Apr 2020 18:36:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D0ED205C9 for ; Mon, 27 Apr 2020 18:36:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pXUgT4BB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726463AbgD0SgH (ORCPT ); Mon, 27 Apr 2020 14:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726223AbgD0SgF (ORCPT ); Mon, 27 Apr 2020 14:36:05 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84458C0610D5 for ; Mon, 27 Apr 2020 11:36:03 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id f5so8555614ual.5 for ; Mon, 27 Apr 2020 11:36:03 -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=1xM9QjmpwYbkisRgg+9m3KKxSIRNSU7Z5AW0CFZxADU=; b=pXUgT4BBYjU7eXZo207JUZsU3pUdyE9dKL1mF7Do3uspZf/cO+6wRg05YOWJXZlkv/ puy1OMkOOUYSmFDCdqg8foPpc57v7YjCzOt1JLFdijuOk+hddZ0gpu+qAh94YKsLoBx1 R1n5j8CA7M5whL2MYKKdY2mOwGrpJ6wFY8fJtsQ7t7qY8VA3zRsXPKrpOc0XRZcC2SGH hjpbfKy036pJGTb35GPecBbKXrZ9f5pkpxEIbddKQokLimKOD0OF3GGUGwm1uShb4UhF jQcXmVBRDeVhh9kFLIEFicwnPvbC/YariFA5TYc3Di9PRAI1TtRiJj2V5UxgFusegIln x3dw== 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=1xM9QjmpwYbkisRgg+9m3KKxSIRNSU7Z5AW0CFZxADU=; b=knfgXbn2pIAXdFECpLXxhlj3bjF6uX0SnBzpKH5mh9q2vrtG4bLrAPGSFeUMarls7U DIApnu421uBvFpXDP+f0np0Ib86NGfPRxV/ffX+vx9GiFYugEQe7pFltH0njrNzFtuXF kSEuBTQPqdFza/1rtw8o/tRcu6Iy7JZ5LMMTE3U8Thj5gDVkygglwaB64dVv2rEmYoPS c1nJsODcQSLvMYeW6XyJ2KT7JRfZWeoFFUvYdGuMlXkoKkWEPlTPZp7of+3OzD96qzGL vR6ajGCfdhAqLg0MpQAvR8ajlVgaERN5NhJdZ6PUVxFT/e006qfkyg7VfgBurMzw073v XOOg== X-Gm-Message-State: AGi0PuYbt8zDSZk92YsdNKEMN7A5yUI1/Q14MMm8kJHQuP2Hp5L9qEIO 6cgS/tnSO/OeFxH+kJmgjTECIyiYD6z2TQmMxfyyUg== X-Google-Smtp-Source: APiQypJNKdwylcthlxM+njJYVD9XtTTnPk4q1j17763v7R71x0bAw3EsHZ45/PbN0eX4zVscCJdVfvic8BQcRqzaqIM= X-Received: by 2002:ab0:6588:: with SMTP id v8mr18411294uam.100.1588012562614; Mon, 27 Apr 2020 11:36:02 -0700 (PDT) MIME-Version: 1.0 References: <20200328003249.1248978-1-martin.blumenstingl@googlemail.com> <1jblnd2tp3.fsf@starbuckisacylon.baylibre.com> <1j8sig3mi3.fsf@starbuckisacylon.baylibre.com> In-Reply-To: <1j8sig3mi3.fsf@starbuckisacylon.baylibre.com> From: Ulf Hansson Date: Mon, 27 Apr 2020 20:35:26 +0200 Message-ID: Subject: Re: [PATCH v5 0/3] Amlogic 32-bit Meson SoC SDHC MMC controller driver To: Jerome Brunet , Martin Blumenstingl Cc: "open list:ARM/Amlogic Meson..." , DTML , "linux-mmc@vger.kernel.org" , Rob Herring , Mark Rutland , Jianxin Pan , Linux Kernel Mailing List , yinxin_1989@aliyun.com, Linux ARM , lnykww@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Jerome, Martin, On Mon, 27 Apr 2020 at 18:46, Jerome Brunet wrote: > > > On Mon 27 Apr 2020 at 18:23, Martin Blumenstingl wrote: > > > Hi Jerome, > > > > On Mon, Apr 27, 2020 at 10:56 AM Jerome Brunet wrote: > > [...] > >> > Changes since v3 at [3]: > >> > - split the clock bits into a separate clock controller driver because > >> > of two reasons: 1) it keeps the MMC controller driver mostly clean of > >> > the clock bits > >> > >> If the register is in the MMC controller register space and the MMC > >> driver is the driver using these clocks, it is where the clocks belong. > >> I don't get why it could be an issue ? > >> > >> Is the clock block is shared with another device, like on the Gx family ? > > no, it is not shared with another device (to my knowledge). > > > >> > 2) the pure clock controller can use > >> > devm_clk_hw_register() (instead of devm_clk_register(), which is > >> > deprecated) and the MMC controller can act as a pure clock consumer. > >> > >> Why can't you use devm_clk_hw_register in an MMC driver ? > >> Unless I missed something, it is provided by clk-provider.h, which can be > >> included by any driver. > > indeed, I could use devm_clk_hw_register in the MMC driver. > > Ulfs concern was that a lot of code was needed for managing the clocks > > and I agree with him. so this is my way of keeping those details away > > from the MMC driver and have two separate drivers which are better to > > understand overall. > > Martin, Ulf, > > I understand that CCF code might seems verbose and I'm happy to help > review it if necessary but I don't think every driver out there should > register some kind of fake clock controller driver everytime they wish > to use CCF API. > > Yes the it might make the driver code cleaner but the overall > architecture is harder to follow. > > CCF was made so driver from any subsystem *may* use it. Creating a > controller for a single register is overkill. The HW architecture of > this particular device does not justify it. I fully understand your point and I agree with it. If I recall correctly, my point in the earlier review phase was that I wanted the driver to be nicely split into a clock provider part and into a mmc host driver part. I also raised the point of using devm_clk_hw_register() rather than the deprecated devm_clk_register(). I still think this makes sense. That said, perhaps a reasonable split could be to have two separate c-files (one for clock provider and one for mmc host), but both in the mmc subsystem. Kind regards Uffe