linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jgg@ziepe.ca (Jason Gunthorpe)
To: linux-security-module@vger.kernel.org
Subject: [PATCH 1/2 v2] tpm: cmd_ready command can be issued only after granting locality
Date: Sun, 28 Jan 2018 13:15:59 -0700	[thread overview]
Message-ID: <20180128201559.GG23869@ziepe.ca> (raw)
In-Reply-To: <20180128075101.6883-2-tomas.winkler@intel.com>

On Sun, Jan 28, 2018 at 09:51:00AM +0200, Tomas Winkler wrote:

> diff --git a/include/linux/tpm.h b/include/linux/tpm.h
> index bcdd3790e94d..06639fb6ab85 100644
> +++ b/include/linux/tpm.h
> @@ -44,7 +44,7 @@ struct tpm_class_ops {
>  	bool (*update_timeouts)(struct tpm_chip *chip,
>  				unsigned long *timeout_cap);
>  	int (*request_locality)(struct tpm_chip *chip, int loc);
> -	void (*relinquish_locality)(struct tpm_chip *chip, int loc);
> +	int (*relinquish_locality)(struct tpm_chip *chip, int loc);

This seems wrong.. What is the core code supposed to do if relinquish
fails?

Just returning an error code from transmit doesn't really do anything
helpful from a broad subsytem perspective.

I think if a driver can fail reliquish then it needs some kind of
strategy to recover.

Suggest trying the reliquish again on every next request until
success, otherwise fail request locality, potentially permanently.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-01-28 20:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28  7:50 [PATCH 0/2] tpm: fix locality and power saving handling Tomas Winkler
2018-01-28  7:51 ` [PATCH 1/2 v2] tpm: cmd_ready command can be issued only after granting locality Tomas Winkler
2018-01-28 20:15   ` Jason Gunthorpe [this message]
2018-01-28 21:17     ` Winkler, Tomas
2018-01-29 17:57       ` Jason Gunthorpe
2018-01-29 19:40         ` Winkler, Tomas
2018-02-06 20:02       ` Jarkko Sakkinen
2018-02-06 21:26         ` Winkler, Tomas
2018-02-08 12:44           ` Jarkko Sakkinen
2018-02-08 12:46             ` Winkler, Tomas
2018-01-28  7:51 ` [PATCH 2/2 v2] tpm: separate cmd_ready/go_idle from runtime_pm Tomas Winkler
2018-02-06 20:04   ` 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=20180128201559.GG23869@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=linux-security-module@vger.kernel.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 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).