Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1661587

RE: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems

From "Shaikh, Azhar" <azhar.shaikh@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems
Date 2017-06-08 21:10 +0200
Message-ID <tQaYG-8eD-19@gated-at.bofh.it> (permalink)
References <tNKci-2Ja-29@gated-at.bofh.it> <tPQGB-3BE-5@gated-at.bofh.it> <tPQZX-3HZ-1@gated-at.bofh.it> <tPUhb-5VG-3@gated-at.bofh.it> <tQalY-7K4-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



> -----Original Message-----
> From: Alan Cox [mailto:gnomes@lxorguk.ukuu.org.uk]
> Sent: Thursday, June 8, 2017 11:23 AM
> To: Shaikh, Azhar <azhar.shaikh@intel.com>
> Cc: jarkko.sakkinen@linux.intel.com; jgunthorpe@obsidianresearch.com;
> tpmdd-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org; linux-
> security-module@vger.kernel.org
> Subject: Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems
> 
> > > > +	outb(0x80, 0xCC);
> > > > +
> > > > +	/* Make sure the above write is completed */
> > > > +	wmb();
> > >
> > > Why the wmb(). It doesn't do what the comment says! Also this code
> > > is x86 specific
> > >
> > >
> >
> > Memory barrier to enforce the order so that the outb() is completed,
> which ensures that the LPC clocks are running before sending any TPM
> command.
> 
> wmb() doesn't do that. It merely ensures that the write has been posted to
> the fabric. If as I suspect your LPC bus implements outb() as a non-posted
> write you don't need the wmb(). If it doesn't then you need to issue
> whatever access is needed to the fabric to ensure the post completed (eg for
> PCI if you do an MMIO write you must do an MMIO read from the same
> devfn).
> 
> Secondly outb(0x80, 0xCC) doesn't write 0xCC to port 0x80. It writes 0x80 to
> port 0xCC !
> 

Oops my bad! I got that reversed. Will change it.

> Alan

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Azhar Shaikh <azhar.shaikh@intel.com> - 2017-06-07 23:30 +0200
  Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-06-07 23:50 +0200
    RE: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems "Shaikh, Azhar" <azhar.shaikh@intel.com> - 2017-06-08 03:20 +0200
      Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-08 14:40 +0200
      Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-06-08 20:30 +0200
        Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-06-08 20:40 +0200
          Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-06-08 21:00 +0200
            RE: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems "Shaikh, Azhar" <azhar.shaikh@intel.com> - 2017-06-08 21:30 +0200
          Re: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-10 13:10 +0200
        RE: [PATCH v3] tpm: Enable CLKRUN protocol for Braswell systems "Shaikh, Azhar" <azhar.shaikh@intel.com> - 2017-06-08 21:10 +0200

csiph-web