linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Wu <peter@lekensteyn.nl>
To: "Zheng, Lv" <lv.zheng@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Rick Kerkhof <rick.2889@gmail.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Moore, Robert" <robert.moore@intel.com>
Subject: Re: Acer Aspire V7-582PG (Haswell, GTX 750M) fails to power off GPU via Power Resources
Date: Sun, 30 Oct 2016 15:18:57 +0100	[thread overview]
Message-ID: <20161030141857.GA6697@al> (raw)
In-Reply-To: <1AE640813FDE7649BE1B193DEA596E886A25E770@SHSMSX101.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2485 bytes --]

(removing nouveau list since it is an ACPI core issue)

On Sat, Oct 29, 2016 at 12:49:22AM +0000, Zheng, Lv wrote:
> Hi,
> 
> > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Mika
> > Westerberg
> > Subject: Re: Acer Aspire V7-582PG (Haswell, GTX 750M) fails to power off GPU via Power Resources
> > 
> > On Fri, Oct 28, 2016 at 02:30:41PM +0200, Peter Wu wrote:
> > > It was correctly applied. I did some testing with QEMU, it seems that
> > > the \_OSI check is problematic. Removing it makes things work again.
> > 
> > I hope Bob and Lv can answer why _OSI fails.
> > 
> > In the meantime I think we should check flags.power_resources in nouveau
> > driver (in addition to _PR3) so that it falls back to _DSM if there are
> > no power resources (or if we failed to evaluate them for some reason).
> 
> IMO, the problem wasn't _OSI, the problem was "If".
> "If" is module level here.
> So execution order of it in current Linux upstream may be different from Windows.
> 
> You can try to modify acpi_gbl_parse_table_as_term_list to TRUE.
> To see if this can be solved.
> 
> Thanks and best regards
> Lv

It seems that acpi_gbl_parse_table_as_term_list is a new flag in
v4.9-rc1. Changing the flag to TRUE in in include/acpi/acpixf.h has no
effect other than:

    ACPI: Executed 2 blocks of module-level executable AML code

changing into:


    ACPI: 2 ACPI AML tables successfully acquired and loaded

That was tested using v4.9-rc2-40-g9fe68ca + debug patch from previous
mail, but with a slightly modified QEMU command (to allow the device to
become visible in Windows Device Manager) and slightly modified SSDT1:

    qemu-system-x86_64 -M pc,accel=kvm -m 2G -acpitable file=ssdt1.aml \
        -net none -device pci-bridge,addr=12.0,chassis_nr=2,id=head.2 \
        -device isa-debugcon,iobase=0x402,chardev=dbug \
        -chardev file,id=dbug,path=/dev/stdout ...

With this command and Windows 10 (-drive file=w10.qcow2), I can see that
the power resource methods are invoked (stdout | grep PR_TEST):

    PR_TEST: NVP3._ON
    PR_TEST: NVP2._OFF
    PR_TEST: _PS0
    PR_TEST: _S0W
    PR_TEST: NVP3._ON
    PR_TEST: _PS0

Using the above test setup with Linux (-kernel arch/x86/boot/bzImage):

    PR_TEST: _S0W

If you think that the default runtime PM state affects this, note that
the dmesg also shows:

    ACPI: \_SB_.PCI0.S90_: Adding power resources for device:14? 0
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl

[-- Attachment #2: ssdt1.dsl --]
[-- Type: text/plain, Size: 2700 bytes --]

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20160831-64
 * Copyright (c) 2000 - 2016 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of ssdt1.dat, Wed Oct 26 21:43:27 2016
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x00002CA9 (11433)
 *     Revision         0x01
 *     Checksum         0x8F
 *     OEM ID           "ACRSYS"
 *     OEM Table ID     "ACRPRDCT"
 *     OEM Revision     0x00001000 (4096)
 *     Compiler ID      "1025"
 *     Compiler Version 0x00040000 (262144)
 */
DefinitionBlock ("", "SSDT", 1, "ACRSYS", "ACRPRDCT", 0x00001000)
{
    External (\_SB.PCI0.S90, DeviceObj)
    External (\DBUG, MethodObj)

    Method (DBGM, 1, NotSerialized)
    {
        Concatenate ("PR_TEST: ", Arg0, Local0)
        Debug = Local0
        DBUG(Local0)
    }

    If (\_OSI ("Windows 2013")) {
        Scope (\_SB.PCI0.S90)
        {
            Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
            {
                NVP3
            })
            Name (_PR2, Package (0x01)  // _PR2: Power Resources for D2
            {
                NVP2
            })
            Name (_PR3, Package (0x01)  // _PR3: Power Resources for D3hot
            {
                NVP3
            })
            Method (_S0W, 0, NotSerialized)  // _S0W: S0 Device Wake State
            {
                DBGM("_S0W")
                // Return(3)
                Return(4)
            }

            Method (_DSW, 3, NotSerialized)  // _DSW: Device Sleep Wake
            {
            }

            Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
            {
                DBGM("_PS0")
            }

            Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
            {
                DBGM("_PS3")
            }
        }

        PowerResource (NVP3, 0x00, 0x0000)
        {
            Name (_STA, One)  // _STA: Status

            Method (_ON, 0, NotSerialized)  // _ON_: Power On
            {
                DBGM("NVP3._ON")
                _STA = One
            }

            Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
            {
                DBGM("NVP3._OFF")
                _STA = Zero
            }
        }

        PowerResource (NVP2, 0x00, 0x0000)
        {
            Name (_STA, One)  // _STA: Status
            Method (_ON, 0, NotSerialized)  // _ON_: Power On
            {
                DBGM("NVP2._ON")
                _STA = One
            }

            Method (_OFF, 0, NotSerialized)  // _OFF: Power Off
            {
                DBGM("NVP2._OFF")
                _STA = One
            }
        }
    }
}

  reply	other threads:[~2016-10-30 14:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-98398-8800@http.bugs.freedesktop.org/>
     [not found] ` <bug-98398-8800-66oU1nuK0R@http.bugs.freedesktop.org/>
2016-10-26 22:56   ` Acer Aspire V7-582PG (Haswell, GTX 750M) fails to power off GPU via Power Resources Peter Wu
2016-10-27  8:17     ` Mika Westerberg
2016-10-27  9:06       ` Peter Wu
     [not found]         ` <CANni8hdMs4pL0m6FrgeyJjE2R2C=6PaHbVbMVoUU+NszJuf9OA@mail.gmail.com>
2016-10-27  9:30           ` Mika Westerberg
2016-10-27  9:35             ` Peter Wu
     [not found]             ` <CANni8her35iORgrZOkDzxhfVaOOzObTLG2Ly0kkNZPDTrbyfQQ@mail.gmail.com>
2016-10-27  9:55               ` Mika Westerberg
     [not found]                 ` <CANni8hfSnT46pH8EnA1f00SWXUrJ=8PHRjydricGbH4AS4mR7A@mail.gmail.com>
2016-10-27 10:12                   ` Mika Westerberg
2016-10-27 16:06                 ` Peter Wu
2016-10-28  8:56                   ` Mika Westerberg
2016-10-28 11:09                     ` Peter Wu
2016-10-28 11:19                       ` Mika Westerberg
2016-10-28 12:30                         ` Peter Wu
2016-10-28 14:10                           ` Mika Westerberg
2016-10-29  0:49                             ` Zheng, Lv
2016-10-30 14:18                               ` Peter Wu [this message]
2016-10-29  0:42                     ` Zheng, Lv
2016-10-30 11:08                       ` Peter Wu

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=20161030141857.GA6697@al \
    --to=peter@lekensteyn.nl \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rick.2889@gmail.com \
    --cc=robert.moore@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;
as well as URLs for NNTP newsgroup(s).