All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net,
	Debora Velarde <debora@linux.vnet.ibm.com>,
	Marcel Selhorst <m.selhorst@sirrix.com>,
	James Morris <jmorris@namei.org>,
	Jan Beulich <jbeulich@novell.com>,
	adi@vmware.com
Subject: Re: [PATCH] TPM: Fixup boot probe timeout for tpm_tis driver
Date: Wed, 09 Sep 2009 22:14:27 -0300	[thread overview]
Message-ID: <1252545267.4837.62.camel@blackbox> (raw)
In-Reply-To: <20090909232218.GK406@obsidianresearch.com>

Andy Isaacson sent this a while ago in a patchset, I think I lost track
of it in the middle of the other patches, sorry. In any case, ACK.

http://marc.info/?l=linux-kernel&m=124650185023490&w=2

Thanks,
Rajiv 

On Wed, 2009-09-09 at 17:22 -0600, Jason Gunthorpe wrote:
> When probing the device in tpm_tis_init the call request_locality
> uses timeout_a, which wasn't being initalized until after
> request_locality. This results in request_locality falsely timing
> out if the chip is still starting. Move the initialization to before
> request_locality.
> 
> This probably only matters for embedded cases (ie mine), a BIOS likely
> gets the TPM into a state where this code path isn't necessary.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  drivers/char/tpm/tpm_tis.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 241b5ae..c1e5ab8 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -450,6 +450,12 @@ static int tpm_tis_init(struct device *dev, u32 start,
>  		goto out_err;
>  	}
> 
> +	/* Default timeouts */
> +	chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> +	chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
> +	chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> +	chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> +
>  	if (request_locality(chip, 0) != 0) {
>  		rc = -ENODEV;
>  		goto out_err;
> @@ -457,12 +463,6 @@ static int tpm_tis_init(struct device *dev, u32 start,
> 
>  	vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
> 
> -	/* Default timeouts */
> -	chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> -	chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
> -	chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> -	chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
> -
>  	dev_info(dev,
>  		 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
>  		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));


  reply	other threads:[~2009-09-10  1:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 23:22 [PATCH] TPM: Fixup boot probe timeout for tpm_tis driver Jason Gunthorpe
2009-09-10  1:14 ` Rajiv Andrade [this message]
2009-09-10  9:21   ` James Morris
2009-09-10 19:27     ` Jason Gunthorpe

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=1252545267.4837.62.camel@blackbox \
    --to=srajiv@linux.vnet.ibm.com \
    --cc=adi@vmware.com \
    --cc=debora@linux.vnet.ibm.com \
    --cc=jbeulich@novell.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.selhorst@sirrix.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /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.