Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Krishna Yarlagadda <kyarlagadda@nvidia.com>,
	robh+dt@kernel.org, broonie@kernel.org, peterhuewe@gmx.de,
	krzysztof.kozlowski+dt@linaro.org, linux-spi@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-integrity@vger.kernel.org,
	linux-kernel@vger.kernel.org, thierry.reding@gmail.com,
	jonathanh@nvidia.com, skomatineni@nvidia.com,
	ldewangan@nvidia.com
Subject: Re: [Patch V5 2/3] tpm_tis-spi: Support hardware wait polling
Date: Tue, 28 Feb 2023 08:28:05 -0400	[thread overview]
Message-ID: <Y/3zVdgnVz8BvGGl@ziepe.ca> (raw)
In-Reply-To: <Y/1oqr0RfD7KVA4y@kernel.org>

On Tue, Feb 28, 2023 at 04:36:26AM +0200, Jarkko Sakkinen wrote:
> On Mon, Feb 27, 2023 at 05:37:01PM +0530, Krishna Yarlagadda wrote:
> > TPM devices raise wait signal on last addr cycle. This can be detected
> > by software driver by reading MISO line on same clock which requires
> > full duplex support. In case of half duplex controllers wait detection
> > has to be implemented in HW.
> > Support hardware wait state detection by sending entire message and let
> > controller handle flow control.
> 
> When a is started sentence with the word "support" it translates to "I'm
> too lazy to write a proper and verbose description of the implementation"
> :-)
> 
> It has some abstract ideas of the implementation, I give you that, but do
> you think anyone ever will get any value of reading that honestly? A bit
> more concrette description of the change helps e.g. when bisecting bugs.

I would expect SPI_TPM_HW_FLOW to be documented in the kdocs to a
level that any other HW could implement it as well.

> > +int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
> > +			 u8 *in, const u8 *out)
> > +{
> > +	struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data);
> > +	struct spi_controller *ctlr = phy->spi_device->controller;
> > +
> > +	/*
> > +	 * TPM flow control over SPI requires full duplex support.
> > +	 * Send entire message to a half duplex controller to handle
> > +	 * wait polling in controller.
> > +	 * Set TPM HW flow control flag..
> > +	 */
> > +	if (ctlr->flags & SPI_CONTROLLER_HALF_DUPLEX) {
> > +		phy->spi_device->mode |= SPI_TPM_HW_FLOW;

Shouldn't we check that this special flow is supported when the SPI
device is bound to the tpm in the first place?

Jason

  parent reply	other threads:[~2023-02-28 12:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 12:06 [Patch V5 0/3] Tegra TPM driver with HW flow control Krishna Yarlagadda
2023-02-27 12:07 ` [Patch V5 1/3] spi: Add TPM HW flow flag Krishna Yarlagadda
2023-02-27 12:07 ` [Patch V5 2/3] tpm_tis-spi: Support hardware wait polling Krishna Yarlagadda
2023-02-28  2:36   ` Jarkko Sakkinen
2023-02-28  3:32     ` Krishna Yarlagadda
2023-03-01 23:17       ` Jarkko Sakkinen
2023-02-28 12:28     ` Jason Gunthorpe [this message]
2023-03-01 11:56       ` Krishna Yarlagadda
2023-03-01 12:27         ` Jason Gunthorpe
2023-03-01 12:37           ` Mark Brown
2023-03-01 13:39             ` Jason Gunthorpe
2023-03-01 13:45               ` Mark Brown
2023-03-01 14:09               ` Thierry Reding
2023-03-01 15:38                 ` Jason Gunthorpe
2023-02-27 12:07 ` [Patch V5 3/3] spi: tegra210-quad: Enable TPM " Krishna Yarlagadda
2023-02-28  2:28 ` [Patch V5 0/3] Tegra TPM driver with HW flow control 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=Y/3zVdgnVz8BvGGl@ziepe.ca \
    --to=jgg@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=jarkko@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kyarlagadda@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=robh+dt@kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox