linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: jmorris@namei.org
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, eparis@redhat.com
Subject: Re: [PATCH] TPM: Long default timeout fix
Date: Thu, 20 Jan 2011 15:46:03 +0100	[thread overview]
Message-ID: <20110120154603.2bdf5d9b@alice> (raw)
In-Reply-To: <1289596730-28966-1-git-send-email-srajiv@linux.vnet.ibm.com>

James,

what is the status of this patch from Rajiv? It has been in Fedora
kernels for some time, but I do not see it applied upstream:

On Fri, 12 Nov 2010 19:18:50 -0200 Rajiv Andrade wrote:
> If duration variable value is 0 at this point, it's because
> chip->vendor.duration wasn't filled by tpm_get_timeouts() yet.
> This patch sets then the lowest timeout just to give enough
> time for tpm_get_timeouts() to further succeed.
> 
> This fix avoids long boot times in case another entity attempts
> to send commands to the TPM when the TPM isn't accessible.
> 
> Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
> ---
>  drivers/char/tpm/tpm.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
> index 7c41335..5635ac0 100644
> --- a/drivers/char/tpm/tpm.c
> +++ b/drivers/char/tpm/tpm.c
> @@ -364,12 +364,14 @@ unsigned long tpm_calc_ordinal_duration(struct
> tpm_chip *chip, tpm_protected_ordinal_duration[ordinal &
>  						   TPM_PROTECTED_ORDINAL_MASK];
>  
> -	if (duration_idx != TPM_UNDEFINED)
> +	if (duration_idx != TPM_UNDEFINED) {
>  		duration = chip->vendor.duration[duration_idx];
> -	if (duration <= 0)
> +		/* if duration is 0, it's because
> chip->vendor.duration wasn't */
> +		/* filled yet, so we set the lowest timeout just to
> give enough */
> +		/* time for tpm_get_timeouts() to succeed */
> +		return (duration <= 0 ? HZ : duration);
> +	} else 
>  		return 2 * 60 * HZ;
> -	else
> -		return duration;
>  }
>  EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
>  

  reply	other threads:[~2011-01-20 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 21:18 [PATCH] TPM: Long default timeout fix Rajiv Andrade
2011-01-20 14:46 ` Michal Schmidt [this message]
2011-01-20 22:59   ` James Morris
2011-01-24  0:24   ` James Morris

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=20110120154603.2bdf5d9b@alice \
    --to=mschmidt@redhat.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srajiv@linux.vnet.ibm.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 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).