All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: Andy Isaacson <adi@hexapodia.org>
Cc: len.brown@intel.com, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andy Isaacson <adi@vmware.com>,
	linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net,
	dds@google.com, Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Shahbaz Khan <shaz.linux@gmail.com>,
	seiji.munetoh@gmail.com
Subject: Re: [PATCH 5/6] tpm_tis: convert from pnp_driver to acpi_driver
Date: Thu, 10 Sep 2009 16:08:34 -0300	[thread overview]
Message-ID: <1252609714.4837.87.camel@blackbox> (raw)
In-Reply-To: <20090720182732.GL6370@hexapodia.org>

On Mon, 2009-07-20 at 11:27 -0700, Andy Isaacson wrote:
> On Wed, Jul 01, 2009 at 10:45:19AM -0300, Rajiv Andrade wrote:
> > On Wed, 2009-07-01 at 11:01 +0100, Alan Cox wrote:
> > > On Tue, 30 Jun 2009 18:04:14 -0700
> > > Andy Isaacson <adi@vmware.com> wrote:
> > > 
> > > > Not all TIS-compatible TPM chips have a _HID method in their ACPI entry,
> > > > and the TPM spec says that the _CID method should be used to enumerate
> > > > the TPM chip.
> > > 
> > > There are a number of systems with TPMs (older laptops) that don't work
> > > very well if you enable ACPI.
> > > 
> > > This is therefore a regression - NAK
> > > 
> > > Probably the best thing to do is to provide both ACPI and PnP
> > > registration according to what is configured into the kernel. (And I
> > > guess spot duplicates although the resource should be busy anyway)
> > > --
> > David sent this earlier when I said that PNP didn't work with this chip:
> >         
> > <quote>
> > The problem here is acpi pnp but the fix is really simple. The current
> > pnpacpi/core.c routine that looks for isapnp devices enumerated in acpi
> > enforces that the acpi hid be a valid isapnp id (the formats are
> > slightly different). But that's broken: it shoudl be enforcing that
> > either the acpi hid or any acpi cids be valid isapnp ids. It's a
> > one-line change to do this, see patch 2. 
> > 
> > commit 7a553b4e7439ad0733da7da8663d32aa4865aa9e
> > Author: David Smith <dds@google.com>
> > Date:   Tue Apr 28 18:52:02 2009 +0900
> > 
> >     Update ACPI PNP to support devices with EISA PNP CIDs but non-PNP HIDs
> >     
> >     Signed-off-by: David Smith <dds@google.com>
> > 
> > diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
> > index 9496494..8bfddfb 100644
> > --- a/drivers/pnp/pnpacpi/core.c
> > +++ b/drivers/pnp/pnpacpi/core.c
> > @@ -159,8 +159,8 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
> >  	 * driver should not be loaded.
> >  	 */
> >  	status = acpi_get_handle(device->handle, "_CRS", &temp);
> > -	if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
> > -	    is_exclusive_device(device) || (!device->status.present))
> > +	if (ACPI_FAILURE(status) || is_exclusive_device(device) ||
> > +            (!device->status.present))
> >  		return 0;
> >  
> >  	dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device));
> > 
> > </quote>
> 
> Len,
> 
> Is this an acceptable change to pnpacpi?  It resolves an issue with
> tpm_tis but I'm concerned that it might have far-reaching impact.
> 
> I've pasted in the problematic DSDT (manually fixing up whitespace to
> make it more readable), and then a normal TPM simply has a _HID which
> is matched by a pnp_device_id table in the driver
> (drivers/char/tpm/tpm_tis.c).
> 
> T400:
>         Device (TPM)
>         {
>             Method (_HID, 0, NotSerialized)
>             {
>                 TPHY (0x00)
>                 If (LEqual (TPMV, 0x01)) { Return (0x0201D824) } 
>                 If (LEqual (TPMV, 0x02)) { Return (0x0435CF4D) } 
>                 If (LEqual (TPMV, 0x03)) { Return (0x02016D08) } 
>                 If (LEqual (TPMV, 0x04)) { Return (0x01016D08) } 
>                 If (LOr (LEqual (TPMV, 0x05), LEqual (TPMV, 0x06))) {
> 			Return (0x0010A35C)
> 		} 
>                 If (LEqual (TPMV, 0x08)) { Return (0x00128D06) } 
>                 If (LEqual (TPMV, 0x09)) { Return ("INTC0102") } 
>                 Return (0x310CD041)
>             }
> 
>             Name (_CID, EisaId ("PNP0C31"))
> 
> standard TPM:
>         Device (TPM)
>         {
>             Name (_HID, EisaId ("BCM0102"))
>             Name (_CID, EisaId ("PNP0C31"))
> 
> The full thread is at
> http://lkml.org/lkml/2009/7/1/265
> 
> Thanks for any insight.
> 

We've already waited too much on this, is it acceptable to make the
workaround depend on (and only on) the module parameter you've set in
patch 6/6? Therefore no need to check the vendor ID.

<snip>
+MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)"); 
</snip>

It already mentions _Force_, which in many cases maps to "it's all your
responsibility"...

And yes, still without PNP, but at least, working.

Rajiv




  reply	other threads:[~2009-09-10 19:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  1:04 [PATCH 0/6] tpm_tis: various cleanups, and support for Intel iTPM Andy Isaacson
2009-07-01  1:04 ` [PATCH 1/6] tpm_tis: various cleanups Andy Isaacson
2009-09-10 19:56   ` Rajiv Andrade
2009-07-01  1:04 ` [PATCH 2/6] tpm_tis: add MODULE_DEVICE_TABLE to enable autoload Andy Isaacson
2009-09-10 19:56   ` Rajiv Andrade
2009-07-01  1:04 ` [PATCH 3/6] tpm_tis: set timeouts before calling request_locality Andy Isaacson
2009-07-01  1:04 ` [PATCH 4/6] tpm_tis: print complete vendor information Andy Isaacson
2009-09-10 19:57   ` Rajiv Andrade
2009-07-01  1:04 ` [PATCH 5/6] tpm_tis: convert from pnp_driver to acpi_driver Andy Isaacson
2009-07-01 10:01   ` Alan Cox
2009-07-01 13:45     ` Rajiv Andrade
2009-07-16 17:26       ` Rajiv Andrade
2009-07-16 17:43         ` [PATCH] TPM: DATA_EXPECT bit check bypass Rajiv Andrade
2009-07-16 20:08           ` Valdis.Kletnieks
2009-07-16 20:50             ` Rajiv Andrade
2009-07-16 21:20             ` Rajiv Andrade
2009-07-20 23:28               ` Andy Isaacson
2009-07-24 17:12                 ` Rajiv Andrade
2009-07-20 18:27       ` [PATCH 5/6] tpm_tis: convert from pnp_driver to acpi_driver Andy Isaacson
2009-09-10 19:08         ` Rajiv Andrade [this message]
2009-09-10 19:54           ` [PATCH] tpm_tis: TPM_STS_DATA_EXPECT workaround Rajiv Andrade
2009-09-10 19:58             ` Daniel Walker
2009-09-10 20:06               ` Rajiv Andrade
2009-09-10 20:09               ` Rajiv Andrade
2009-09-11 23:34                 ` Seiji Munetoh
2009-09-24 18:43                   ` Rajiv Andrade
2009-10-28  2:45                     ` David Smith
2009-10-31 14:24                       ` Eric Paris
2009-11-01 22:09                         ` James Morris
2009-09-10 20:27               ` Andy Isaacson
2009-07-01  1:04 ` [PATCH 6/6] tpm_tis: add workarounds for iTPM Andy Isaacson
2009-07-03 18:18   ` [tpmdd-devel] " Marcin Obara
2009-07-03 19:33     ` Andy Isaacson
2009-07-03 20:10       ` Marcin Obara
2009-07-03 20:20         ` Andy Isaacson

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=1252609714.4837.87.camel@blackbox \
    --to=srajiv@linux.vnet.ibm.com \
    --cc=adi@hexapodia.org \
    --cc=adi@vmware.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dds@google.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seiji.munetoh@gmail.com \
    --cc=shaz.linux@gmail.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=zohar@linux.vnet.ibm.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.