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]
Message-ID: <Y/9EwTtmxcVBjiHz@nvidia.com>
Date:   Wed, 1 Mar 2023 08:27:45 -0400
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Krishna Yarlagadda <kyarlagadda@...dia.com>
Cc:     Jarkko Sakkinen <jarkko@...nel.org>,
        "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

On Wed, Mar 01, 2023 at 11:56:53AM +0000, 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) {
> > > > +		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.

Just because a DT hooks it up this way doesn't mean the kernel driver
can support it, eg support hasn't been implemented in an older SPI
driver or something.

If the failure mode is anything other than the TPM doesn't probe we
will need to check for support.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ