All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Jiri Slaby <jirislaby@gmail.com>,
	stefanb@linux.vnet.ibm.com,
	linux-pm <linux-pm@lists.linux-foundation.org>,
	stable@kernel.org,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	debora@linux.vnet.ibm.com,
	Linus Torvalds <torvalds@linux-foundation.org>,
	preining@logic.at
Subject: Re: 2.6.37.1 s2disk regression (TPM)
Date: Mon, 21 Feb 2011 12:30:41 -0300	[thread overview]
Message-ID: <4D628521.8000205@linux.vnet.ibm.com> (raw)
In-Reply-To: <201102201248.10779.rjw@sisk.pl>

On 02/20/2011 08:48 AM, Rafael J. Wysocki wrote:

> On Sunday, February 20, 2011, Rafael J. Wysocki wrote:
>> No, and the author and maintainer have not been responding.  If that contiunes,I'll simply ask Linus to revert it.
Sorry, but you sent the email this Friday, I didn't catch it in time and I wasn't working during the weekend.

> BTW, the first hunk from that commit in drivers/char/tpm/tpm.c seems to be
> completely broken:
>
> @@ -577,9 +577,11 @@ duration:
>          if (rc)
>                  return;
>
> -       if (be32_to_cpu(tpm_cmd.header.out.return_code)
> -           != 3 * sizeof(u32))
> +       if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
> +           be32_to_cpu(tpm_cmd.header.out.length)
> +           != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32))
>                  return;
> +
>          duration_cap =&tpm_cmd.params.getcap_out.cap.duration;
>          chip->vendor.duration[TPM_SHORT] =
>              usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short));
>
> Namely, either the old code always returned as a result of the conditional
> being removed, or the new code will always return as a result of
> the (... != 0) check.  I wonder if there's supposed to be (... == 0) instead?
The previous code was checking the wrong field of the TPM returned buffer, probably
due an old commit that incorporated the tpm_cmd strucuture, it should check if the return code
is != 0, which if true, means that the command didn't succeed. The output length check should be
just a sanity check, so indeed the logical operator should be&&  instead. Although it should also be
fixed, I don't think this is the cause, since in case the timeout retrieval from the TPM fail,
the device driver falls back to default values, which has been working before this commit.

> [And why not to simply use 4*sizeof(u32) FWIW?]
I can't see why, I'll update it.

The failure for this specific board then sounds to be due the TPM returning inconsistent timeout values.
Norbert, can 'cat /sys/devices/pnp0/00\:0*/timeouts' and send the output?

Rajiv



  reply	other threads:[~2011-02-21 15:30 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 10:13 2.6.37.1 s2disk regression (TPM) Jiri Slaby
2011-02-20 10:44 ` Rafael J. Wysocki
2011-02-20 10:44 ` Rafael J. Wysocki
2011-02-20 10:46   ` Jiri Slaby
2011-02-20 10:46   ` Jiri Slaby
2011-02-20 10:51     ` Rafael J. Wysocki
2011-02-20 10:57       ` [REVERT request stable-2.6.36/37] " Jiri Slaby
2011-02-20 16:50         ` [stable] " Greg KH
2011-02-20 16:50         ` Greg KH
2011-02-20 10:57       ` Jiri Slaby
2011-02-20 11:48       ` Rafael J. Wysocki
2011-02-21 15:30         ` Rajiv Andrade [this message]
2011-02-21 16:34           ` Jiri Slaby
2011-02-21 16:57             ` Linus Torvalds
2011-02-21 16:57             ` Linus Torvalds
2011-02-21 17:12             ` Rajiv Andrade
2011-02-21 17:12             ` Rajiv Andrade
2011-02-21 20:39               ` Jiri Slaby
2011-02-21 20:39               ` Jiri Slaby
2011-02-21 21:29                 ` Stefan Berger
2011-02-21 21:44                   ` Jiri Slaby
2011-02-21 22:07                     ` Rajiv Andrade
2011-02-21 22:07                     ` Rajiv Andrade
2011-02-21 22:10                       ` Jiri Slaby
2011-02-21 22:10                       ` Jiri Slaby
2011-02-21 22:17                         ` Rafael J. Wysocki
2011-02-21 22:17                         ` Rafael J. Wysocki
2011-02-22  0:42                         ` Stefan Berger
2011-02-22  0:42                         ` Stefan Berger
2011-02-22  8:41                           ` Jiri Slaby
2011-02-22 11:57                             ` Stefan Berger
2011-02-22 11:57                             ` Stefan Berger
2011-02-22 17:39                               ` Jiri Slaby
2011-02-22 17:39                               ` Jiri Slaby
2011-02-22  8:41                           ` Jiri Slaby
2011-02-21 21:44                   ` Jiri Slaby
2011-02-21 21:29                 ` Stefan Berger
2011-02-21 16:34           ` Jiri Slaby
2011-02-22  5:39           ` Norbert Preining
2011-02-22  5:39           ` Norbert Preining
2011-02-22  8:42             ` Jiri Slaby
2011-02-22  9:13               ` Norbert Preining
2011-02-22  9:13               ` Norbert Preining
2011-02-22  8:42             ` Jiri Slaby
2011-02-21 15:30         ` Rajiv Andrade
2011-02-20 11:48       ` Rafael J. Wysocki
2011-02-20 10:51     ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2011-02-20 10:13 Jiri Slaby

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=4D628521.8000205@linux.vnet.ibm.com \
    --to=srajiv@linux.vnet.ibm.com \
    --cc=debora@linux.vnet.ibm.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=preining@logic.at \
    --cc=rjw@sisk.pl \
    --cc=stable@kernel.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /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.