linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: 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: Thu, 10 Sep 2020 10:35:07 +0200	[thread overview]
Message-ID: <CAK8P3a1aaS85m5nv0hmmxgEVss-hNGL7Qg8iosSFDjDdzzP87Q@mail.gmail.com> (raw)
In-Reply-To: <ac2ab6d1-69c9-34aa-6c25-588bacc78002@xilinx.com>

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?

       Arnd

  reply	other threads:[~2020-09-10  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 23:10 [PATCH v2] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe Amit Sunil Dhamne
2020-09-10  6:49 ` Michal Simek
2020-09-10  8:35   ` Arnd Bergmann [this message]
2020-09-11  9:22     ` Michal Simek
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=CAK8P3a1aaS85m5nv0hmmxgEVss-hNGL7Qg8iosSFDjDdzzP87Q@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=amit.sunil.dhamne@xilinx.com \
    --cc=ard.biesheuvel@linaro.org \
    --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=michal.simek@xilinx.com \
    --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;
as well as URLs for NNTP newsgroup(s).