linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-integrity@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
	Jerry Snitselaar <jsnitsel@redhat.com>,
	Peter Huewe <peterhuewe@gmx.de>
Subject: Re: [PATCH 3/4] tpm_tis: fix IRQ probing
Date: Wed, 30 Sep 2020 05:40:15 +0300	[thread overview]
Message-ID: <20200930024015.GK808399@linux.intel.com> (raw)
In-Reply-To: <20200929223216.22584-4-James.Bottomley@HansenPartnership.com>

On Tue, Sep 29, 2020 at 03:32:15PM -0700, James Bottomley wrote:
> Unless the TPM_CHIP_FLAG_IRQ is set somewhere, an initial probe of the
> IRQ never gets done.
> 
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Please add a clear statement what the patch does in imperative form.

> ---
>  drivers/char/tpm/tpm_tis_core.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> index 02cc384fdaea..b8ab26077cb1 100644
> --- a/drivers/char/tpm/tpm_tis_core.c
> +++ b/drivers/char/tpm/tpm_tis_core.c
> @@ -808,6 +808,19 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip,
>  	}
>  	priv->irq = irq;
>  
> +	/*
> +	 * note writes to the interrupt registers are only effective
> +	 * when the TPM is in the active locality, so we have to
> +	 * request the locality here to get the interrupt set up.
> +	 * This request has no corresponding release, because the
> +	 * locality will be relinquished at the end of the tpm command
> +	 * that probes the interrupts
> +	 */
> +	if (request_locality(chip, 0) != 0) {
> +		dev_err(&chip->dev, "failed to gain locality for irq probe\n");
> +		return -EBUSY;
> +	}
> +
>  	rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
>  			   &original_int_vec);
>  	if (rc < 0)
> @@ -835,6 +848,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip,
>  		return rc;
>  
>  	priv->irq_tested = false;
> +	chip->flags |= TPM_CHIP_FLAG_IRQ;
>  
>  	/* Generate an interrupt by having the core call through to
>  	 * tpm_tis_send
> -- 
> 2.28.0
> 

Agree with the code change tho.

/Jarkko

  reply	other threads:[~2020-09-30  2:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 22:32 [PATCH 0/4] tpm_tis: fix interrupts (again) James Bottomley
2020-09-29 22:32 ` [PATCH 1/4] tpm_tis: Clean up locality release James Bottomley
2020-09-30  2:26   ` Jarkko Sakkinen
2020-09-30  2:26     ` Jarkko Sakkinen
2020-09-30 21:19   ` Jerry Snitselaar
2020-09-30 23:03     ` James Bottomley
2020-10-01  0:01       ` Jerry Snitselaar
2020-10-01 15:58         ` James Bottomley
2021-01-02  1:17           ` Laurent Bigonville
2020-10-01  2:01       ` Jarkko Sakkinen
2020-10-01  4:49         ` James Bottomley
2020-10-01 17:48           ` James Bottomley
2020-09-29 22:32 ` [PATCH 2/4] tpm_tis: Fix interrupts for TIS TPMs without legacy cycles James Bottomley
2020-09-30  2:39   ` Jarkko Sakkinen
2020-09-29 22:32 ` [PATCH 3/4] tpm_tis: fix IRQ probing James Bottomley
2020-09-30  2:40   ` Jarkko Sakkinen [this message]
2020-09-29 22:32 ` [PATCH 4/4] Revert "tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's"" James Bottomley
2020-09-30  2:40   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200930024015.GK808399@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).