linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: "Moore, Robert" <robert.moore@intel.com>,
	"Schmauss, Erik" <erik.schmauss@intel.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"devel@acpica.org" <devel@acpica.org>
Subject: Re: PROBLEM: Calling ObjectType on buffer field reports type integer
Date: Sat, 23 Nov 2019 00:00:34 +0100	[thread overview]
Message-ID: <adea0818-bee0-a57c-e347-98a7fb24e844@gmail.com> (raw)
In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E3B96B1A77@ORSMSX110.amr.corp.intel.com>


On 11/22/19 11:07 PM, Moore, Robert wrote:
> I'm not seeing this problem. For example:
>      Method (DS01)
>      {
>          Name(BUFZ, Buffer(48){})
>          CreateField(BUFZ, 192, 69, DST0)
>          Store (ObjectType (DST0), Debug)
>      }
> 
> Acpiexec dsdt.aml
> Eval DS01
> Evaluating \DS01
> ACPI Debug:  0x000000000000000E
> 
> 0x0E is in fact type "buffer field".

Hi,

unfortunately, the bug is a bit more convoluted, here's a minimal
example:

     Method (DS01)
     {
         Name(BUFZ, Buffer(48){})
         CreateField(BUFZ, 192, 32, DST0)
         Local0 = DST0
         Store (ObjectType (Local0), Debug)
     }

It is based on the combination of CreateField with length smaller or
equal to the maximum integer size and the assignment of the field to a
local variable. For me, this yields

Eval DS01
Evaluating \DS01
ACPI Debug:  0x0000000000000001

As already iterated, this should be the correct behavior according to
spec, but causes failures on Microsoft Surface devices.

For reference, I've added two links to the relevant parts in the DSDT of
the MS Surface Book 2: In short, MS identifies errors by the type of a
local variable which is supposed to either contain a payload (buffer) or
an error value (integer). This local variable (Local4) is previously
assigned from a buffer field [1] containing some payload data. However
on Linux, if the payload data is smaller than or equal to 64 bits, the
type of the variable is integer and the transaction gets misidentified
as having failed [2].

[1]: https://github.com/qzed/surfacebook2-dsdt/blob/fa0ca7c7cba8fb0da1e79c282f9a9f4a12eaaa17/dsdt.dsl#L15396-L15397
[2]: https://github.com/qzed/surfacebook2-dsdt/blob/fa0ca7c7cba8fb0da1e79c282f9a9f4a12eaaa17/dsdt.dsl#L15427

In hindsight, the subject line is not describing the actual problem very
well, I apologize for that.

Thanks,
Maximilian


  reply	other threads:[~2019-11-22 23:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3ef42aa1-196d-f3db-0e5d-2fd84c198242@gmail.com>
     [not found] ` <CF6A88132359CE47947DB4C6E1709ED53C592D47@ORSMSX122.amr.corp.intel.com>
     [not found]   ` <CF6A88132359CE47947DB4C6E1709ED53C59405C@ORSMSX122.amr.corp.intel.com>
     [not found]     ` <fe4bcc1c-5c15-caa6-ce01-a5df962ff008@gmail.com>
     [not found]       ` <CF6A88132359CE47947DB4C6E1709ED53C5942CA@ORSMSX122.amr.corp.intel.com>
     [not found]         ` <51e156ec-c2ed-84be-13c0-99a213e1d4b7@gmail.com>
     [not found]           ` <CF6A88132359CE47947DB4C6E1709ED53C595C50@ORSMSX122.amr.corp.intel.com>
2019-07-20 20:45             ` PROBLEM: Calling ObjectType on buffer field reports type integer Maximilian Luz
2019-07-22 23:01               ` Schmauss, Erik
2019-07-23 11:38                 ` Maximilian Luz
2019-11-10 21:29                 ` Maximilian Luz
2019-11-22 17:11                   ` Moore, Robert
2019-11-22 22:07                     ` Moore, Robert
2019-11-22 23:00                       ` Maximilian Luz [this message]
2019-11-22 23:29                       ` Schmauss, Erik
2019-11-23  0:33                         ` Maximilian Luz
2019-11-27  0:25                           ` Schmauss, Erik
2019-12-03 22:21                             ` Kaneda, Erik
2019-12-04 19:33                               ` Maximilian Luz
2019-12-05 23:57                                 ` Kaneda, Erik
2019-12-06 13:48                                   ` Maximilian Luz

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=adea0818-bee0-a57c-e347-98a7fb24e844@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=devel@acpica.org \
    --cc=erik.schmauss@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.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).