Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1427181

Re: [PATCH 1/3] clk: Add new function of_clk_is_provider()

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] clk: Add new function of_clk_is_provider()
Date 2016-06-21 03:40 +0200
Message-ID <rMiPv-7uu-1@gated-at.bofh.it> (permalink)
References <rHIUi-7mg-5@gated-at.bofh.it> <rHIUi-7mg-17@gated-at.bofh.it> <rKtFn-1j0-1@gated-at.bofh.it> <rM7U6-w3-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(Please don't top post)

On 06/20, Ricardo Ribalda Delgado wrote:
> Hi Stephen
> 
> When the device tree is populated or when an overlay is added, all its
> nodes have the flag OF_POPULATED set. The flag is enabled recursively
> in
> of_platform_bus_create->of_platform_device_create_pdata()
> So we cannot use that flag to mark what is enabled and what is not.

Sorry I don't follow the reasoning here. I'm not asking to test
that flag in an of_clk_is_provider() API. The goal is to not have
an of_clk_is_provider() API.

I was thinking that of_clk_init() would mark any nodes that
matched and provided clk providers as OF_POPULATED. That way,
when of_platform_populate() ran, it would *not* add platform
devices for clk providers that we registered during the
of_clk_init() phase. Then we could have platform drivers and
CLK_OF_DECLARE drivers for the same compatible strings, but we
wouldn't probe random platform drivers for the nodes that we
handled early on and we wouldn't need to litter
of_clk_is_provider() in driver probe routines.

> 
> The other issue that I see is of_clk_mutex. Whatever final
> implementation that we decide to do, it should take into consideration
> that mutex, otherwise it will not be thread-safe.
> of_clk_is_provider() is already taking care of it.
> 
> Another advantage of of_clk_is_provider() is that it opens the door to
> implement something like:  CLK_OF_DECLARE_EARLY_PLATFORM(probe,remove)
>  That allows a driver to implement early clk and platform clk at the
> same time and automatically, following a logic similar to what I have
> done in fixed-clk.

Something like CLK_OF_DECLARE_EARLY_PLATFORM() sounds like it may
be good (I haven't looked at the patch). We'll need something to
say that there's CLK_OF_DECLARE and a platform driver for the
same node.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/3] clk: Add new function of_clk_is_provider() Stephen Boyd <sboyd@codeaurora.org> - 2016-06-16 02:50 +0200
  Re: [PATCH 1/3] clk: Add new function of_clk_is_provider() Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2016-06-20 16:00 +0200
    Re: [PATCH 1/3] clk: Add new function of_clk_is_provider() Stephen Boyd <sboyd@codeaurora.org> - 2016-06-21 03:40 +0200
      Re: [PATCH 1/3] clk: Add new function of_clk_is_provider() Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2016-06-21 10:40 +0200

csiph-web