From: Krzysztof Kozlowski <krzk@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: ulf.hansson@linaro.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>, Kukjin Kim <kgene@kernel.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
nks@flawful.org, georgi.djakov@linaro.org,
Stephan Gerhold <stephan@gerhold.net>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH V2 1/2] opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
Date: Mon, 24 Aug 2020 11:17:24 +0200 [thread overview]
Message-ID: <20200824091724.GB20819@kozik-lap> (raw)
In-Reply-To: <24ff92dd1b0ee1b802b45698520f2937418f8094.1598260050.git.viresh.kumar@linaro.org>
On Mon, Aug 24, 2020 at 02:39:32PM +0530, Viresh Kumar wrote:
> From: Stephan Gerhold <stephan@gerhold.net>
>
> The OPP core manages various resources, e.g. clocks or interconnect paths.
> These resources are looked up when the OPP table is allocated once
> dev_pm_opp_get_opp_table() is called the first time (either directly
> or indirectly through one of the many helper functions).
>
> At this point, the resources may not be available yet, i.e. looking them
> up will result in -EPROBE_DEFER. Unfortunately, dev_pm_opp_get_opp_table()
> is currently unable to propagate this error code since it only returns
> the allocated OPP table or NULL.
>
> This means that all consumers of the OPP core are required to make sure
> that all necessary resources are available. Usually this happens by
> requesting them, checking the result and releasing them immediately after.
>
> For example, we have added "dev_pm_opp_of_find_icc_paths(dev, NULL)" to
> several drivers now just to make sure the interconnect providers are
> ready before the OPP table is allocated. If this call is missing,
> the OPP core will only warn about this and then attempt to continue
> without interconnect. This will eventually fail horribly, e.g.:
>
> cpu cpu0: _allocate_opp_table: Error finding interconnect paths: -517
> ... later ...
> of: _read_bw: Mismatch between opp-peak-kBps and paths (1 0)
> cpu cpu0: _opp_add_static_v2: opp key field not found
> cpu cpu0: _of_add_opp_table_v2: Failed to add OPP, -22
>
> This example happens when trying to use interconnects for a CPU OPP
> table together with qcom-cpufreq-nvmem.c. qcom-cpufreq-nvmem calls
> dev_pm_opp_set_supported_hw(), which ends up allocating the OPP table
> early. To fix the problem with the current approach we would need to add
> yet another call to dev_pm_opp_of_find_icc_paths(dev, NULL).
> But actually qcom-cpufreq-nvmem.c has nothing to do with interconnects...
>
> This commit attempts to make this more robust by allowing
> dev_pm_opp_get_opp_table() to return an error pointer. Fixing all
> the usages is trivial because the function is usually used indirectly
> through another helper (e.g. dev_pm_opp_set_supported_hw() above).
> These other helpers already return an error pointer.
>
> The example above then works correctly because set_supported_hw() will
> return -EPROBE_DEFER, and qcom-cpufreq-nvmem.c already propagates that
> error. It should also be possible to remove the remaining usages of
> "dev_pm_opp_of_find_icc_paths(dev, NULL)" from other drivers as well.
>
> Note that this commit currently only handles -EPROBE_DEFER for the
> clock/interconnects within _allocate_opp_table(). Other errors are just
> ignored as before. Eventually those should be propagated as well.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> [ Viresh: skip checking return value of dev_pm_opp_get_opp_table() for
> EPROBE_DEFER in domain.c, fix NULL return value and reorder
> code a bit in core.c, and update exynos-asv.c ]
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> Stephan, I have made some changes to the code. Please try it again and
> lemme know if it works fine.
>
> drivers/base/power/domain.c | 14 +++++----
> drivers/opp/core.c | 53 +++++++++++++++++++-------------
> drivers/opp/of.c | 8 ++---
> drivers/soc/samsung/exynos-asv.c | 2 +-
> 4 files changed, 44 insertions(+), 33 deletions(-)
For Samsung:
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Nishanth Menon <nm@ti.com>, Len Brown <len.brown@intel.com>,
ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Stephan Gerhold <stephan@gerhold.net>,
Kevin Hilman <khilman@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-kernel@vger.kernel.org, nks@flawful.org,
Kukjin Kim <kgene@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Viresh Kumar <vireshk@kernel.org>,
georgi.djakov@linaro.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 1/2] opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
Date: Mon, 24 Aug 2020 11:17:24 +0200 [thread overview]
Message-ID: <20200824091724.GB20819@kozik-lap> (raw)
In-Reply-To: <24ff92dd1b0ee1b802b45698520f2937418f8094.1598260050.git.viresh.kumar@linaro.org>
On Mon, Aug 24, 2020 at 02:39:32PM +0530, Viresh Kumar wrote:
> From: Stephan Gerhold <stephan@gerhold.net>
>
> The OPP core manages various resources, e.g. clocks or interconnect paths.
> These resources are looked up when the OPP table is allocated once
> dev_pm_opp_get_opp_table() is called the first time (either directly
> or indirectly through one of the many helper functions).
>
> At this point, the resources may not be available yet, i.e. looking them
> up will result in -EPROBE_DEFER. Unfortunately, dev_pm_opp_get_opp_table()
> is currently unable to propagate this error code since it only returns
> the allocated OPP table or NULL.
>
> This means that all consumers of the OPP core are required to make sure
> that all necessary resources are available. Usually this happens by
> requesting them, checking the result and releasing them immediately after.
>
> For example, we have added "dev_pm_opp_of_find_icc_paths(dev, NULL)" to
> several drivers now just to make sure the interconnect providers are
> ready before the OPP table is allocated. If this call is missing,
> the OPP core will only warn about this and then attempt to continue
> without interconnect. This will eventually fail horribly, e.g.:
>
> cpu cpu0: _allocate_opp_table: Error finding interconnect paths: -517
> ... later ...
> of: _read_bw: Mismatch between opp-peak-kBps and paths (1 0)
> cpu cpu0: _opp_add_static_v2: opp key field not found
> cpu cpu0: _of_add_opp_table_v2: Failed to add OPP, -22
>
> This example happens when trying to use interconnects for a CPU OPP
> table together with qcom-cpufreq-nvmem.c. qcom-cpufreq-nvmem calls
> dev_pm_opp_set_supported_hw(), which ends up allocating the OPP table
> early. To fix the problem with the current approach we would need to add
> yet another call to dev_pm_opp_of_find_icc_paths(dev, NULL).
> But actually qcom-cpufreq-nvmem.c has nothing to do with interconnects...
>
> This commit attempts to make this more robust by allowing
> dev_pm_opp_get_opp_table() to return an error pointer. Fixing all
> the usages is trivial because the function is usually used indirectly
> through another helper (e.g. dev_pm_opp_set_supported_hw() above).
> These other helpers already return an error pointer.
>
> The example above then works correctly because set_supported_hw() will
> return -EPROBE_DEFER, and qcom-cpufreq-nvmem.c already propagates that
> error. It should also be possible to remove the remaining usages of
> "dev_pm_opp_of_find_icc_paths(dev, NULL)" from other drivers as well.
>
> Note that this commit currently only handles -EPROBE_DEFER for the
> clock/interconnects within _allocate_opp_table(). Other errors are just
> ignored as before. Eventually those should be propagated as well.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> [ Viresh: skip checking return value of dev_pm_opp_get_opp_table() for
> EPROBE_DEFER in domain.c, fix NULL return value and reorder
> code a bit in core.c, and update exynos-asv.c ]
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> Stephan, I have made some changes to the code. Please try it again and
> lemme know if it works fine.
>
> drivers/base/power/domain.c | 14 +++++----
> drivers/opp/core.c | 53 +++++++++++++++++++-------------
> drivers/opp/of.c | 8 ++---
> drivers/soc/samsung/exynos-asv.c | 2 +-
> 4 files changed, 44 insertions(+), 33 deletions(-)
For Samsung:
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
_______________________________________________
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:[~2020-08-24 9:17 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 9:09 [PATCH V2 1/2] opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER Viresh Kumar
2020-08-24 9:09 ` Viresh Kumar
2020-08-24 9:09 ` [PATCH V2 2/2] cpufreq: dt: Refactor initialization to handle probe deferral properly Viresh Kumar
2020-08-24 14:25 ` kernel test robot
2020-08-24 14:25 ` [PATCH] cpufreq: dt: fix semicolon.cocci warnings kernel test robot
2020-08-25 4:29 ` Viresh Kumar
2020-09-01 8:57 ` [PATCH V2 2/2] cpufreq: dt: Refactor initialization to handle probe deferral properly Marek Szyprowski
2020-09-01 9:45 ` Viresh Kumar
2020-09-01 10:05 ` Marek Szyprowski
2020-09-01 10:12 ` Viresh Kumar
2020-10-13 9:47 ` Geert Uytterhoeven
2020-10-13 9:56 ` Viresh Kumar
2020-10-14 16:40 ` Geert Uytterhoeven
2020-10-16 5:03 ` Viresh Kumar
2020-10-16 6:44 ` Geert Uytterhoeven
2020-10-16 8:07 ` Viresh Kumar
2020-10-27 16:29 ` Geert Uytterhoeven
2020-10-28 5:48 ` Viresh Kumar
2020-10-28 9:49 ` Geert Uytterhoeven
2020-10-28 9:52 ` Viresh Kumar
2020-08-24 9:17 ` Krzysztof Kozlowski [this message]
2020-08-24 9:17 ` [PATCH V2 1/2] opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER Krzysztof Kozlowski
2020-08-24 11:08 ` Ulf Hansson
2020-08-24 11:08 ` Ulf Hansson
2020-08-24 11:39 ` Stephan Gerhold
2020-08-24 11:39 ` Stephan Gerhold
2020-10-15 18:05 ` Sudeep Holla
2020-10-15 18:05 ` Sudeep Holla
2020-10-16 4:24 ` Viresh Kumar
2020-10-16 4:24 ` Viresh Kumar
2020-10-16 6:00 ` Sudeep Holla
2020-10-16 6:00 ` Sudeep Holla
2020-10-16 11:12 ` Sudeep Holla
2020-10-16 11:12 ` Sudeep Holla
2020-10-16 15:28 ` Stephan Gerhold
2020-10-16 15:28 ` Stephan Gerhold
2020-10-19 4:58 ` Viresh Kumar
2020-10-19 4:58 ` Viresh Kumar
2020-10-19 9:17 ` Sudeep Holla
2020-10-19 9:17 ` Sudeep Holla
2020-10-19 9:24 ` Viresh Kumar
2020-10-19 9:24 ` Viresh Kumar
2020-10-19 10:12 ` Sudeep Holla
2020-10-19 10:12 ` Sudeep Holla
2020-10-19 10:35 ` Viresh Kumar
2020-10-19 10:35 ` Viresh Kumar
2020-10-19 14:10 ` Sudeep Holla
2020-10-19 14:10 ` Sudeep Holla
2020-10-20 5:05 ` Viresh Kumar
2020-10-20 5:05 ` Viresh Kumar
2020-10-20 5:54 ` Viresh Kumar
2020-10-20 5:54 ` Viresh Kumar
2020-10-20 9:37 ` Sudeep Holla
2020-10-20 9:37 ` Sudeep Holla
2020-10-20 9:41 ` Viresh Kumar
2020-10-20 9:41 ` Viresh Kumar
2020-10-20 9:52 ` Sudeep Holla
2020-10-20 9:52 ` Sudeep Holla
2020-10-20 9:59 ` Viresh Kumar
2020-10-20 9:59 ` Viresh Kumar
2020-10-27 22:24 ` Guenter Roeck
2020-10-27 22:24 ` Guenter Roeck
2020-10-28 4:06 ` Viresh Kumar
2020-10-28 4:06 ` Viresh Kumar
2020-10-28 17:29 ` Guenter Roeck
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=20200824091724.GB20819@kozik-lap \
--to=krzk@kernel.org \
--cc=georgi.djakov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kgene@kernel.org \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=nks@flawful.org \
--cc=nm@ti.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=sboyd@kernel.org \
--cc=stephan@gerhold.net \
--cc=ulf.hansson@linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@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: 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.