linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Burton <paulburton@kernel.org>
To: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: paulburton@kernel.org, linux-mips@vger.kernel.org
Cc: chris.packham@alliedtelesis.co.nz, linux-kernel@vger.kernel.org,
	Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: linux-mips@vger.kernel.org
Subject: Re: [PATCH] MIPS: cavium_octeon: Fix syncw generation.
Date: Sat, 15 Feb 2020 14:55:58 -0800	[thread overview]
Message-ID: <5e4876ff.1c69fb81.7b887.cb6e@mx.google.com> (raw)
In-Reply-To: <20200211212455.3307-1-mark.tomlinson@alliedtelesis.co.nz>

Hello,

Mark Tomlinson wrote:
> 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 '-'.

Applied to mips-fixes.

> commit 97e914b7de3c
> https://git.kernel.org/mips/c/97e914b7de3c
> 
> 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>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]

  parent reply	other threads:[~2020-02-15 22:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 21:24 [PATCH] MIPS: cavium_octeon: Fix syncw generation Mark Tomlinson
2020-02-11 21:37 ` Chris Packham
2020-02-15 22:55 ` Paul Burton [this message]
2020-02-17  0:22 ` Philippe Mathieu-Daudé
2020-02-17  4:58   ` Mark Tomlinson
2020-02-17 20:01     ` Chris Packham
2020-02-18 18:37       ` Nick Desaulniers
2020-02-20 15:28         ` Dmitry Golovin

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=5e4876ff.1c69fb81.7b887.cb6e@mx.google.com \
    --to=paulburton@kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mark.tomlinson@alliedtelesis.co.nz \
    /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;
as well as URLs for NNTP newsgroup(s).