lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Mar 2023 11:56:53 +0000
From:   Krishna Yarlagadda <kyarlagadda@...dia.com>
To:     Jason Gunthorpe <jgg@...dia.com>,
        Jarkko Sakkinen <jarkko@...nel.org>
CC:     "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "peterhuewe@....de" <peterhuewe@....de>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
        "linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "thierry.reding@...il.com" <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Sowjanya Komatineni <skomatineni@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>
Subject: RE: [Patch V5 2/3] tpm_tis-spi: Support hardware wait polling


> -----Original Message-----
> From: Jason Gunthorpe <jgg@...dia.com>
> Sent: 28 February 2023 17:58
> To: Jarkko Sakkinen <jarkko@...nel.org>
> Cc: Krishna Yarlagadda <kyarlagadda@...dia.com>; robh+dt@...nel.org;
> broonie@...nel.org; peterhuewe@....de;
> krzysztof.kozlowski+dt@...aro.org; linux-spi@...r.kernel.org; linux-
> tegra@...r.kernel.org; linux-integrity@...r.kernel.org; linux-
> kernel@...r.kernel.org; thierry.reding@...il.com; Jonathan Hunter
> <jonathanh@...dia.com>; Sowjanya Komatineni
> <skomatineni@...dia.com>; Laxman Dewangan <ldewangan@...dia.com>
> Subject: Re: [Patch V5 2/3] tpm_tis-spi: Support hardware wait polling
> 
> 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.
HW implementation can be controller specific. I would add comments in the
header to say CMD-ADDR-DATA is sent as single message with this flag.
> 
> > > +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?
TPM device connected behind half duplex controller can only work
this way. So, no additional flag needed to check.
KY
> 
> Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ