linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org,
	Andrey Pronin <apronin@chromium.org>,
	Duncan Laurie <dlaurie@chromium.org>,
	Jason Gunthorpe <jgg@ziepe.ca>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <groeck@chromium.org>,
	Alexander Steffen <Alexander.Steffen@infineon.com>
Subject: Re: [PATCH v4 3/6] tpm: tpm_tis_spi: Add a pre-transfer callback
Date: Mon, 19 Aug 2019 19:35:05 +0300	[thread overview]
Message-ID: <20190819163505.wnyhgrtg4akiifdn@linux.intel.com> (raw)
In-Reply-To: <20190812223622.73297-4-swboyd@chromium.org>

On Mon, Aug 12, 2019 at 03:36:19PM -0700, Stephen Boyd wrote:
> Cr50 firmware has a requirement to wait for the TPM to wakeup before
> sending commands over the SPI bus. Otherwise, the firmware could be in
> deep sleep and not respond. Add a hook to tpm_tis_spi_transfer() before
> we start a SPI transfer so we can keep track of the last time the TPM
> driver accessed the SPI bus.
> 
> Cc: Andrey Pronin <apronin@chromium.org>
> Cc: Duncan Laurie <dlaurie@chromium.org>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Alexander Steffen <Alexander.Steffen@infineon.com>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>  drivers/char/tpm/tpm_tis_spi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
> index 819602e85b34..93f49b1941f0 100644
> --- a/drivers/char/tpm/tpm_tis_spi.c
> +++ b/drivers/char/tpm/tpm_tis_spi.c
> @@ -44,6 +44,7 @@ struct tpm_tis_spi_phy {
>  	struct spi_device *spi_device;
>  	int (*flow_control)(struct tpm_tis_spi_phy *phy,
>  			    struct spi_transfer *xfer);
> +	void (*pre_transfer)(struct tpm_tis_spi_phy *phy);

A callback should have somewhat well defined purpose. A callback named
as pre_transfer() could have any purpose.

/Jarkko

  reply	other threads:[~2019-08-19 16:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 22:36 [PATCH v4 0/6] tpm: Add driver for cr50 Stephen Boyd
2019-08-12 22:36 ` [PATCH v4 1/6] tpm: Add a flag to indicate TPM power is managed by firmware Stephen Boyd
2019-08-15 20:34   ` Jarkko Sakkinen
2019-08-12 22:36 ` [PATCH v4 2/6] tpm: tpm_tis_spi: Introduce a flow control callback Stephen Boyd
2019-08-19 16:32   ` Jarkko Sakkinen
2019-08-19 17:06     ` Stephen Boyd
2019-08-21 18:13       ` Jarkko Sakkinen
2019-08-12 22:36 ` [PATCH v4 3/6] tpm: tpm_tis_spi: Add a pre-transfer callback Stephen Boyd
2019-08-19 16:35   ` Jarkko Sakkinen [this message]
2019-08-19 17:07     ` Stephen Boyd
2019-08-21 19:11       ` Jarkko Sakkinen
2019-08-21 21:44         ` Stephen Boyd
2019-08-12 22:36 ` [PATCH v4 4/6] tpm: tpm_tis_spi: Export functionality to other drivers Stephen Boyd
2019-08-19 16:40   ` Jarkko Sakkinen
2019-08-19 17:10     ` Stephen Boyd
2019-08-21 17:58       ` Jarkko Sakkinen
2019-08-22 17:29         ` Stephen Boyd
2019-08-12 22:36 ` [PATCH v4 5/6] dt-bindings: tpm: document properties for cr50 Stephen Boyd
2019-08-12 22:36 ` [PATCH v4 6/6] tpm: add driver for cr50 on SPI Stephen Boyd
2019-08-27  0:58 ` [PATCH v4 0/6] tpm: Add driver for cr50 Heiko Stuebner

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=20190819163505.wnyhgrtg4akiifdn@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=Alexander.Steffen@infineon.com \
    --cc=apronin@chromium.org \
    --cc=arnd@arndb.de \
    --cc=dlaurie@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=swboyd@chromium.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 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).