Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1203305imu; Wed, 16 Jan 2019 14:44:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN5W9njbr16P3HOEOi1HxaC7o0s2Lvz0qi4N67n6I6LWflrRtK7U0E/LIlHyuRZ6/JkjZv3N X-Received: by 2002:a63:4566:: with SMTP id u38mr11053609pgk.4.1547678654853; Wed, 16 Jan 2019 14:44:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547678654; cv=none; d=google.com; s=arc-20160816; b=DeIKYAlQIEOyecoVVm38fRHEPza5sJUHg5yW0iSlsJLVKgLuO0SNozGBulAJY0Fi4E CTWKbU1Ak0qS+uYrJianlDRUd/zcgxSWIiwMFvmzFDVYUdvL5DMeQjx+okq3dSerXYZL uI6xNHZfIGXhc/VXxIIX2gFZTyjdpPpCz4JCEMI2g8+aMLgRLx2MIHMpN7DGdiszQlpu OgMYkZ5hcG+ZXkhbGm0SgJAEttbAkuWg/dBWCQjYllwrp1BYLseaKD2en5GXcS68x/wC 8RJLFIM3/LR7WlI8kn5dKGqy9DPRyxIoGmXtnpk47HRAQMhhohrWs1FYwU8Ppbgyv5c1 jBLA== 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; bh=4IMG7jlqdMP9fj1j/3+ne8Scrl1K/KH+xgzb4mZhEV0=; b=wLT/hehzukVSG/2Im3JgFEYXvVO4mwnk4VYlwAEiCJh3SscUAgt9WCvTQGVtHANQhn oWh+sy8p2rzl5NF6t+/Ewqni6g+XwoEdViPliB6g3WOTGQn516jsJ8hUaYUidqYfT1LA iPUK5CPKz9vrG65yMWr6iPR3fsW4e+b+J1OxBcjcIy/UNXpBj9Ofaycfr3oSKPMgRF/p Rp8dnEkNRLjNL0JVUsVFbchDCpqA8E9yn1uzGhFcVg3FYDYjbTWAh/F0Hu/qQWvIezyy KUakmuPYcVlnYabKGjrqzoWnConOSABAbrg6+v5v5+tBBBy8CoPPWDo6+nZi1ayl2toY IRvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si7662582pla.81.2019.01.16.14.43.59; Wed, 16 Jan 2019 14:44:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393921AbfAPPL2 (ORCPT + 99 others); Wed, 16 Jan 2019 10:11:28 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:41371 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729301AbfAPPL1 (ORCPT ); Wed, 16 Jan 2019 10:11:27 -0500 Received: by mail-qt1-f194.google.com with SMTP id l12so7450660qtf.8; Wed, 16 Jan 2019 07:11:26 -0800 (PST) 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=4IMG7jlqdMP9fj1j/3+ne8Scrl1K/KH+xgzb4mZhEV0=; b=bI6MPAHStDomHprgy4bg/elQD7wrj0PVr1DflLLR8dDwTD7OiExB4yhWuwC+9mWVKu 9cjzfWE58QLsF7kkGchP+8euOpyZQoiVUXjyQqAa4WeZ2mrhGaFutbkOxf5QdVc2PFUq kkaafPShNhNCrF2HTnKAJt9OTDkg3vrPG8Hqz9jatoU/2OLaHrd4kBjtGxy97bEV8Hlv A8u4zR9MTcup0F1OI2EyMAiYVaf49st+yV2LX02OM8XnoXlezp6qe3+Oehsxmqbj+5uo ETL4EFoskdfU2foBNFjy+2H+RaqTwydSw+CJxQp+IS96aixbRxes91PIfQ1vAn0uZvF8 oRGw== X-Gm-Message-State: AJcUukc7c7O+QZch7LeWvDE++f8J4xE3esXE83OxjyGFNt1wswrucNTF yfrWYw/VQ4hSSdDvMymiGufccqWcsQrSwF1so3s= X-Received: by 2002:ac8:4141:: with SMTP id e1mr7088485qtm.96.1547651485740; Wed, 16 Jan 2019 07:11:25 -0800 (PST) MIME-Version: 1.0 References: <1544604495-4082-1-git-send-email-fabrice.gasnier@st.com> <1544604495-4082-3-git-send-email-fabrice.gasnier@st.com> <9e0ee154-a399-9bff-3beb-adfd9d6c6fee@st.com> In-Reply-To: <9e0ee154-a399-9bff-3beb-adfd9d6c6fee@st.com> From: Arnd Bergmann Date: Wed, 16 Jan 2019 16:11:08 +0100 Message-ID: Subject: Re: [PATCH v2 2/3] mfd: syscon: Add optional clock support To: Fabrice Gasnier Cc: Lee Jones , Rob Herring , Alexandre Torgue , Maxime Coquelin , Mark Rutland , Gabriel Fernandez , DTML , Linux Kernel Mailing List , linux-stm32@st-md-mailman.stormreply.com, Linux ARM 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 Wed, Jan 16, 2019 at 3:10 PM Fabrice Gasnier wrote: > > On 1/16/19 1:14 PM, Arnd Bergmann wrote: > > (sorry for the late reply, I just realized that I had never sent out the > > mail after Lee asked me for a review last year and I had drafted > > my reply). > > Hi Arnd, > > Many thanks for reviewing, no worries :-) > > > > > On Wed, Dec 12, 2018 at 9:48 AM Fabrice Gasnier wrote: > >> > >> Some system control registers need to be clocked, so the registers can > >> be accessed. Add an optional clock and attach it to regmap. > >> > >> Signed-off-by: Fabrice Gasnier > > > > This looks ok to me in principle, but I have one question: When we > > do a clk_get() and clk_prepare() as part of regmap_mmio_attach_clk(), > > does that change the behavior of syscon nodes that are otherwise > > unused? > > I'm not sure I correctly understand this question. I don't think it will > change the behavior for "unused" nodes. These should remain unused with > this patch. What I mean is that nodes that listed as 'compatible="syscon"' get probed by the syscon driver even when no other driver references them, and that in turn would acquire the clock, right? > > I think we have a bunch of devices that started out as a syscon but > > then we added a proper driver for them, which would handle the > > clocks explicitly. Is it guaranteed that this will keep working (including > > shutting down the clocks when they are unused) if we have two drivers > > that call clk_get() on the same device node? > > I'd expect nothing wrong happens when two drivers call clk_get() for the > same clock. > Are there some case where two drivers are bind (e.g. syscon driver + > another driver) for the same piece of hardware ? You won't actually have two drivers binding to the same device, but you could have a driver and a syscon user that does relies on the syscon_regmap_lookup_by_*() functions. I think we've had a couple of cases where we started out representing a device as syscon, and then later decided that a high-level abstraction would be needed because syscon didn't quite support all the needed features. Since each syscon node should also have a more specific compatible value, you can then have another driver that binds to that compatible string. Arnd