public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Shaikh, Azhar" <azhar.shaikh@intel.com>
Cc: "Sakkinen, Jarkko" <jarkko.sakkinen@intel.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>
Subject: Re: [PATCH RFC] tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd()
Date: Mon, 6 Nov 2017 15:39:32 -0700	[thread overview]
Message-ID: <20171106223932.GA21466@ziepe.ca> (raw)
In-Reply-To: <5FFFAD06ADE1CA4381B3F0F7C6AF582896ADAB@ORSMSX109.amr.corp.intel.com>

On Mon, Nov 06, 2017 at 10:11:39PM +0000, Shaikh, Azhar wrote:

> >Why are you using a mixture of callbacks and linked functions to
> >solve this problem?
> >
> >Can't you do everything with callbacks?
> >
> 
> I have set the flag TPM_TIS_CLK_ENABLE in the callback. But then in
> tpm_platform_begin_xfer() I want it to run once to disable clkrun
> and then return for all other instances, till the the flag is
> cleared.  If I just set the flag in tpm_tis_clkrun_toggle(), then
> for any TPM transaction after that the clkrun will not be disabled
> with current implementation. Hence calling it once before setting
> the flag so that it is kept enabled for the next transaction.

I mean, why do we have global functions called tpm_platform_begin_xfer
at all, everything should be in a callback, not some mixture.

The static function sort of made sense when it was only ever called by
the tis driver, but now that you are hoisting things up a layer it is
not okay anymore, you need to add new driver callbacks instead.

> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -140,6 +140,7 @@ static int check_acpi_tpm2(struct device *dev)
>  #define LPC_CLKRUN_EN                   (1 << 2)
> 
>  static void __iomem *ilb_base_addr;
> +static bool run_once;

No global statics. The ilb_base_addr global is really ugly you should
move it to struct tpm_tis_tcg_phy

Jason

  reply	other threads:[~2017-11-06 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 23:30 [PATCH RFC] tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd() Azhar Shaikh
2017-11-06 17:07 ` Jason Gunthorpe
2017-11-06 22:11   ` Shaikh, Azhar
2017-11-06 22:39     ` Jason Gunthorpe [this message]
2017-11-06 23:31       ` Shaikh, Azhar

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=20171106223932.GA21466@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=azhar.shaikh@intel.com \
    --cc=jarkko.sakkinen@intel.com \
    --cc=linux-integrity@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