mbox series

[v2,0/2] tpm: Unify send() callbacks

Message ID 20190208160328.18715-1-jarkko.sakkinen@linux.intel.com (mailing list archive)
Headers show
Series tpm: Unify send() callbacks | expand

Message

Jarkko Sakkinen Feb. 8, 2019, 4:03 p.m. UTC
A portion of send() callbacks have returned length, in many cases just
returning back what was given as an argument, and tpm_crb has returned 0 on
success. This patch set fixes and unifies the behaviour.

v2:
The drivers tpm_nsc and tpm_infineon were forgotten. For this version I
checked both with find and command and from Kconfig that everything that is
supposed to be a driver directly interfacing with the TPM core, is included
(e.g. discluding tpm_tis_spi).

Jarkko Sakkinen (2):
  tpm: Unify the send callback behaviour
  tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete

 drivers/char/tpm/st33zp24/st33zp24.c |  2 +-
 drivers/char/tpm/tpm_atmel.c         |  2 +-
 drivers/char/tpm/tpm_i2c_atmel.c     | 10 +++++++++-
 drivers/char/tpm/tpm_i2c_infineon.c  |  2 +-
 drivers/char/tpm/tpm_i2c_nuvoton.c   |  2 +-
 drivers/char/tpm/tpm_ibmvtpm.c       |  2 +-
 drivers/char/tpm/tpm_infineon.c      |  2 +-
 drivers/char/tpm/tpm_nsc.c           |  2 +-
 drivers/char/tpm/tpm_vtpm_proxy.c    |  3 +--
 drivers/char/tpm/xen-tpmfront.c      |  2 +-
 10 files changed, 18 insertions(+), 11 deletions(-)

Comments

Stefan Berger Feb. 8, 2019, 4:14 p.m. UTC | #1
On 2/8/19 11:03 AM, Jarkko Sakkinen wrote:
> A portion of send() callbacks have returned length, in many cases just
> returning back what was given as an argument, and tpm_crb has returned 0 on
> success. This patch set fixes and unifies the behaviour.
>
> v2:
> The drivers tpm_nsc and tpm_infineon were forgotten. For this version I
> checked both with find and command and from Kconfig that everything that is
> supposed to be a driver directly interfacing with the TPM core, is included
> (e.g. discluding tpm_tis_spi).


:-( st33zp24/i2c.c ends up calling i2c_master_send, which returns number 
of bytes written:

https://elixir.bootlin.com/linux/latest/source/include/linux/i2c.h#L108


>
> Jarkko Sakkinen (2):
>    tpm: Unify the send callback behaviour
>    tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete
>
>   drivers/char/tpm/st33zp24/st33zp24.c |  2 +-
>   drivers/char/tpm/tpm_atmel.c         |  2 +-
>   drivers/char/tpm/tpm_i2c_atmel.c     | 10 +++++++++-
>   drivers/char/tpm/tpm_i2c_infineon.c  |  2 +-
>   drivers/char/tpm/tpm_i2c_nuvoton.c   |  2 +-
>   drivers/char/tpm/tpm_ibmvtpm.c       |  2 +-
>   drivers/char/tpm/tpm_infineon.c      |  2 +-
>   drivers/char/tpm/tpm_nsc.c           |  2 +-
>   drivers/char/tpm/tpm_vtpm_proxy.c    |  3 +--
>   drivers/char/tpm/xen-tpmfront.c      |  2 +-
>   10 files changed, 18 insertions(+), 11 deletions(-)
>
Jarkko Sakkinen Feb. 8, 2019, 4:23 p.m. UTC | #2
On Fri, Feb 08, 2019 at 11:14:42AM -0500, Stefan Berger wrote:
> On 2/8/19 11:03 AM, Jarkko Sakkinen wrote:
> > A portion of send() callbacks have returned length, in many cases just
> > returning back what was given as an argument, and tpm_crb has returned 0 on
> > success. This patch set fixes and unifies the behaviour.
> > 
> > v2:
> > The drivers tpm_nsc and tpm_infineon were forgotten. For this version I
> > checked both with find and command and from Kconfig that everything that is
> > supposed to be a driver directly interfacing with the TPM core, is included
> > (e.g. discluding tpm_tis_spi).
> 
> 
> :-( st33zp24/i2c.c ends up calling i2c_master_send, which returns number of
> bytes written:
> 
> https://elixir.bootlin.com/linux/latest/source/include/linux/i2c.h#L108

And i2c.c is not a TPM driver so does it matter?

Then st33zp24_send() is the callback interfacing with the TPM core.

/Jarkko