All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Chen Jun <chenjun102@huawei.com>,
	linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, rui.xiang@huawei.com
Subject: Re: [PATCH v2 1/1] tpm: add request_locality before write TPM_INT_ENABLE
Date: Thu, 14 Oct 2021 03:00:09 +0300	[thread overview]
Message-ID: <035231e191d757cb8edd1c060067b6e19ddf43ea.camel@kernel.org> (raw)
In-Reply-To: <20211013062556.116504-1-chenjun102@huawei.com>

On Wed, 2021-10-13 at 06:25 +0000, Chen Jun wrote:
> Locality is not appropriately requested before writing the int mask.
> Add the missing boilerplate.
> 
> Fixes: e6aef069b6e9 ("tpm_tis: convert to using locality callbacks")
> Signed-off-by: Chen Jun <chenjun102@huawei.com>
> ---
> 
>  v2: rewrite the commit message.
> 
>  drivers/char/tpm/tpm_tis_core.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> index 69579efb247b..bea587301917 100644
> --- a/drivers/char/tpm/tpm_tis_core.c
> +++ b/drivers/char/tpm/tpm_tis_core.c
> @@ -978,7 +978,15 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
>         intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
>                    TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
>         intmask &= ~TPM_GLOBAL_INT_ENABLE;
> +
> +       rc = request_locality(chip, 0);
> +       if (rc < 0) {
> +               rc = -ENODEV;
> +               goto out_err;
> +       }
> +
>         tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask);
> +       release_locality(chip, 0);
>  
>         rc = tpm_chip_start(chip);
>         if (rc)

Thank you.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

/Jarkko


  reply	other threads:[~2021-10-14  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  6:25 [PATCH v2 1/1] tpm: add request_locality before write TPM_INT_ENABLE Chen Jun
2021-10-14  0:00 ` Jarkko Sakkinen [this message]
2021-10-26  2:14 ` Jarkko Sakkinen
  -- strict thread matches above, loose matches on Subject: below --
2021-10-12 12:48 Chen Jun
2021-10-12 17:34 ` 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=035231e191d757cb8edd1c060067b6e19ddf43ea.camel@kernel.org \
    --to=jarkko@kernel.org \
    --cc=chenjun102@huawei.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=rui.xiang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.