public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Mark Hasemeyer <markhas@chromium.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Peter Huewe <peterhuewe@gmx.de>,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: cr50: i2c: use jiffies to wait for tpm ready irq
Date: Sun, 19 Mar 2023 15:36:39 +0200	[thread overview]
Message-ID: <20230319133639.s3isrd35ul4ldiof@kernel.org> (raw)
In-Reply-To: <20230314135400.1.I5561dfbc4438418281626e43e345e8acc879cd7c@changeid>

On Tue, Mar 14, 2023 at 01:54:04PM -0600, Mark Hasemeyer wrote:
> When waiting for a tpm ready completion, the cr50 i2c driver incorrectly
> assumes that the value of timeout_a is represented in milliseconds
> instead of jiffies.
> 
> Remove the msecs_to_jiffies conversion.
> 
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
> 
>  drivers/char/tpm/tpm_tis_i2c_cr50.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> index 77cea5b31c6e4..376ae18a04ebb 100644
> --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
> +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> @@ -100,8 +100,7 @@ static int tpm_cr50_i2c_wait_tpm_ready(struct tpm_chip *chip)
>  	}
>  
>  	/* Wait for interrupt to indicate TPM is ready to respond */
> -	if (!wait_for_completion_timeout(&priv->tpm_ready,
> -					 msecs_to_jiffies(chip->timeout_a))) {
> +	if (!wait_for_completion_timeout(&priv->tpm_ready, chip->timeout_a)) {
>  		dev_warn(&chip->dev, "Timeout waiting for TPM ready\n");
>  		return -ETIMEDOUT;
>  	}
> -- 
> 2.40.0.rc2.332.ga46443480c-goog
> 

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

BR, Jarkko

      reply	other threads:[~2023-03-19 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 19:54 [PATCH] tpm: cr50: i2c: use jiffies to wait for tpm ready irq Mark Hasemeyer
2023-03-19 13:36 ` Jarkko Sakkinen [this message]

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=20230319133639.s3isrd35ul4ldiof@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markhas@chromium.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