LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Rajan Vaja <RAJANV@xilinx.com> To: Stephen Boyd <sboyd@kernel.org> Cc: "linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Jolly Shah <JOLLYS@xilinx.com>, Michal Simek <michals@xilinx.com>, "mturquette@baylibre.com" <mturquette@baylibre.com> Subject: RE: [PATCH] clk: clk-fixed-factor: Use new macro CLK_OF_DECLARE_DRIVER Date: Tue, 17 Jul 2018 16:32:36 +0000 [thread overview] Message-ID: <CY1PR02MB20915AA8CDBAF17050769628B75C0@CY1PR02MB2091.namprd02.prod.outlook.com> (raw) In-Reply-To: <153112117357.143105.12822043691712705626@swboyd.mtv.corp.google.com> Hi Stephen, > -----Original Message----- > From: Stephen Boyd [mailto:sboyd@kernel.org] > Sent: 09 July 2018 12:56 PM > To: Rajan Vaja <RAJANV@xilinx.com> > Cc: linux-clk@vger.kernel.org; linux-kernel@vger.kernel.org; Jolly Shah > <JOLLYS@xilinx.com>; Michal Simek <michals@xilinx.com>; > mturquette@baylibre.com > Subject: RE: [PATCH] clk: clk-fixed-factor: Use new macro > CLK_OF_DECLARE_DRIVER > > EXTERNAL EMAIL > > Quoting Rajan Vaja (2018-06-03 20:41:27) > > > > > > > On the other hand, even if registration failed, that node will be > > > > > > > marked as OF_POPULATED, so probe of clk-fixed-factor.c will also > not > > > > > > > be called and that DT fixed-factor clock would never be registered. > > > > > > > > > > > > > > Same thing is discussed at https://lkml.org/lkml/2017/6/5/681 . > > > > > > > > > > > > Ok. I believe the answer is to fix the DT to describe the parent chain > > > > > > properly with clock-output-names. Otherwise, we have no good way > of > > > > > > figuring out what the name should be. > > > > > [Rajan] clock DT binding doc says that clock-output-names property > > > > > is optional and sometimes not recommended. > > > > > I think this patch fixes the issue we have which mandates to add clock- > > > output- > > > > > names > > > > > property (for this particular case). Also, IIUC platform driver probe in clk- > > > fixed- > > > > > factor.c > > > > > will never be called unless we use CLK_OF_DECLARE_DRIVER. > > > > > I completely agree that proper solution would be to stop using strings to > > > > > describe clock topology. > > > > [Rajan] Any comments on this? > > > > Unless we have proper solution ready, we need to have some mechanism > to > > > handle this scenario. > > > > clock-output-names is optional and without this, it mandates to use clock- > > > output-names. > > > > > > > > > > I couldn't read your outlook sent email and I was too busy to go > > > translate it. Some bug in my MUA it seems. > > > > > > Can you add the output-names property? In this case it's practically > > > mandatory, so if you can't do it I'd like to hear why not. > > [Rajan] In our case, we are firmware maintains clock database and driver > query clocks > > from firmware and registers clock based on information received from > firmware. So > > output clock names are not fixed. > > https://patchwork.kernel.org/patch/10439893/ - dt-bindings: clock: Add > bindings for ZynqMP clock driver > > https://patchwork.kernel.org/patch/10439891/ - drivers: clk: Add ZynqMP > clock driver > > output-names are fixed by the time firmware is made. Is the DT also > fixed by the time firmware is made? Why can't the DT be made to match > what the firmware is describing by having the firmware update the DT to > describe it's output names? [Rajan] The idea is to have a generic driver which queries clock for the variant from Firmware. So if some clock changes, driver remains same. > > And what is this fixed factor clk in DT for? > > I'm beginning to think that maybe we should make the fixed factor setup > a little worse by having it unmark itself as OF_POPULATED if it finds > that the DT node has a clocks property that it can't find a name for. > Hopefully we can get by with it registering later on because it isn't > critical for the system to bootstrap interrupts and timers. [Rajan] I have submitted separate change for this https://patchwork.kernel.org/patch/10529387/. > > I take it you understand that changing the code to be > CLK_OF_DECLARE_DRIVER will be actively bad and cause the clk to be > registered potentially twice so we really need to fix the real issue > which is that the parent name can't be figured out until later on, so > the CLK_OF_DECLARE path needs to fail when it can't find the parent it > needs and then manually mark itself as not populated in that case so > that it probes later on with the platform device driver. Unmarking the > node can actually be used to flag a failure in the init function so that > we don't keep trying to do things with the node until driver time too. [Rajan] I understood that making it CLK_OF_DECLARE_DRIVER will try to register clock twice.
prev parent reply other threads:[~2018-07-17 16:32 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-03-08 14:15 [PATCH] clk: clk-fixed-factor: Use new macro CLK_OF_DECLARE_DRIVER Rajan Vaja 2018-03-09 18:24 ` Stephen Boyd 2018-03-09 19:27 ` Rajan Vaja 2018-03-15 18:47 ` Stephen Boyd 2018-03-16 11:49 ` Rajan Vaja 2018-05-03 9:18 ` Rajan Vaja 2018-06-02 6:40 ` Stephen Boyd 2018-06-04 3:41 ` Rajan Vaja 2018-07-06 10:54 ` Rajan Vaja 2018-07-09 7:26 ` Stephen Boyd 2018-07-17 16:32 ` Rajan Vaja [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CY1PR02MB20915AA8CDBAF17050769628B75C0@CY1PR02MB2091.namprd02.prod.outlook.com \ --to=rajanv@xilinx.com \ --cc=JOLLYS@xilinx.com \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=michals@xilinx.com \ --cc=mturquette@baylibre.com \ --cc=sboyd@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).