linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Peter Geis <pgwipeout@gmail.com>
Cc: a.zummo@towertech.it, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	len.brown@intel.com, pavel@ucw.cz,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-rtc@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [Question] rtc wake behavior and sysfs
Date: Tue, 6 Oct 2020 00:29:53 +0200	[thread overview]
Message-ID: <20201005222953.GD2804081@piout.net> (raw)
In-Reply-To: <CAMdYzYrYdDYF_Y_TwQ65u=Ymu2_8Rs9KWm_TfXcaPGTwucT=jg@mail.gmail.com>

On 05/10/2020 09:13:08-0400, Peter Geis wrote:
> Good Morning,
> 
> While testing suspend to ram on the Ouya, I encountered an interesting
> issue with the rtc-tps65910 driver.
> Attempting to use rtc-wake on the default configuration returned:
> rtcwake: /dev/rtc0 not enabled for wakeup events
> This is due to:
> eb5eba4ef722 drivers/rtc/rtc-tps65910.c: enable/disable wake in suspend/resume
> This commit changed this driver's behavior to not enable wakeup by
> default, but enables it when entering sleep mode.
> This seems to be odd behavior to me.
> Looking at a few other rtc drivers show they simply enable themselves
> as wakeup sources by default.
> 
> I also found the sysfs entries are at /sys/devices/ ..
> /tps65910-rtc/power but are missing at /sys/class/rtc/rtc0/power/
> 
> I have two questions.
>  - Should the sysfs wakeup entries be missing at /sys/class/rtc/rtc0/power/ ?

I would be in /sys/class/rtc/rtc0/device/power

>  - Shouldn't a rtc be enabled as a wakeup source by default?
> 

The short answer is no, the reason being that not all RTCs are connected
to an IRQ or a pin that can wakeup or start the platform. What should be
done is enabling wakeup only when interrupts are available or the
wakeup-source property is in the rtc device tree node.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-10-05 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 13:13 [Question] rtc wake behavior and sysfs Peter Geis
2020-10-05 22:29 ` Alexandre Belloni [this message]
2020-10-06  1:47   ` Peter Geis
2020-10-06  7:03     ` 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=20201005222953.GD2804081@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pgwipeout@gmail.com \
    --cc=rjw@rjwysocki.net \
    /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).