All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Adam Langley <agl@imperialviolet.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	xiaoyan.zhang@intel.com, Bob Moore <robert.moore@intel.com>,
	Lv Zheng <lv.zheng@intel.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: ACPI errors from TPM PPI
Date: Sat, 6 Jul 2013 14:10:25 +0300	[thread overview]
Message-ID: <20130706111025.GZ4898@intel.com> (raw)
In-Reply-To: <CAMfhd9U6qvm2kTb2D8PgzR8qCqZnDWhLNC4Ojzftc8PdmKwjnA@mail.gmail.com>

On Fri, Jul 05, 2013 at 10:03:10AM -0400, Adam Langley wrote:
> On Thu, Jul 4, 2013 at 9:07 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> This appears to be coming from acpi_evaluate_object_typed in
> >> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/tpm/tpm_ppi.c#n75,
> >> so I added a printk to get the actual value of |status| when it fails
> >> and it's 5 (aka AE_NOT_FOUND I believe).
> 
> In hindsight, the error was somewhat obvious. The driver is locating
> the TPM object in the ACPI tables by walking the tables with a
> callback [1]. The callback is using strstr to look for the substring
> "TPM" in the handle of the object and returns the first that it finds.
> On my system, if I alter the callback to print each match and not
> abort the walk I find three values:
> 
> \_SB_.PCI0.TPMX
> \_SB_.PCI0.LPCB.TPM_
> \_SB_.PCI0.ITPM
> 
> Of these, the second is the right one.
> 
> (I note that the callback also appears to have a memory leak in the
> case that the string doesn't contain "TPM".)
> 
> I'm sure that the strstr() worked on the computer that it was
> developed on, but it's rather fragile. I can get it working for me by
> using "LPCB.TPM" as the argument to strstr(), but who's to say that
> doesn't break someone else?

I wonder whether there is a real PNP Id associated with that device?

I have one sample ASL code that looks like:

    Device (\_SB.PCI0.LPCB.TPM)
    {
        Name (_HID, EisaId ("PNP0C31"))
        Name (_CID, EisaId ("PNP0C31"))
        Name (_STR, Unicode ("TPM 1.2 Device"))
        Name (_CRS, ResourceTemplate ()
        {
            Memory32Fixed (ReadOnly,
                0xFED40000,         // Address Base
                0x00005000,         // Address Length
                )
        })

Does your TPM_ device look similar?

That PNP0C31 can be matched in the TPM driver instead of trusting some
random device names that might change from vendor to vendor.

  reply	other threads:[~2013-07-06 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05  0:41 ACPI errors from TPM PPI Adam Langley
2013-07-05  1:07 ` Rafael J. Wysocki
2013-07-05 14:03   ` Adam Langley
2013-07-06 11:10     ` Mika Westerberg [this message]
2013-07-08 16:13       ` Matthew Garrett
2013-07-09  8:54         ` 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=20130706111025.GZ4898@intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=agl@imperialviolet.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    --cc=xiaoyan.zhang@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 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.