All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zheng, Lv" <lv.zheng@intel.com>
To: Daniel Drake <drake@endlessm.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"chiu@endlessm.com" <chiu@endlessm.com>,
	"linux@endlessm.com" <linux@endlessm.com>
Subject: RE: [PATCH] ACPI / EC: handle ECDT EC and DSDT EC simultaneously
Date: Thu, 4 May 2017 04:52:55 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886CE9CFE0@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CAD8Lp46nYiKuwc8i7K_uSKisH4q=wWs8tH7ktJCgoeMDBoU4wg@mail.gmail.com>

Hi,

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Daniel
> Drake
> Subject: Re: [PATCH] ACPI / EC: handle ECDT EC and DSDT EC simultaneously
> 
> Hi,
> 
> On Fri, Apr 28, 2017 at 12:33 AM, Zheng, Lv <lv.zheng@intel.com> wrote:
> > However in the above debugging commit, I'm sure we shouldn't invoke _STA in ec_parse_device().
> > As the reasons below.
> >
> > In theory, using DSDT EC as boot EC is not spec compliant.
> > It's just a workaround in Linux for not knowing the Windows device enumeration orders.
> > Especially, the order of executing the control method execution that may contain hardware
> initialization code.
> > Such control methods are mostly _STA/_INI.
> > While for _HID/_CRS/_GPE/_BBN, it is unlikely to trigger order issues and it might be safe to invoke
> them such early.
> >
> > If you executes _STA here, you might bring EC._STA execution prior than other _INI/_STA and may
> break some other platforms.
> > So for now, I think you should only add simple sanity checks for ioports.
> > And since you have the direct accesses to these affected platforms, you can help to provide such
> working sanity check improvements for us.
> 
> In the DSDT you were looking at the H_EC device, but for whatever
> reason, there are two ECs in this DSDT and the one that Linux picks up
> is the 2nd one, \_SB_.PCI0.LPCB.EC0.
> 
> This device has no _STA but does have valid _CRS, and the debug patch
> results agree:
> 
>  ACPI : EC: acpi_ec_dsdt_probe: search for DSDT EC
>  ACPI : EC: ec_parse_device: _STA status 5 val 0
>  ACPI : EC: ec_parse_device: _CRS status 0 command 66 data 62
>  ACPI : EC: EC stopped
>  ACPI : EC: EC started
>  ACPI: \_SB_.PCI0.LPCB.EC0_: Used as first EC
> 
> acpidump output is at
> https://www.dropbox.com/s/d3w2xrmrz1oklnw/x580vd_acpi.tgz?dl=0

Yes, there are 2 ECs.
        Device (H_EC)
        {
            Name (_HID, EisaId ("PNP0C09") /* Embedded Controller Device */)  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                ^^^GFX0.CLID = 0x03
                Return (Zero)
            }

        Device (EC0)
        {
            Name (_HID, EisaId ("PNP0C09") /* Embedded Controller Device */)  // _HID: Hardware ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IO (Decode16,
                    0x0062,             // Range Minimum
                    0x0062,             // Range Maximum
                    0x00,               // Alignment
                    0x01,               // Length
                    )
                IO (Decode16,
                    0x0066,             // Range Minimum
                    0x0066,             // Range Maximum
                    0x00,               // Alignment
                    0x01,               // Length
                    )
            })
            Method (_GPE, 0, NotSerialized)  // _GPE: General Purpose Events
            {
                Local0 = 0x33
                Return (Local0)
            }

And linux EC driver only tries the 1st one.
You probably should add sanity check to skip first one, and return the 2nd one.

Thanks
Lv

> 
> Daniel
> --
> 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

      parent reply	other threads:[~2017-05-04  4:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 20:12 [PATCH] ACPI / EC: handle ECDT EC and DSDT EC simultaneously Daniel Drake
2017-04-20 20:59 ` Rafael J. Wysocki
2017-04-24  4:43 ` Zheng, Lv
2017-04-26 13:11   ` Daniel Drake
2017-04-27  3:18     ` Zheng, Lv
2017-04-28  0:33       ` Rafael J. Wysocki
2017-04-28  0:44         ` Daniel Drake
2017-04-28  6:33           ` Zheng, Lv
2017-04-28 12:52             ` Daniel Drake
2017-05-03 20:06               ` Daniel Drake
2017-05-04  5:05                 ` Zheng, Lv
2017-05-04  4:52               ` Zheng, Lv [this message]

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=1AE640813FDE7649BE1B193DEA596E886CE9CFE0@SHSMSX101.ccr.corp.intel.com \
    --to=lv.zheng@intel.com \
    --cc=chiu@endlessm.com \
    --cc=drake@endlessm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux@endlessm.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 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.