From: "Peter Hüwe" <PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
To: Jarkko Sakkinen
<jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: Ashley Lai <ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org>,
Marcel Selhorst <tpmdd-yWjUBOtONefk1uMJSBkQmQ@public.gmane.org>,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
josh.triplett-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jason.gunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
trousers-tech-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
:(
> --- 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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2014-12-04 20:34 UTC|newest]
Thread overview: 45+ 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 ` 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
[not found] ` <1417672518-4530-4-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 20:34 ` Peter Hüwe [this message]
2014-12-04 20:34 ` Peter Hüwe
[not found] ` <1417672518-4530-1-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 5:55 ` [PATCH v9 4/8] tpm: rename chip->dev to chip->pdev Jarkko Sakkinen
2014-12-04 5:55 ` Jarkko Sakkinen
[not found] ` <1417672518-4530-5-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 20:49 ` Peter Hüwe
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
[not found] ` <1417672518-4530-7-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 23:17 ` Peter Hüwe
2014-12-04 23:17 ` Peter Hüwe
[not found] ` <201412050017.40668.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2014-12-05 14:13 ` Jarkko Sakkinen
2014-12-05 14:13 ` Jarkko Sakkinen
[not found] ` <20141205141303.GF6993-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-05 14:35 ` Aw: " Peter Huewe
2014-12-05 14:35 ` Peter Huewe
2014-12-06 11:54 ` Jarkko Sakkinen
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
[not found] ` <201412042119.21493.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2014-12-05 13:10 ` Jarkko Sakkinen
2014-12-05 13:10 ` Jarkko Sakkinen
[not found] ` <1417672518-4530-8-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 22:55 ` Peter Hüwe
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
[not found] ` <1417672518-4530-9-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-12-04 15:25 ` [tpmdd-devel] " Scot Doyle
2014-12-04 15:25 ` Scot Doyle
[not found] ` <alpine.DEB.2.11.1412041459470.5705-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-12-05 13:05 ` Jarkko Sakkinen
2014-12-05 13:05 ` Jarkko Sakkinen
2014-12-04 22:18 ` Peter Hüwe
2014-12-04 22:18 ` Peter Hüwe
[not found] ` <201412042318.33889.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2014-12-04 22:28 ` [tpmdd-devel] " Peter Hüwe
2014-12-04 22:28 ` Peter Hüwe
[not found] ` <201412042328.29578.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2014-12-05 15:01 ` Aw: " Peter Huewe
2014-12-05 15:01 ` Peter Huewe
2014-12-05 20:44 ` Stefan Berger
2014-12-05 20:44 ` Stefan Berger
2014-12-09 15:47 ` Jarkko Sakkinen
2014-12-09 15:47 ` Jarkko Sakkinen
2014-12-04 21:46 ` Peter Hüwe
[not found] ` <201412042246.25662.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2014-12-05 13:06 ` Jarkko Sakkinen
2014-12-05 13:06 ` 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-mmb7mzphnfy@public.gmane.org \
--cc=ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org \
--cc=christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=jason.gunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=josh.triplett-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=tpmdd-yWjUBOtONefk1uMJSBkQmQ@public.gmane.org \
--cc=trousers-tech-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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.