diff options
author | Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> | 2020-02-12 10:24:55 +1300 |
---|---|---|
committer | Paul Burton <paulburton@kernel.org> | 2020-02-15 12:44:03 -0800 |
commit | 97e914b7de3c943011779b979b8093fdc0d85722 (patch) | |
tree | fb2227ac71e85e7af279d57fb260fe0d37e11320 /arch/arm/kvm/irq.h | |
parent | 976c23af3ee5bd3447a7bfb6c356ceb4acf264a6 (diff) | |
download | linux-97e914b7de3c943011779b979b8093fdc0d85722.tar.gz linux-97e914b7de3c943011779b979b8093fdc0d85722.tar.bz2 linux-97e914b7de3c943011779b979b8093fdc0d85722.zip |
MIPS: cavium_octeon: Fix syncw generation.
The Cavium Octeon CPU uses a special sync instruction for implementing
wmb, and due to a CPU bug, the instruction must appear twice. A macro
had been defined to hide this:
#define __SYNC_rpt(type) (1 + (type == __SYNC_wmb))
which was intended to evaluate to 2 for __SYNC_wmb, and 1 for any other
type of sync. However, this expression is evaluated by the assembler,
and not the compiler, and the result of '==' in the assembler is 0 or
-1, not 0 or 1 as it is in C. The net result was wmb() producing no code
at all. The simple fix in this patch is to change the '+' to '-'.
Fixes: bf92927251b3 ("MIPS: barrier: Add __SYNC() infrastructure")
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/arm/kvm/irq.h')
0 files changed, 0 insertions, 0 deletions