lkml.org 
[lkml]   [2023]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [Patch V8 2/3] tpm_tis-spi: Add hardware wait polling
Date

> -----Original Message-----
> From: Jarkko Sakkinen <jarkko@kernel.org>
> Sent: 12 March 2023 03:19
> To: Krishna Yarlagadda <kyarlagadda@nvidia.com>; robh+dt@kernel.org;
> broonie@kernel.org; peterhuewe@gmx.de; jgg@ziepe.ca;
> 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
> Cc: thierry.reding@gmail.com; Jonathan Hunter <jonathanh@nvidia.com>;
> Sowjanya Komatineni <skomatineni@nvidia.com>; Laxman Dewangan
> <ldewangan@nvidia.com>
> Subject: Re: [Patch V8 2/3] tpm_tis-spi: Add hardware wait polling
>
> External email: Use caution opening links or attachments
>
>
> On Thu, 2023-03-02 at 09:48 +0530, Krishna Yarlagadda wrote:
> > +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)
> > + return tpm_tis_spi_hw_flow_transfer(data, addr, len,
> > in,
> > + out);
> > + else
> > + return tpm_tis_spi_sw_flow_transfer(data, addr, len,
> > in,
> > + out);
> > +}
> > +
>
> Based on the condition, better names would be
Though condition is based on half duplex, functions are implementing
HW or SW flow of the transfer.
KY
>
> 1. tpm_tis_spi_transfer_half()
> 2. tpm_tis_spi_transfer_full()
>
> BR, Jarkko
\
 
 \ /
  Last update: 2023-03-27 01:01    [W:0.143 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site