From: Dhruva Gole <d-gole@ti.com>
To: Dikshita Agarwal <quic_dikshita@quicinc.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
Vikash Garodia <quic_vgarodia@quicinc.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-media@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] PM: domains: add device managed version of dev_pm_domain_attach|detach_list()
Date: Fri, 9 Aug 2024 15:19:00 +0530 [thread overview]
Message-ID: <20240809094900.j5c2q6gm72ycheeu@lcpd911> (raw)
In-Reply-To: <b16a25d0-3f39-3231-bc80-d79739dc0168@quicinc.com>
Hi,
On Aug 09, 2024 at 14:57:11 +0530, Dikshita Agarwal wrote:
>
>
> On 8/9/2024 9:49 AM, Dhruva Gole wrote:
> > Hi,
> >
> > On Aug 08, 2024 at 16:29:12 +0530, Dikshita Agarwal wrote:
> >>
> >>
> >> On 8/8/2024 4:25 PM, Dikshita Agarwal wrote:
> >>>
> >>>
> >>> On 8/8/2024 4:11 PM, Dhruva Gole wrote:
> >>>> On Aug 07, 2024 at 12:45:46 +0530, Dikshita Agarwal wrote:
> >>>>> Add the devres-enabled version of dev_pm_domain_attach|detach_list.
> >>>>> If client drivers use devm_pm_domain_attach_list() to attach the
> >>>>> PM domains, devm_pm_domain_detach_list() will be invoked implicitly
> >>>>> during remove phase.
> >>>>>
> >>>>> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
> >>>>> ---
> >>>>> drivers/base/power/common.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
> >>>>> include/linux/pm_domain.h | 13 +++++++++++++
> >>>>> 2 files changed, 57 insertions(+)
> >>>>>
> >>>>> diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
> >>>>> index 327d168..729d6c2 100644
> >>>>> --- a/drivers/base/power/common.c
> >>>>> +++ b/drivers/base/power/common.c
> >>>>> @@ -277,6 +277,50 @@ int dev_pm_domain_attach_list(struct device *dev,
> >>>>> EXPORT_SYMBOL_GPL(dev_pm_domain_attach_list);
> >>>>>
> >>>>> /**
> >>>>> + * devm_pm_domain_detach_list - devres-enabled version of dev_pm_domain_detach_list.
> >>>>> + * @_list: The list of PM domains to detach.
> >>>>> + *
> >>>>> + * This function reverse the actions from devm_pm_domain_attach_list().
> >>>>> + * it will be invoked during the remove phase from drivers implicitly if driver
> >>>>> + * uses devm_pm_domain_attach_list() to attach the PM domains.
> >>>>> + */
> >>>>> +void devm_pm_domain_detach_list(void *_list)
> >
> > My problem is with the type of parameter used being void, why void?
> > Why not be explicit about it and call it dev_pm_domain_list *list like
> > the non-devres version of the API?
> >
> devm_add_action_or_reset API expects the argument as void (*)(void *).
>
> Below are code references following the same way:
> https://elixir.bootlin.com/linux/v6.11-rc2/source/drivers/devfreq/devfreq.c#L1332
> https://elixir.bootlin.com/linux/v6.11-rc2/source/drivers/clk/clk.c#L1033
>
> If I change the type of argument as you are suggesting, it will throw
> compilation error.
> "expected 'void (*)(void *)' but argument is of type 'void (*)(struct
> dev_pm_domain_list *)'"
Ah yes sorry I missed the devm_add_action_or_reset part. Thanks for clarifying!
--
Best regards,
Dhruva Gole <d-gole@ti.com>
next prev parent reply other threads:[~2024-08-09 9:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 7:15 [PATCH v2 0/2] " Dikshita Agarwal
2024-08-07 7:15 ` [PATCH v2 1/2] PM: domains: " Dikshita Agarwal
2024-08-08 10:41 ` Dhruva Gole
2024-08-08 10:55 ` Dikshita Agarwal
2024-08-08 10:59 ` Dikshita Agarwal
2024-08-09 4:19 ` Dhruva Gole
2024-08-09 9:27 ` Dikshita Agarwal
2024-08-09 9:49 ` Dhruva Gole [this message]
2024-08-13 10:52 ` Ulf Hansson
2024-08-13 12:23 ` Dikshita Agarwal
2024-08-07 7:15 ` [PATCH v2 2/2] media: venus: use device managed APIs for power domains Dikshita Agarwal
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=20240809094900.j5c2q6gm72ycheeu@lcpd911 \
--to=d-gole@ti.com \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=konrad.dybcio@linaro.org \
--cc=len.brown@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pavel@ucw.cz \
--cc=quic_dikshita@quicinc.com \
--cc=quic_vgarodia@quicinc.com \
--cc=rafael@kernel.org \
--cc=stanimir.k.varbanov@gmail.com \
--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
all inboxes | Powered by JetHome®