From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Viresh Kumar <viresh.kumar@linaro.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, Peter Geis <pgwipeout@gmail.com>
Subject: Re: [PATCH v1 11/11] ARM: tegra: Create platform device for tegra20-cpufreq driver
Date: Fri, 18 May 2018 12:30:21 +0300 [thread overview]
Message-ID: <1ca8f874-40da-05b4-0b76-116164c85137@gmail.com> (raw)
In-Reply-To: <20180518091352.GK14500@ulmo>
On 18.05.2018 12:13, Thierry Reding wrote:
> On Thu, May 17, 2018 at 09:00:56PM +0300, Dmitry Osipenko wrote:
>> Tegra20-cpufreq driver require a platform device in order to be loaded,
>> instantiate a simple platform device for the driver during of the machines
>> late initialization.
>>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>> arch/arm/mach-tegra/tegra.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
>> index 02e712d2ea30..f9587be48235 100644
>> --- a/arch/arm/mach-tegra/tegra.c
>> +++ b/arch/arm/mach-tegra/tegra.c
>> @@ -97,6 +97,10 @@ static void __init tegra_dt_init_late(void)
>> if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
>> of_machine_is_compatible("compal,paz00"))
>> tegra_paz00_wifikill_init();
>> +
>> + if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
>> + of_machine_is_compatible("nvidia,tegra20"))
>> + platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
>> }
>>
>> static const char * const tegra_dt_board_compat[] = {
>
> Tegra124 has a CPU frequency driver that is similar to this and it
> contains code that will instantiate the platform device from the CPU
> frequency driver's module_init function.
>
> I think the primary reason for doing that was to not tie the code to
> 32-bit ARM, even though it never runs on anything but that, so it's
> slightly over-engineered.
The tegra124-cpufreq driver likely to be broken in regards to the module loading
as platform_device_register_simple() seem to be allowed invoked only from the
kernel itself.
Having platform_device_register_simple in the kernels module leads to a such
errors on the module loading:
# section 5 reloc 7 sym 'memset': relocation 10 out of range (0xbf805030 ->
0xc088c481)
Initially I wanted to make tegra124-cpufreq a module_platform_driver, but
decided to postpone that, as the driver is shared with ARM64 Tegra132 which
doesn't have machine-init code. Maybe we could move the devices instantiation to
something common like driver/soc/tegra/devices.c later.
> I don't mind either way, and it's easy enough to change this to
> something else later on if we want. I'll pick this up into the Tegra
> tree.
Okay, thanks.
next prev parent reply other threads:[~2018-05-18 9:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 18:00 [PATCH v1 00/11] Clean up Tegra20 cpufreq driver Dmitry Osipenko
2018-05-17 18:00 ` [PATCH v1 01/11] cpufreq: tegra20: Change module description Dmitry Osipenko
2018-05-18 1:53 ` Viresh Kumar
2018-05-18 8:34 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 02/11] cpufreq: tegra20: Clean up whitespaces in the code Dmitry Osipenko
2018-05-18 1:54 ` Viresh Kumar
2018-05-18 8:34 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 03/11] cpufreq: tegra20: Remove EMC clock usage Dmitry Osipenko
2018-05-18 1:54 ` Viresh Kumar
2018-05-18 8:36 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 04/11] cpufreq: tegra20: Release clocks properly Dmitry Osipenko
2018-05-18 1:55 ` Viresh Kumar
2018-05-18 8:37 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 05/11] cpufreq: tegra20: Clean up included headers Dmitry Osipenko
2018-05-18 1:58 ` Viresh Kumar
2018-05-18 8:05 ` Dmitry Osipenko
2018-05-18 8:57 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 06/11] cpufreq: tegra20: Remove unneeded check in tegra_cpu_init Dmitry Osipenko
2018-05-18 1:59 ` Viresh Kumar
2018-05-18 8:57 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 07/11] cpufreq: tegra20: Check if this is Tegra20 machine Dmitry Osipenko
2018-05-18 1:59 ` Viresh Kumar
2018-05-18 8:58 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 08/11] cpufreq: tegra20: Remove unneeded variable initialization Dmitry Osipenko
2018-05-18 2:00 ` Viresh Kumar
2018-05-18 8:58 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 09/11] cpufreq: tegra20: Allow cpufreq driver to be built as loadable module Dmitry Osipenko
2018-05-18 2:00 ` Viresh Kumar
2018-05-18 9:00 ` Thierry Reding
2018-05-17 18:00 ` [PATCH v1 10/11] cpufreq: tegra20: Wrap cpufreq into platform driver Dmitry Osipenko
2018-05-18 2:07 ` Viresh Kumar
2018-05-18 8:09 ` Dmitry Osipenko
2018-05-18 9:04 ` Viresh Kumar
2018-05-18 9:07 ` Thierry Reding
2018-05-18 9:19 ` Dmitry Osipenko
2018-05-17 18:00 ` [PATCH v1 11/11] ARM: tegra: Create platform device for tegra20-cpufreq driver Dmitry Osipenko
2018-05-18 2:07 ` Viresh Kumar
2018-05-18 9:13 ` Thierry Reding
2018-05-18 9:30 ` Dmitry Osipenko [this message]
2018-05-18 7:30 ` [PATCH v1 00/11] Clean up Tegra20 cpufreq driver Rafael J. Wysocki
2018-05-18 8:18 ` Dmitry Osipenko
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=1ca8f874-40da-05b4-0b76-116164c85137@gmail.com \
--to=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pgwipeout@gmail.com \
--cc=rjw@rjwysocki.net \
--cc=thierry.reding@gmail.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 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).