From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: System automatically wakes up because of Intel Rapid Start Technology
Date: Mon, 22 Dec 2014 16:50:37 +0100 [thread overview]
Message-ID: <3318216.XHaCQKkcW4@xps13> (raw)
In-Reply-To: <20141222145949.GB11844@srcf.ucam.org>
On Monday 22 December 2014 14:59:49 Matthew Garrett wrote:
> Can you try this diff?
Unfortunately it doesn't work (I made a change, see here below).
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index 5b2e761..637f980 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -48,6 +48,7 @@ struct cmos_rtc {
> struct device *dev;
> int irq;
> struct resource *iomem;
> + struct rtc_wkalrm alm;
>
> void (*wake_on)(struct device *);
> void (*wake_off)(struct device *);
> @@ -59,6 +60,8 @@ struct cmos_rtc {
> u8 day_alrm;
> u8 mon_alrm;
> u8 century;
> +
> + bool valid_alarm;
> };
>
> /* both platform and pnp busses use negative numbers for invalid irqs */
> @@ -879,6 +882,7 @@ static int cmos_suspend(struct device *dev)
>
> cmos_checkintr(cmos, tmp);
> }
> + cmos->valid_alarm = !!cmos_read_alarm(dev, &cmos->alm);
I moved this after spin_unlock_irq(), it causes a deadlock otherwise.
> spin_unlock_irq(&rtc_lock);
>
> if (tmp & RTC_AIE) {
> @@ -949,6 +953,10 @@ static int cmos_resume(struct device *dev)
> hpet_mask_rtc_irq_bit(RTC_AIE);
> } while (mask & RTC_AIE);
> }
> +
> + if (cmos->valid_alarm)
> + cmos_set_alarm(dev, &cmos->alm);
> +
> spin_unlock_irq(&rtc_lock);
>
> dev_dbg(dev, "resume, ctrl %02x\n", tmp);
>
>
>
next prev parent reply other threads:[~2014-12-22 15:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-22 13:59 System automatically wakes up because of Intel Rapid Start Technology Gabriele Mazzotta
2014-12-22 14:44 ` Matthew Garrett
2014-12-22 14:48 ` Matthew Garrett
2014-12-22 14:59 ` Matthew Garrett
2014-12-22 15:50 ` Gabriele Mazzotta [this message]
2014-12-22 16:10 ` Gabriele Mazzotta
2014-12-22 16:13 ` Matthew Garrett
2014-12-22 18:02 ` Matthew Garrett
2014-12-22 18:41 ` Gabriele Mazzotta
2014-12-22 18:57 ` Gabriele Mazzotta
2014-12-22 16:12 ` Matthew Garrett
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=3318216.XHaCQKkcW4@xps13 \
--to=gabriele.mzt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=platform-driver-x86@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.