public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org, rui.zhang@intel.com
Subject: Re: [RFC] [PATCH 2/3] Call RTC wake_on hook function when alarm is enabled
Date: Wed, 9 Apr 2008 00:48:52 -0700	[thread overview]
Message-ID: <200804090048.52808.david-b@pacbell.net> (raw)
In-Reply-To: <1207722894.5997.18.camel@yakui_zhao.sh.intel.com>

On Tuesday 08 April 2008, Zhao Yakui wrote:
> +       if (t->enabled)
> +               if (cmos->wake_on)
> +                       cmos->wake_on(dev);

That looks ugly (bracketing) ... and suspicious in
terms of conformance to the RTC interface.

Shouldn't it be:

	if (t->enabled) {
		if (cmos->wake_on)
			cmos->wake_on(dev);
	} else {
		if (cmos->wake_off)
			cmos->wake_off(dev);
	}

instead?  Else I don't see what would disable the
alarm when it's supposed to be disabled.  Plus, if
that's done here, I suspect it also needs to be
done in rtc_ioctl() for RTC_AIE_{ON,OFF} and *NOT*
done in cmos_{suspend,resume)() ... very odd for a
wakeup hook, since none of those presume the system
is entering a state from which it could wake!

But in general this raises the question of how
to properly hook up to ACPI.  If ACPI's hook is for
normal alarm behavior (supplanting the RTC IRQ),
that's odd ... and it shouldn't fit into a hook
designed to ensure only that wake-from-sleep works.

At any rate, this patch clearly can't merge as-is.

- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-04-09  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09  6:34 [RFC] [PATCH 2/3] Call RTC wake_on hook function when alarm is enabled Zhao Yakui
2008-04-09  7:48 ` David Brownell [this message]
2008-04-09 17:29   ` Zhao Yakui
2008-04-09 10:08     ` David Brownell
2008-04-10  2:15       ` Zhang, Rui

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=200804090048.52808.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=yakui.zhao@intel.com \
    /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