mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Cherryview wake up events
Date: Mon, 19 Sep 2016 22:36:22 +0200	[thread overview]
Message-ID: <20160919203622.ujh4l5eudrncv3rl@sig21.net> (raw)
In-Reply-To: <20160919115619.GF1811@lahna.fi.intel.com>

On Mon, Sep 19, 2016 at 02:56:19PM +0300, Mika Westerberg wrote:
> On Mon, Sep 19, 2016 at 01:21:17PM +0200, Johannes Stezenbach wrote:
> > 
> > The LID causes a gpio irq:
> >  158:          2          0          0          0  chv-gpio   43 ACPI:Event
> > 
> > However, neither LID nor power button can wake up the
> > device from "echo freeze >/sys/power/state".  :-(
> 
> The cherryview pinctrl driver does not (yet) support wake up events. It
> currently just sets IRQCHIP_SKIP_SET_WAKE for the irqchip.

OK, but shouldn't the wakeup usually be handled by ACPI?
Clearly I don't understand this.  I mean on the non-ACPI
embedded ARM systems I'm used to I need to enable specific
irqs as wakeup sources, but on ACPI, isn't SCI the implicit
wakeup irq?  Probably I'm just totally confused, so let
me ask another way, below.

> I can make you a test patch which adds support for wakes for the pinctrl
> driver if you like to test it out. However, that will happen most likely
> near end of the week as I have other things right now.

That would be great!


I found in the DSDT:

    Scope (_SB.GPO0)
    {
        Name (EVBF, Buffer (0x03) {})
        CreateByteField (EVBF, Zero, EVST)
        CreateByteField (EVBF, One, ELEN)
        CreateByteField (EVBF, 0x02, ENVT)
        Name (LIDZ, One)
        Method (_E4E, 0, Serialized)  // _Exx: Edge-Triggered GPE
        {
            Name (_T_0, Zero)  // _T_x: Emitted by ASL Compiler
            If (^^PCI0.I2C1.AVBL != One)
            {
                Return (Zero)
            }

            EVBF = ^^PCI0.I2C1.ENID /* \_SB_.PCI0.I2C1.ENID */
...
            _T_0 = ENVT /* \_SB_.GPO0.ENVT */
...
                ElseIf (_T_0 == 0xA9)
                {
                    Notify (PWRB, 0x80) // Status Change
                    Break
                }

and
        Device (GPO0)
        {
...
            Method (_AEI, 0, NotSerialized)  // _AEI: ACPI Event Interrupts
            {
                Name (WBUF, ResourceTemplate ()
                {
                    GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullUp, 0x0000,
                        "\\_SB.GPO0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x004E
                        }
                })
                If (OSID == One)
                {
                    Return (WBUF) /* \_SB_.GPO0._AEI.WBUF */
                }
            }

and OSID is a field in 
    OperationRegion (GNVS, SystemMemory, 0x7A158000, 0x0362)
which is inside what /proc/iomem lists as "ACPI no-volatile storage".
OSID is read a lot in the DSDT but never written to.
But calling \_SB.GPO0._AEI in acpidbg returns a buffer of size 25.

Now my question is, is this pin 0x004E the same as this
in /proc/interrupts which fires on LID event?

 158:          2          0          0          0  chv-gpio   43 ACPI:Event



The FADT has
            Control Method Power Button (V1) : 0
            Control Method Sleep Button (V1) : 1

PWRBTN_EN in PM1 is set.  But PWRBTN press causes thermal irq.

No SCI (irq 9) is ever generated, except by writing to the
BIOS_RLS bit in SMI_EN register (IO port 0x430).

GPE block addresses in FADT are 0.  GPE0a_EN register (IO 0x428)
is set to 0x6000 (TCO_EN + PME_B0_EN, but none of the GPIO enables).

Any advice how to continue?


Thanks,
Johannes

  reply	other threads:[~2016-09-19 20:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 11:21 Johannes Stezenbach
2016-09-19 11:56 ` Mika Westerberg
2016-09-19 20:36   ` Johannes Stezenbach [this message]
2016-09-20  9:18     ` Mika Westerberg
2016-09-20 10:14       ` Johannes Stezenbach
2016-09-20 10:40         ` Mika Westerberg
2016-09-20 15:59           ` Johannes Stezenbach
2016-09-20 21:11             ` Johannes Stezenbach
2016-09-21  9:06               ` Mika Westerberg
2016-09-21  9:16                 ` Johannes Stezenbach
2016-09-23  8:19                   ` Mika Westerberg
2016-09-23  9:59                     ` Johannes Stezenbach
2016-10-05 12:46                     ` Johannes Stezenbach
2016-10-05 13:05                       ` Mika Westerberg
2016-12-04 18:52                         ` Johannes Stezenbach
2016-12-05 11:06                           ` Mika Westerberg
2017-01-24  9:41                             ` Johannes Stezenbach
2017-01-24 11:14                               ` Andy Shevchenko
2017-01-24 13:52                                 ` Johannes Stezenbach
2017-01-24 14:28                                   ` Andy Shevchenko
2017-01-24 19:23                                     ` Johannes Stezenbach
2017-01-25  9:29                                       ` Mika Westerberg
2017-01-26 22:56                                       ` Andy Shevchenko
2017-01-27 11:38                                         ` Johannes Stezenbach
2017-01-27 13:21                                           ` Andy Shevchenko
2017-01-27 13:30                                             ` Johannes Stezenbach
2017-01-30 20:57                                               ` Johannes Stezenbach
2017-01-30 22:05                                                 ` Andy Shevchenko
2017-01-31 14:37                                                   ` Johannes Stezenbach
2017-01-31 14:44                                                     ` Mika Westerberg
2017-02-02  9:52                                                     ` Johannes Stezenbach
2017-02-02 10:31                                                       ` Mika Westerberg
2017-02-02 11:12                                                         ` Johannes Stezenbach
2017-02-02 11:35                                                           ` Mika Westerberg
2017-02-02 12:16                                                             ` Mika Westerberg
2017-02-02 13:52                                                               ` Johannes Stezenbach
2017-02-02 14:26                                                                 ` Mika Westerberg
2017-02-02 14:31                                                                   ` Johannes Stezenbach
2017-02-02 15:02                                                                     ` Mika Westerberg
2017-02-02 15:42                                                                       ` Johannes Stezenbach
2017-02-02 15:58                                                                         ` Mika Westerberg
2017-02-02 17:32                                                                           ` Johannes Stezenbach
2017-02-03 10:00                                                                             ` Mika Westerberg
2017-02-03 13:16                                                                               ` Johannes Stezenbach
2017-02-09  9:24                                                                           ` Johannes Stezenbach
2017-02-09  9:38                                                                             ` Mika Westerberg

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=20160919203622.ujh4l5eudrncv3rl@sig21.net \
    --to=js@sig21.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®