From: Peng Fan <peng.fan@oss.nxp.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Linus Walleij <linus.walleij@linaro.org>,
Conor Dooley <conor.dooley@microchip.com>,
Daire McNamara <daire.mcnamara@microchip.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org,
Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 00/12] pm: Introduce devm_pm_set_wake_irq
Date: Sun, 29 Dec 2024 17:31:02 +0800 [thread overview]
Message-ID: <20241229093102.GA11533@localhost.localdomain> (raw)
In-Reply-To: <20241228101046e64adfb2@mail.local>
On Sat, Dec 28, 2024 at 11:10:46AM +0100, Alexandre Belloni wrote:
>On 28/12/2024 09:14:36+0800, Peng Fan (OSS) wrote:
>> This was a retry to address [1][2], to let common code handle
>> dev_pm_clear_wake_irq. Then no need to call dev_pm_clear_wake_irq
>> in each driver.remove() hook and error handling path.
>>
>> In this patchset, I include input and rtc patches to show the usage
>> to avoid that introducing an API without users. There are still
>> other places using dev_pm_clear_wake_irq. If this patchset is
>> good for you, I could start to clean up other drivers such as mmc and
>> etc.
>>
>> [1] https://lore.kernel.org/all/20241111092131.1693319-1-peng.fan@oss.nxp.com/
>> [2] https://lore.kernel.org/all/ZymxvLMkkktRoCXZ@google.com/
>
>It seems your patchset depends on devm_device_init_wakeup which did not
>make it yet.
The devm_device_init_wakeup patch in linux-next/master
commit b317268368546d6401af788648668f82e3ba1bd3
Author: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Date: Wed Dec 18 13:09:35 2024 +0900
PM: wakeup: implement devm_device_init_wakeup() helper
Some drivers that enable device wakeup fail to properly disable it
during their cleanup, which results in a memory leak.
To address this, introduce devm_device_init_wakeup(), a managed variant
of device_init_wakeup(dev, true).
With this managed helper, wakeup functionality will be automatically
disabled when the device is released, ensuring a more reliable cleanup
process.
This need for this addition arose during a previous discussion [1].
Link: https://lore.kernel.org/linux-rtc/20241212100403.3799667-1-joe@pf.is.s.u-tokyo.ac.jp/ [1]
Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241218040935.1921416-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Thanks,
Peng.
>
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> ---
>> Peng Fan (12):
>> PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq
>> input: keyboard: ep93xx_keypad: Use devm_pm_set_wake_irq
>> input: keyboard: omap4_keypad: Use devm_pm_set_wake_irq
>> input: misc: nxp-bbnsm-pwrkey: Use resource managed API to simplify code
>> input: touchscreen: ti_am335x_tsc: Use resource managed API to simplify code
>> rtc: stm32: Use resource managed API to simplify code
>> rtc: nxp-bbnsm: Use resource managed API to simplify code
>> rtc: ds1343: Use devm_pm_set_wake_irq
>> rtc: pm8xxx: Use devm_pm_set_wake_irq
>> rtc: ab8500: Use resource managed API to simplify code
>> rtc: mpfs: Use devm_pm_set_wake_irq
>> rtc: pl031: Use resource managed API to simplify code
>>
>> drivers/base/power/wakeirq.c | 25 ++++++++++++++++++
>> drivers/input/keyboard/ep93xx_keypad.c | 8 +-----
>> drivers/input/keyboard/omap4-keypad.c | 8 +-----
>> drivers/input/misc/nxp-bbnsm-pwrkey.c | 15 ++++-------
>> drivers/input/touchscreen/ti_am335x_tsc.c | 43 ++++++++++---------------------
>> drivers/rtc/rtc-ab8500.c | 11 ++------
>> drivers/rtc/rtc-ds1343.c | 8 +-----
>> drivers/rtc/rtc-mpfs.c | 8 +-----
>> drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++--------------
>> drivers/rtc/rtc-pl031.c | 6 ++---
>> drivers/rtc/rtc-pm8xxx.c | 12 +--------
>> drivers/rtc/rtc-stm32.c | 10 ++-----
>> include/linux/pm_wakeirq.h | 6 +++++
>> 13 files changed, 70 insertions(+), 119 deletions(-)
>> ---
>> base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
>> change-id: 20241227-wake_irq-b68d604dd902
>>
>> Best regards,
>> --
>> Peng Fan <peng.fan@nxp.com>
>>
>
>--
>Alexandre Belloni, co-owner and COO, Bootlin
>Embedded Linux and Kernel engineering
>https://bootlin.com
prev parent reply other threads:[~2024-12-29 8:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-28 1:14 [PATCH 00/12] pm: Introduce devm_pm_set_wake_irq Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 01/12] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 02/12] input: keyboard: ep93xx_keypad: Use devm_pm_set_wake_irq Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 03/12] input: keyboard: omap4_keypad: " Peng Fan (OSS)
2024-12-28 5:11 ` kernel test robot
2024-12-28 1:14 ` [PATCH 04/12] input: misc: nxp-bbnsm-pwrkey: Use resource managed API to simplify code Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 05/12] input: touchscreen: ti_am335x_tsc: " Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 06/12] rtc: stm32: " Peng Fan (OSS)
2024-12-28 5:43 ` kernel test robot
2024-12-28 1:14 ` [PATCH 07/12] rtc: nxp-bbnsm: " Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 08/12] rtc: ds1343: Use devm_pm_set_wake_irq Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 09/12] rtc: pm8xxx: " Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 10/12] rtc: ab8500: Use resource managed API to simplify code Peng Fan (OSS)
2024-12-28 22:55 ` Linus Walleij
2024-12-28 1:14 ` [PATCH 11/12] rtc: mpfs: Use devm_pm_set_wake_irq Peng Fan (OSS)
2024-12-28 1:14 ` [PATCH 12/12] rtc: pl031: Use resource managed API to simplify code Peng Fan (OSS)
2024-12-28 22:55 ` Linus Walleij
2024-12-28 10:10 ` [PATCH 00/12] pm: Introduce devm_pm_set_wake_irq Alexandre Belloni
2024-12-29 9:31 ` Peng Fan [this message]
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=20241229093102.GA11533@localhost.localdomain \
--to=peng.fan@oss.nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=pavel@ucw.cz \
--cc=peng.fan@nxp.com \
--cc=rafael@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 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).