From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rajendra Nayak <rnayak@codeaurora.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
Stephen Boyd <swboyd@chromium.org>,
andy.gross@linaro.org, david.brown@linaro.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] soc: qcom: update config dependencies for QCOM_RPMPD
Date: Tue, 22 Jan 2019 15:38:54 +0530 [thread overview]
Message-ID: <20190122100854.nuepsz5ddbt4jda4@vireshk-i7> (raw)
In-Reply-To: <864348fb-3d06-7b4b-cc82-17c96b7ce219@codeaurora.org>
On 22-01-19, 15:24, Rajendra Nayak wrote:
> I was doing some quick testing by adding the calls to of_genpd_remove_last() as
> suggested by Ulf for cleaning up the genpd registrations, and I run into this
> backtrace when the driver re-probes followed by a remove
>
> [ 59.204525] kobject ((____ptrval____)): tried to init an initialized object, something is seriously wr.
> [ 59.214262] CPU: 3 PID: 1600 Comm: sh Not tainted 5.0.0-rc1-00012-g0513915837c5-dirty #32
> [ 59.222500] Hardware name: Qualcomm Technologies, Inc. SDM845 MTP (DT)
> [ 59.229081] Call trace:
> [ 59.231574] dump_backtrace+0x0/0x148
> [ 59.235276] show_stack+0x14/0x20
> [ 59.238631] dump_stack+0x8c/0xac
> [ 59.241980] kobject_init+0x8c/0xa0
> [ 59.245506] device_initialize+0x34/0xc8
> [ 59.249474] pm_genpd_init+0x170/0x260
> [ 59.253261] rpmhpd_probe+0x194/0x2b0
> [ 59.256966] platform_drv_probe+0x4c/0xa8
> [ 59.261011] really_probe+0x1e4/0x2c8
> [ 59.264711] driver_probe_device+0x58/0x10
> [ 59.268927] bind_store+0xdc/0x178
> [ 59.272356] drv_attr_store+0x20/0x30
> [ 59.276061] sysfs_kf_write+0x48/0x58
> [ 59.279760] kernfs_fop_write+0xcc/0x1c8
> [ 59.283728] __vfs_write+0x34/0x170
> [ 59.287245] vfs_write+0xa8/0x1b8
> [ 59.290592] ksys_write+0x5c/0xc8
> [ 59.293941] __arm64_sys_write+0x14/0x20
> [ 59.297897] el0_svc_common+0xb4/0x118
> [ 59.301676] el0_svc_handler+0x2c/0x80
> [ 59.305455] el0_svc+0x8/0xc
>
> Viresh/Ulf, looks like we need some cleanup of whats done by device_initialize()
> in pm_genpd_init() to happen as part of the pm_genpd_remove()?
Yeah, we normally need to call put_device() for that. Maybe something like this:
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 500de1dee967..d5b984f042ec 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1812,6 +1812,7 @@ static int genpd_remove(struct generic_pm_domain *genpd)
genpd_unlock(genpd);
cancel_work_sync(&genpd->power_off_work);
kfree(genpd->free);
+ put_device(&genpd->dev);
pr_debug("%s: removed %s\n", __func__, genpd->name);
return 0;
--
viresh
next prev parent reply other threads:[~2019-01-22 10:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 4:48 [PATCH] soc: qcom: update config dependencies for QCOM_RPMPD Rajendra Nayak
2019-01-18 17:39 ` Stephen Boyd
2019-01-22 2:30 ` Rajendra Nayak
2019-01-22 5:08 ` Guenter Roeck
2019-01-22 9:54 ` Rajendra Nayak
2019-01-22 10:08 ` Viresh Kumar [this message]
2019-01-22 10:35 ` Rajendra Nayak
2019-01-23 11:16 ` Viresh Kumar
2019-01-23 14:22 ` Guenter Roeck
2019-01-24 6:45 ` Viresh Kumar
2019-01-31 1:32 ` Bjorn Andersson
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=20190122100854.nuepsz5ddbt4jda4@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rnayak@codeaurora.org \
--cc=swboyd@chromium.org \
--cc=ulf.hansson@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).