From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Shawn Guo <shawnguo@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Stephen Boyd <sboyd@kernel.org>
Subject: Re: [PATCH] rtc: imxdi: add wakeup support
Date: Tue, 4 May 2021 14:12:50 +0200 [thread overview]
Message-ID: <YJE6QhePvy7f4LKW@piout.net> (raw)
In-Reply-To: <20210504100858.4i2crnfwchlcopr7@viti.kaiser.cx>
On 04/05/2021 12:08:58+0200, Martin Kaiser wrote:
> Thus wrote Alexandre Belloni (alexandre.belloni@bootlin.com):
>
> > > platform_set_drvdata(pdev, imxdi);
>
> > > + device_set_wakeup_capable(&pdev->dev, true);
>
> > Maybe it makes sense to simply use device_init_wakeup here.
>
> the explanation for device_init_wakeup
>
> "By default, most devices should leave wakeup disabled. The exceptions
> are devices that everyone expects to be wakeup sources: keyboards, power
> buttons, ..."
>
> made me think that device_set_wakeup_capable is more appropriate here. I
> can change this if you want.
>
Doesn't everyone expect the RTC to be a wakeup source? :)
> However, if I compile rtc-imxdi as a module and use device_init_wakeup,
> the module can't be unloaded any more. The reason is that alarmtimer
> (kernel/time/alarmtimer.c) starts using rtc-imxdi as its backing rtc
> device and holds a reference to it. It seems that alarmtimer has no way
> to relinquish its backing rtc device, regardless of any pending alarms.
>
> What is the right approach here? Are there any rtc drivers that act as a
> wakeup source and can still be unloaded if compiled as a module?
>
Yes, when you don't have alarmtimer ;)
I honestly think the RTC selection needs to be a bit more dynamic but at
the same time, it would not be great to change it at suspend time. I
guess the best way would be to allow module unloading and tracking when
the RTC disappears.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2021-05-04 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 9:32 [PATCH] rtc: imxdi: add wakeup support Martin Kaiser
2021-05-01 10:05 ` Alexandre Belloni
2021-05-04 10:08 ` Martin Kaiser
2021-05-04 12:12 ` Alexandre Belloni [this message]
2021-05-05 16:25 ` Martin Kaiser
2021-05-05 16:30 ` [PATCH v2] " Martin Kaiser
2021-05-05 17:34 ` Alexandre Belloni
2021-05-11 16:12 ` [PATCH v3] " Martin Kaiser
2021-05-24 22:43 ` Alexandre Belloni
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=YJE6QhePvy7f4LKW@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=martin@kaiser.cx \
--cc=sboyd@kernel.org \
--cc=shawnguo@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