All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ionela Voinescu <ionela.voinescu@arm.com>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <agross@kernel.org>,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: qcom-hw: add missing devm_release_mem_region() call
Date: Tue, 12 Jan 2021 12:19:08 +0000	[thread overview]
Message-ID: <20210112121859.GA25733@arm.com> (raw)
In-Reply-To: <20210112111928.GB2479@dragon>

Hi guys,

On Tuesday 12 Jan 2021 at 19:19:29 (+0800), Shawn Guo wrote:
> On Tue, Jan 12, 2021 at 03:44:49PM +0530, Viresh Kumar wrote:
> > On 12-01-21, 17:52, Shawn Guo wrote:
> > > On SDM845/850, running the following commands to put all cores in
> > > freq-domain1 offline and then get one core back online, there will be
> > > a request region error seen from qcom-hw driver.
> > > 
> > > $ echo 0 > /sys/devices/system/cpu/cpu4/online
> > > $ echo 0 > /sys/devices/system/cpu/cpu5/online
> > > $ echo 0 > /sys/devices/system/cpu/cpu6/online
> > > $ echo 0 > /sys/devices/system/cpu/cpu7/online
> > > $ echo 1 > /sys/devices/system/cpu/cpu4/online
> > > 
> > > [ 3395.915416] CPU4: shutdown
> > > [ 3395.938185] psci: CPU4 killed (polled 0 ms)
> > > [ 3399.071424] CPU5: shutdown
> > > [ 3399.094316] psci: CPU5 killed (polled 0 ms)
> > > [ 3402.139358] CPU6: shutdown
> > > [ 3402.161705] psci: CPU6 killed (polled 0 ms)
> > > [ 3404.742939] CPU7: shutdown
> > > [ 3404.765592] psci: CPU7 killed (polled 0 ms)
> > > [ 3411.492274] Detected VIPT I-cache on CPU4
> > > [ 3411.492337] GICv3: CPU4: found redistributor 400 region 0:0x0000000017ae0000
> > > [ 3411.492448] CPU4: Booted secondary processor 0x0000000400 [0x516f802d]
> > > [ 3411.503654] qcom-cpufreq-hw 17d43000.cpufreq: can't request region for resource [mem 0x17d45800-0x17d46bff]
> > > 
> > > The cause is that the memory region requested in .init hook doesn't get
> > > released in .exit hook, and the subsequent call to .init will always fail
> > > on this error.  Let's break down the devm_platform_ioremap_resource()
> > > call a bit, so that we can have the resource pointer to release memory
> > > region from .exit hook.
> > > 
> > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > ---
> > >  drivers/cpufreq/qcom-cpufreq-hw.c | 8 +++++++-
> > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > FWIW, Ionela also sent a fix though I like this one better for the
> > obvious reasons.
> > 
> > https://lore.kernel.org/lkml/20210108151406.23595-1-ionela.voinescu@arm.com/
> 
> Ha, thanks for the pointer.  So the original code was tricky and skipped
> the region request call intentionally.
> 

As long as the problem is fixed, I'm happy :).
For this patch:
Tested-by: Ionela Voinescu <ionela.voinescu@arm.com>

The patch probably deserves:
Fixes: f17b3e44320b ("cpufreq: qcom-hw: Use devm_platform_ioremap_resource() to simplify code")

Thanks,
Ionela.

> Shawn

  reply	other threads:[~2021-01-12 12:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  9:52 [PATCH] cpufreq: qcom-hw: add missing devm_release_mem_region() call Shawn Guo
2021-01-12 10:14 ` Viresh Kumar
2021-01-12 11:19   ` Shawn Guo
2021-01-12 12:19     ` Ionela Voinescu [this message]
2021-01-12 14:44 ` Bjorn Andersson
2021-01-13  4:31   ` Viresh Kumar
2021-01-13  4:59     ` Bjorn Andersson
2021-01-13  5:06       ` Viresh Kumar
2021-01-13 22:12         ` AngeloGioacchino Del Regno
2021-01-14  4:58           ` Viresh Kumar
2021-01-14  5:21           ` Bjorn Andersson
2021-01-18  6:43         ` Viresh Kumar
2021-01-18  6:54           ` Shawn Guo
2021-01-18 11:03             ` Ionela Voinescu
2021-01-18 12:17         ` Shawn Guo
2021-01-19  3:36           ` Viresh Kumar

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=20210112121859.GA25733@arm.com \
    --to=ionela.voinescu@arm.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=shawn.guo@linaro.org \
    --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.