Re: [PATCH 2/2] tpm: add driver for cr50 on SPI

From: Jason Gunthorpe
Date: Wed Jul 20 2016 - 13:03:55 EST


On Tue, Jul 19, 2016 at 05:24:11PM -0700, Andrey Pronin wrote:

> The only two things that bother me with such approach are
> (1) whatever names I pick for the new set of functions, they
> will be similar to and thus might be confused with the
> original tpm_tis_read/writeXX;

tpm_tis_helper_read16 ?

> (2) these functions are phy-specific, so possibly it's better
> to create tpm_tis_spi.h and put them there with proper
> name prefixes. And then use in tpm_tis_spi and cr50_spi.

No, they are generic to any tis phy that implements read only through
read_bytes.

(Honestly, I'm not sure we made the best choice here having phy
functions for all the versions, we are not that performance
sensitive, just getting rid of everything but read_bytes from the
phy_ops would probably also be a reasonable thing to do.)

Jason