Mark Tomlinson 97e914b7de
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
2020-02-15 12:44:03 -08:00
..
2019-07-06 10:32:12 -07:00
2019-07-30 10:41:54 -07:00
2020-01-09 09:48:42 -08:00
2019-11-01 14:36:44 -07:00
2019-10-31 15:03:10 -07:00
2020-01-22 15:56:08 -08:00
2019-11-27 10:27:45 -08:00
2020-01-22 15:56:08 -08:00
2019-05-22 18:45:52 -07:00
2020-02-04 11:58:07 +00:00
2020-01-22 15:56:08 -08:00
2019-02-04 10:56:41 -08:00
2019-02-04 10:56:41 -08:00
2019-07-12 15:13:55 -07:00
2020-02-04 03:05:24 +00:00
2019-10-31 15:03:10 -07:00
2019-07-01 17:51:40 +02:00
2019-10-31 15:03:10 -07:00
2018-08-01 13:20:15 -07:00
2019-04-03 10:32:54 +02:00
2019-10-02 14:06:41 -07:00
2019-07-25 21:45:05 -07:00