Re: [PATCH v3] tpm: ibmvtpm: retry on H_CLOSED in tpm_ibmvtpm_send()

From: Jarkko Sakkinen
Date: Thu Mar 19 2020 - 15:55:10 EST


On Thu, Mar 19, 2020 at 09:50:16PM +0200, Jarkko Sakkinen wrote:
> On Wed, Mar 18, 2020 at 07:49:27PM -0400, George Wilson wrote:
> > tpm_ibmvtpm_send() can fail during PowerVM Live Partition Mobility resume
> > with an H_CLOSED return from ibmvtpm_send_crq(). The PAPR says, 'The
> > âpartner partition suspendedâ transport event disables the associated CRQ
> > such that any H_SEND_CRQ hcall() to the associated CRQ returns H_Closed
> > until the CRQ has been explicitly enabled using the H_ENABLE_CRQ hcall.'
> > This patch adds a check in tpm_ibmvtpm_send() for an H_CLOSED return from
> > ibmvtpm_send_crq() and in that case calls tpm_ibmvtpm_resume() and
> > retries the ibmvtpm_send_crq() once.
> >
> > Reported-by: Linh Pham <phaml@xxxxxxxxxx>
> > Reviewed-by: Stefan Berger <stefanb@xxxxxxxxxxxxx>
> > Signed-off-by: George Wilson <gcwilson@xxxxxxxxxxxxx>
> > Tested-by: Linh Pham <phaml@xxxxxxxxxx>
> > Fixes: 132f76294744 ("Add new device driver to support IBM vTPM")
>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>

Unfortunately have to take that back because it has checkpatch
errors:

$ scripts/checkpatch.pl 0001-tpm-ibmvtpm-retry-on-H_CLOSED-in-tpm_ibmvtpm_send.patch
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#11:
âpartner partition suspendedâ transport event disables the associated CRQ

WARNING: Prefer using '"%s...", __func__' to using 'ibmvtpm_crq_send_init', this function's name, in a string
#61: FILE: drivers/char/tpm/tpm_ibmvtpm.c:152:
+ "ibmvtpm_crq_send_init failed rc=%d\n", rc);

Also the fixes tag is incorrect. Should be:

Fixes: 132f76294744 ("drivers/char/tpm: Add new device driver to support IBM vTPM")

/Jarkko