From: Stephen Boyd <sboyd@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
Viresh Kumar <viresh.kumar@linaro.org>,
stefan.wahren@i2se.com
Cc: linux-arm-kernel@lists.infradead.org, f.fainelli@gmail.com,
ptesarik@suse.com, mturquette@baylibre.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
eric@anholt.net, bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
mbrugger@suse.de, ssuloev@orpaltech.com
Subject: Re: [PATCH v2 4/7] cpufreq: add driver for Raspbery Pi
Date: Thu, 06 Jun 2019 11:23:34 -0700 [thread overview]
Message-ID: <20190606182335.1D15F20872@mail.kernel.org> (raw)
In-Reply-To: <153579ddd7e6bd1e5c860a7a01115e47c78a1442.camel@suse.de>
Quoting Nicolas Saenz Julienne (2019-06-06 11:10:04)
> On Thu, 2019-06-06 at 10:36 -0700, Stephen Boyd wrote:
> > Quoting Nicolas Saenz Julienne (2019-06-06 10:22:16)
> > > Hi Stephen,
> > > Thanks for the review.
> > >
> > > On Thu, 2019-06-06 at 10:09 -0700, Stephen Boyd wrote:
> > > > Quoting Nicolas Saenz Julienne (2019-06-06 07:22:56)
> > > > > diff --git a/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > > b/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > > new file mode 100644
> > > > > index 000000000000..99b59d5a50aa
> > > > > --- /dev/null
> > > > > +++ b/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > [...]
> > > > > +
> > > > > +/*
> > > > > + * Since the driver depends on clk-raspberrypi, which may return
> > > > > EPROBE_DEFER,
> > > > > + * all the activity is performed in the probe, which may be defered as
> > > > > well.
> > > > > + */
> > > > > +static struct platform_driver raspberrypi_cpufreq_driver = {
> > > > > + .driver = {
> > > > > + .name = "raspberrypi-cpufreq",
> > > > > + },
> > > > > + .probe = raspberrypi_cpufreq_probe,
> > > > > + .remove = raspberrypi_cpufreq_remove,
> > > > > +};
> > > > > +module_platform_driver(raspberrypi_cpufreq_driver);
> > > >
> > > > How does this driver probe? Do you have a node in DT named
> > > > raspberrypi-cpufreq that matches and probes this? I would think this
> > > > would follow the drivers/cpufreq/cpufreq-dt-platdev.c design where it's
> > > > an initcall that probes the board compatible string.
> > > >
> > > > Or, if it depends on clk-raspberrypi probing, maybe it could create the
> > > > platform device in that drivers probe function.
> > >
> > > Well you just reviewed that patch :)
> >
> > Ok. So what's your plan?
>
> So as discussed previously with the RPi mantainers, they preferred for the
> platform device for raspberrypi-clk to be created by the firmware interface
> driver. IIRC Stefan said it was more flexible and the approach used with RPi's
> hwmon driver already. Also, it's not really clear whether this driver really
> fits the device tree as it wouldn't be describing hardware.
>
> As far as raspberrypi-cpufreq is concerned the max and min frequencies are
> configurable in the firmware. So we can't really integrate cpufreq into the
> device tree as we need to create the opp table dynamically. Hence the dedicated
> driver. On top of that the CPU might not have a clock during the init process,
> as both the firmware interface and raspberrypi-clk can be compiled as modules.
> So I decided the simplest solution was to create the raspberrypi-cpufreq
> platform device at the end of raspberrypi-clk's probe.
>
> Once raspberrypi-cpufreq is loaded it queries the min/max frequencies,
> populates the CPU's opp table and creates an instance of cpufreq-dt. Which
> finally can operate, without the need of any dt info, as opp tables are
> populated and CPUs have a clock.
>
> I hope this makes it a little more clear :).
>
Yes, thanks. I see that largely follows the commit description so it
looks OK to me.
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
Viresh Kumar <viresh.kumar@linaro.org>,
stefan.wahren@i2se.com
Cc: f.fainelli@gmail.com, linux-pm@vger.kernel.org,
mturquette@baylibre.com, ptesarik@suse.com,
linux-kernel@vger.kernel.org, mbrugger@suse.de, eric@anholt.net,
bcm-kernel-feedback-list@broadcom.com,
linux-rpi-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, ssuloev@orpaltech.com
Subject: Re: [PATCH v2 4/7] cpufreq: add driver for Raspbery Pi
Date: Thu, 06 Jun 2019 11:23:34 -0700 [thread overview]
Message-ID: <20190606182335.1D15F20872@mail.kernel.org> (raw)
In-Reply-To: <153579ddd7e6bd1e5c860a7a01115e47c78a1442.camel@suse.de>
Quoting Nicolas Saenz Julienne (2019-06-06 11:10:04)
> On Thu, 2019-06-06 at 10:36 -0700, Stephen Boyd wrote:
> > Quoting Nicolas Saenz Julienne (2019-06-06 10:22:16)
> > > Hi Stephen,
> > > Thanks for the review.
> > >
> > > On Thu, 2019-06-06 at 10:09 -0700, Stephen Boyd wrote:
> > > > Quoting Nicolas Saenz Julienne (2019-06-06 07:22:56)
> > > > > diff --git a/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > > b/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > > new file mode 100644
> > > > > index 000000000000..99b59d5a50aa
> > > > > --- /dev/null
> > > > > +++ b/drivers/cpufreq/raspberrypi-cpufreq.c
> > > > [...]
> > > > > +
> > > > > +/*
> > > > > + * Since the driver depends on clk-raspberrypi, which may return
> > > > > EPROBE_DEFER,
> > > > > + * all the activity is performed in the probe, which may be defered as
> > > > > well.
> > > > > + */
> > > > > +static struct platform_driver raspberrypi_cpufreq_driver = {
> > > > > + .driver = {
> > > > > + .name = "raspberrypi-cpufreq",
> > > > > + },
> > > > > + .probe = raspberrypi_cpufreq_probe,
> > > > > + .remove = raspberrypi_cpufreq_remove,
> > > > > +};
> > > > > +module_platform_driver(raspberrypi_cpufreq_driver);
> > > >
> > > > How does this driver probe? Do you have a node in DT named
> > > > raspberrypi-cpufreq that matches and probes this? I would think this
> > > > would follow the drivers/cpufreq/cpufreq-dt-platdev.c design where it's
> > > > an initcall that probes the board compatible string.
> > > >
> > > > Or, if it depends on clk-raspberrypi probing, maybe it could create the
> > > > platform device in that drivers probe function.
> > >
> > > Well you just reviewed that patch :)
> >
> > Ok. So what's your plan?
>
> So as discussed previously with the RPi mantainers, they preferred for the
> platform device for raspberrypi-clk to be created by the firmware interface
> driver. IIRC Stefan said it was more flexible and the approach used with RPi's
> hwmon driver already. Also, it's not really clear whether this driver really
> fits the device tree as it wouldn't be describing hardware.
>
> As far as raspberrypi-cpufreq is concerned the max and min frequencies are
> configurable in the firmware. So we can't really integrate cpufreq into the
> device tree as we need to create the opp table dynamically. Hence the dedicated
> driver. On top of that the CPU might not have a clock during the init process,
> as both the firmware interface and raspberrypi-clk can be compiled as modules.
> So I decided the simplest solution was to create the raspberrypi-cpufreq
> platform device at the end of raspberrypi-clk's probe.
>
> Once raspberrypi-cpufreq is loaded it queries the min/max frequencies,
> populates the CPU's opp table and creates an instance of cpufreq-dt. Which
> finally can operate, without the need of any dt info, as opp tables are
> populated and CPUs have a clock.
>
> I hope this makes it a little more clear :).
>
Yes, thanks. I see that largely follows the commit description so it
looks OK to me.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-06-06 18:23 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 14:22 [PATCH v2 0/7] cpufreq support for Raspberry Pi Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 14:22 ` [PATCH v2 1/7] clk: bcm2835: remove pllb Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 14:22 ` [PATCH v2 2/7] clk: bcm283x: add driver interfacing with Raspberry Pi's firmware Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 14:42 ` Nicolas Saenz Julienne
2019-06-06 14:42 ` Nicolas Saenz Julienne
2019-06-07 9:26 ` Stefan Wahren
2019-06-07 9:26 ` Stefan Wahren
2019-06-07 9:42 ` Nicolas Saenz Julienne
2019-06-07 9:42 ` Nicolas Saenz Julienne
2019-06-07 10:04 ` Stefan Wahren
2019-06-07 10:04 ` Stefan Wahren
2019-06-06 14:22 ` [PATCH v2 3/7] firmware: raspberrypi: register clk device Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 14:22 ` [PATCH v2 4/7] cpufreq: add driver for Raspbery Pi Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 17:09 ` Stephen Boyd
2019-06-06 17:09 ` Stephen Boyd
2019-06-06 17:22 ` Nicolas Saenz Julienne
2019-06-06 17:22 ` Nicolas Saenz Julienne
2019-06-06 17:36 ` Stephen Boyd
2019-06-06 17:36 ` Stephen Boyd
2019-06-06 18:10 ` Nicolas Saenz Julienne
2019-06-06 18:10 ` Nicolas Saenz Julienne
2019-06-06 18:23 ` Stephen Boyd [this message]
2019-06-06 18:23 ` Stephen Boyd
2019-06-06 18:31 ` Nicolas Saenz Julienne
2019-06-06 18:31 ` Nicolas Saenz Julienne
2019-06-07 3:09 ` Viresh Kumar
2019-06-07 3:09 ` Viresh Kumar
2019-06-07 9:13 ` Stefan Wahren
2019-06-07 9:13 ` Stefan Wahren
2019-06-07 19:02 ` Stephen Boyd
2019-06-07 19:02 ` Stephen Boyd
2019-06-07 11:42 ` Stefan Wahren
2019-06-07 11:42 ` Stefan Wahren
2019-06-07 11:57 ` Nicolas Saenz Julienne
2019-06-07 11:57 ` Nicolas Saenz Julienne
2019-06-06 14:22 ` [PATCH v2 5/7] clk: raspberrypi: register platform device for raspberrypi-cpufreq Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-06 17:05 ` Stephen Boyd
2019-06-06 17:05 ` Stephen Boyd
2019-06-06 17:16 ` Nicolas Saenz Julienne
2019-06-06 17:16 ` Nicolas Saenz Julienne
2019-06-06 17:20 ` Stephen Boyd
2019-06-06 17:20 ` Stephen Boyd
2019-06-06 14:22 ` [PATCH v2 6/7] ARM: defconfig: enable cpufreq driver for RPi Nicolas Saenz Julienne
2019-06-06 14:22 ` Nicolas Saenz Julienne
2019-06-07 11:30 ` Stefan Wahren
2019-06-07 11:30 ` Stefan Wahren
2019-06-06 14:23 ` [PATCH v2 7/7] arm64: defconfig: enable cpufreq support for RPi3 Nicolas Saenz Julienne
2019-06-06 14:23 ` Nicolas Saenz Julienne
2019-06-07 10:19 ` Stefan Wahren
2019-06-07 10:19 ` Stefan Wahren
2019-06-07 10:25 ` Nicolas Saenz Julienne
2019-06-07 10:25 ` Nicolas Saenz Julienne
2019-06-08 10:43 ` [PATCH v2 0/7] cpufreq support for Raspberry Pi Stefan Wahren
2019-06-08 10:43 ` Stefan Wahren
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=20190606182335.1D15F20872@mail.kernel.org \
--to=sboyd@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mbrugger@suse.de \
--cc=mturquette@baylibre.com \
--cc=nsaenzjulienne@suse.de \
--cc=ptesarik@suse.com \
--cc=rjw@rjwysocki.net \
--cc=ssuloev@orpaltech.com \
--cc=stefan.wahren@i2se.com \
--cc=viresh.kumar@linaro.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.