openrisc.lists.librecores.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH V2 1/5] asm-generic: ticket-lock: New generic ticket-based spinlock
Date: Sat, 19 Mar 2022 12:52:09 +0100	[thread overview]
Message-ID: <CAK8P3a3wMJv6-fGo_i4DnFMigj=ko4DN1XTe8oa1HzWLiX50yw@mail.gmail.com> (raw)
In-Reply-To: <20220319035457.2214979-2-guoren@kernel.org>

On Sat, Mar 19, 2022 at 4:54 AM <guoren@kernel.org> wrote:
>  /*
> - * You need to implement asm/spinlock.h for SMP support. The generic
> - * version does not handle SMP.
> + * Using ticket-spinlock.h as generic for SMP support.
>   */
>  #ifdef CONFIG_SMP
> -#error need an architecture specific asm/spinlock.h
> +#include <asm-generic/ticket-lock.h>
> +#ifdef CONFIG_QUEUED_RWLOCKS
> +#include <asm-generic/qrwlock.h>
> +#else
> +#error Please select ARCH_USE_QUEUED_RWLOCKS in architecture Kconfig
> +#endif
>  #endif

There is no need for the !CONFIG_SMP case, as asm/spinlock.h only ever
gets included for SMP builds in the first place. This was already a mistake
in the existing code, but your change would be the time to fix it.

I would also drop the !CONFIG_QUEUED_RWLOCKS case, just include
it unconditionally. If any architecture wants the ticket spinlock in
combination with a custom rwlock, they can simply include the
asm-generic/ticket-lock.h from their asm/spinlock.h, but more
likely any architecture that can use the ticket spinlock will also
want the qrwlock anyway.

     Arnd

  reply	other threads:[~2022-03-19 11:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-19  3:54 [OpenRISC] [PATCH V2 0/5] Generic Ticket Spinlocks guoren
2022-03-19  3:54 ` [OpenRISC] [PATCH V2 1/5] asm-generic: ticket-lock: New generic ticket-based spinlock guoren
2022-03-19 11:52   ` Arnd Bergmann [this message]
2022-03-19 13:26     ` Guo Ren
2022-03-22  3:10   ` Stafford Horne
2022-03-22 15:54     ` Waiman Long
2022-03-22 21:06       ` Stafford Horne
2022-03-22 21:14         ` Waiman Long
2022-03-22 21:24           ` Stafford Horne
2022-03-19  3:54 ` [OpenRISC] [PATCH V2 2/5] asm-generic: qspinlock: Indicate the use of mixed-size atomics guoren
2022-03-19  3:54 ` [OpenRISC] [PATCH V2 3/5] csky: Move to generic ticket-spinlock guoren
2022-03-19  3:54 ` [OpenRISC] [PATCH V2 4/5] RISC-V: Move to ticket-spinlocks & RW locks guoren
2022-03-19  3:54 ` [OpenRISC] [PATCH V2 5/5] openrisc: Move to ticket-spinlock guoren
     [not found]   ` <202203200824.EQJTy8pW-lkp@intel.com>
2022-03-20  3:05     ` Guo Ren
2022-03-20  3:36       ` Stafford Horne
2022-03-20 21:13         ` Stafford Horne
2022-03-22  5:26       ` Stafford Horne

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='CAK8P3a3wMJv6-fGo_i4DnFMigj=ko4DN1XTe8oa1HzWLiX50yw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=openrisc@lists.librecores.org \
    /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).