From: Samuel Holland <samuel.holland@sifive.com>
To: Eric Chan <ericchancf@google.com>,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/4] riscv/barrier: Consolidate fence definitions
Date: Tue, 13 Feb 2024 15:31:10 -0600 [thread overview]
Message-ID: <2d4d939d-4b49-44d7-8405-e075de844884@sifive.com> (raw)
In-Reply-To: <20240213201210.2549488-1-ericchancf@google.com>
Hi Eric,
On 2024-02-13 2:12 PM, Eric Chan wrote:
> Disparate fence implementations are consolidated into fence.h.
> Also introduce RISCV_FENCE_ASM to make fence macro more reusable.
>
> Signed-off-by: Eric Chan <ericchancf@google.com>
> ---
> v3 -> v4: fix the form that can pass the checking of checkpatch.pl.
> arch/riscv/include/asm/atomic.h | 8 ++------
> arch/riscv/include/asm/barrier.h | 3 +--
> arch/riscv/include/asm/cmpxchg.h | 1 -
> arch/riscv/include/asm/fence.h | 10 +++++++---
> arch/riscv/include/asm/io.h | 8 ++++----
> arch/riscv/include/asm/mmio.h | 5 +++--
> arch/riscv/include/asm/mmiowb.h | 2 +-
> 7 files changed, 18 insertions(+), 19 deletions(-)
>
> diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h
> index 31e6e2e7cc18..19050d13b6c1 100644
> --- a/arch/riscv/include/asm/atomic.h
> +++ b/arch/riscv/include/asm/atomic.h
> @@ -17,13 +17,9 @@
> #endif
>
> #include <asm/cmpxchg.h>
> -#include <asm/barrier.h>
>
> -#define __atomic_acquire_fence() \
> - __asm__ __volatile__(RISCV_ACQUIRE_BARRIER "" ::: "memory")
> -
> -#define __atomic_release_fence() \
> - __asm__ __volatile__(RISCV_RELEASE_BARRIER "" ::: "memory");
> +#define __atomic_acquire_fence() RISCV_FENCE(r, rw)
> +#define __atomic_release_fence() RISCV_FENCE(rw, r)
This change removes the omit-the-fence-on-uniprocessor optimization, like you
added some instances of in your previous patch. Should we keep this optimization?
Regards,
Samuel
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2024-02-13 21:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 20:09 [PATCH v4 0/4] riscv/barrier: tidying up barrier-related macro Eric Chan
2024-02-13 20:11 ` [PATCH v4 1/4] riscv/barrier: Define __{mb,rmb,wmb} Eric Chan
2024-02-13 20:11 ` [PATCH v4 2/4] riscv/barrier: Define RISCV_FULL_BARRIER Eric Chan
2024-02-13 20:12 ` [PATCH v4 3/4] riscv/barrier: Consolidate fence definitions Eric Chan
2024-02-13 21:31 ` Samuel Holland [this message]
2024-02-13 22:43 ` Eric Chan
2024-02-13 20:12 ` [PATCH v4 4/4] riscv/barrier: Resolve checkpatch.pl error Eric Chan
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=2d4d939d-4b49-44d7-8405-e075de844884@sifive.com \
--to=samuel.holland@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=ericchancf@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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