From: Michal Simek <michal.simek@xilinx.com>
To: Arnd Bergmann <arnd@arndb.de>, Michal Simek <michal.simek@xilinx.com>
Cc: Amit Sunil Dhamne <amit.sunil.dhamne@xilinx.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Ingo Molnar <mingo@kernel.org>,
gregkh <gregkh@linuxfoundation.org>,
Matt Fleming <matt@codeblueprint.co.uk>,
Sudeep Holla <sudeep.holla@arm.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Kees Cook <keescook@chromium.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
rajanv@xilinx.com,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
tejasp@xilinx.com, Jolly Shah <jollys@xilinx.com>,
Rajan Vaja <rajan.vaja@xilinx.com>
Subject: Re: [PATCH v2] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe
Date: Fri, 11 Sep 2020 11:22:06 +0200 [thread overview]
Message-ID: <f90e00b6-2663-c5cd-41b6-93cd54432a6a@xilinx.com> (raw)
In-Reply-To: <CAK8P3a1aaS85m5nv0hmmxgEVss-hNGL7Qg8iosSFDjDdzzP87Q@mail.gmail.com>
On 10. 09. 20 10:35, Arnd Bergmann wrote:
> On Thu, Sep 10, 2020 at 8:50 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>> @@ -246,6 +245,23 @@ static int zynqmp_pm_remove(struct platform_device *pdev)
>>> return 0;
>>> }
>>>
>>> +static int __init do_init_finalize(void)
>>> +{
>>> + struct device_node *np;
>>> +
>>> + np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp");
>>> + if (!np) {
>>> + np = of_find_compatible_node(NULL, NULL, "xlnx,versal");
>>> + if (!np)
>>> + return 0;
>>> + }
>>> + of_node_put(np);
>>> +
>>> + return zynqmp_pm_init_finalize();
>>> +}
>>> +
>>> +late_initcall_sync(do_init_finalize);
>>> +
>>> static const struct of_device_id pm_of_match[] = {
>>> { .compatible = "xlnx,zynqmp-power", },
>>> { /* end of table */ },
>>>
>>
>> Arnd: are you fine with this way how to check that it runs on zynqmp or
>> versal?
>
> I might be missing something, but this sounds like the wrong way to do it.
> There is already a platform driver probed in the presence of the
> "xlnx,zynqmp-power" node in the same file. Wouldn't it be better to
> either check for the same node instead of an arbitrarily different set
> of SoC names, or to make the platform driver itself get registered
> form the late initcall?
Rajan/Amit: On the top of my head I expect that you can't call it as
late initcall because you need the first part earlier.
Does it make sense to check same node?
There is and should be only one instance of this driver.
Isn't it easier just to setup one static variable instead of calling dt
functions which will take time and result will be the same.
Thanks,
Michal
next prev parent reply other threads:[~2020-09-11 9:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 23:10 Amit Sunil Dhamne
2020-09-10 6:49 ` Michal Simek
2020-09-10 8:35 ` Arnd Bergmann
2020-09-11 9:22 ` Michal Simek [this message]
2020-09-11 9:33 ` Rajan Vaja
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=f90e00b6-2663-c5cd-41b6-93cd54432a6a@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=amit.sunil.dhamne@xilinx.com \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hkallweit1@gmail.com \
--cc=jollys@xilinx.com \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mingo@kernel.org \
--cc=rajan.vaja@xilinx.com \
--cc=rajanv@xilinx.com \
--cc=sudeep.holla@arm.com \
--cc=tejasp@xilinx.com \
/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: link
Be 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
all inboxes | Powered by JetHome®