mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Hüwe" <PeterHuewe@gmx.de>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Ashley Lai <ashley@ashleylai.com>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	josh.triplett@intel.com, christophe.ricard@gmail.com,
	jason.gunthorpe@obsidianresearch.com, linux-api@vger.kernel.org,
	trousers-tech@lists.sourceforge.net
Subject: Re: [PATCH v9 3/8] tpm: fix raciness of PPI interface lookup
Date: Thu, 4 Dec 2014 21:34:15 +0100	[thread overview]
Message-ID: <201412042134.15776.PeterHuewe@gmx.de> (raw)
In-Reply-To: <1417672518-4530-4-git-send-email-jarkko.sakkinen@linux.intel.com>

Am Donnerstag, 4. Dezember 2014, 06:55:13 schrieb Jarkko Sakkinen:
> Traversal of the ACPI device tree was not done right. PPI interface
> should be looked up only from the ACPI device that is the platform
> device for the TPM. This could cause problems with systems with
> two TPM chips such as 4th gen Intel systems.
> 
> In addition, added the missing license and copyright platter to
> the tpm_ppi.c.
> 
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

:(

> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -580,8 +580,9 @@ static void tpm_tis_remove(struct tpm_chip *chip)
>  	release_locality(chip, chip->vendor.locality, 1);
>  }
> 
> -static int tpm_tis_init(struct device *dev, resource_size_t start,
> -			resource_size_t len, unsigned int irq)
> +static int tpm_tis_init(struct device *dev, acpi_handle acpi_dev_handle,
> +			resource_size_t start, resource_size_t len,
> +			unsigned int irq)
>  {
>  	u32 vendor, intfcaps, intmask;
>  	int rc, i, irq_s, irq_e, probe;
> @@ -597,6 +598,7 @@ static int tpm_tis_init(struct device *dev,
> resource_size_t start, return PTR_ERR(chip);
> 
>  	chip->vendor.priv = priv;
> +	chip->acpi_dev_handle = acpi_dev_handle;
> 
>  	chip->vendor.iobase = devm_ioremap(dev, start, len);
>  	if (!chip->vendor.iobase)
> @@ -827,6 +829,7 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
>  {
>  	resource_size_t start, len;
>  	unsigned int irq = 0;
> +	acpi_handle acpi_dev_handle = NULL;
> 
>  	start = pnp_mem_start(pnp_dev, 0);
>  	len = pnp_mem_len(pnp_dev, 0);
> @@ -839,7 +842,10 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
>  	if (is_itpm(pnp_dev))
>  		itpm = true;
> 
> -	return tpm_tis_init(&pnp_dev->dev, start, len, irq);
> +	if (pnp_acpi_device(pnp_dev))
> +		acpi_dev_handle = pnp_acpi_device(pnp_dev)->handle;
> +
> +	return tpm_tis_init(&pnp_dev->dev, acpi_dev_handle, start, len, irq);
>  }

With CONFIG_ACPI not set I get a build error :(

  CC [M]  drivers/char/tpm/tpm_tis.o
drivers/char/tpm/tpm_tis.c: In function 'tpm_tis_init':
drivers/char/tpm/tpm_tis.c:614:6: error: 'struct tpm_chip' has no member named 
'acpi_dev_handle'
scripts/Makefile.build:263: recipe for target 'drivers/char/tpm/tpm_tis.o' 
failed
make[3]: *** [drivers/char/tpm/tpm_tis.o] Error 1
scripts/Makefile.build:404: recipe for target 'drivers/char/tpm' failed
make[2]: *** [drivers/char/tpm] Error 2
scripts/Makefile.build:404: recipe for target 'drivers/char' failed
make[1]: *** [drivers/char] Error 2
Makefile:929: recipe for target 'drivers' failed
make: *** [drivers] Error 2


Please fix.
Peter

  reply	other threads:[~2014-12-04 20:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  5:55 [PATCH v9 0/8] TPM 2.0 support Jarkko Sakkinen
2014-12-04  5:55 ` [PATCH v9 1/8] tpm: merge duplicate transmit_cmd() functions Jarkko Sakkinen
2014-12-04  5:55 ` [PATCH v9 2/8] tpm: two-phase chip management functions Jarkko Sakkinen
2014-12-04  5:55 ` [PATCH v9 3/8] tpm: fix raciness of PPI interface lookup Jarkko Sakkinen
2014-12-04 20:34   ` Peter Hüwe [this message]
2014-12-04  5:55 ` [PATCH v9 4/8] tpm: rename chip->dev to chip->pdev Jarkko Sakkinen
2014-12-04 20:49   ` Peter Hüwe
2014-12-04  5:55 ` [PATCH v9 5/8] tpm: device class for tpm Jarkko Sakkinen
2014-12-04  5:55 ` [PATCH v9 6/8] tpm: TPM 2.0 baseline support Jarkko Sakkinen
2014-12-04 23:17   ` Peter Hüwe
2014-12-05 14:13     ` Jarkko Sakkinen
2014-12-05 14:35       ` Aw: " Peter Huewe
2014-12-06 11:54         ` Jarkko Sakkinen
2014-12-04  5:55 ` [PATCH v9 7/8] tpm: TPM 2.0 CRB Interface Jarkko Sakkinen
2014-12-04 20:19   ` Peter Hüwe
2014-12-05 13:10     ` Jarkko Sakkinen
2014-12-04 22:55   ` Peter Hüwe
2014-12-04  5:55 ` [PATCH v9 8/8] tpm: TPM 2.0 FIFO Interface Jarkko Sakkinen
2014-12-04 15:25   ` [tpmdd-devel] " Scot Doyle
2014-12-05 13:05     ` Jarkko Sakkinen
2014-12-04 21:46   ` Peter Hüwe
2014-12-05 13:06     ` Jarkko Sakkinen
2014-12-04 22:18   ` Peter Hüwe
2014-12-04 22:28     ` [tpmdd-devel] " Peter Hüwe
2014-12-05 15:01       ` Aw: " Peter Huewe
2014-12-05 20:44         ` Stefan Berger
2014-12-09 15:47         ` Jarkko Sakkinen

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=201412042134.15776.PeterHuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=ashley@ashleylai.com \
    --cc=christophe.ricard@gmail.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jason.gunthorpe@obsidianresearch.com \
    --cc=josh.triplett@intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    --cc=trousers-tech@lists.sourceforge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome