lkml.org 
[lkml]   [2017]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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 !

Alan

\
 
 \ /
  Last update: 2017-06-12 01:33    [W:0.128 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site