[PATCH] lib: sbi: Order the publication of IPI device nodes
Anup Patel
anup at brainfault.org
Sun Nov 15 19:57:16 PST 2026
On Mon, Nov 16, 2026 at 7:49 AM Nickolai Zeldovich
<nickolai at csail.mit.edu> wrote:
>
> On Wed, Nov 4, 2026 at 1:21 AM Anup Patel <anup at brainfault.org> wrote:
> > This looks unmaintainable.
> >
> > Why not introduce read-write spinlock and use that to
> > protect ipi_dev_node_list ? Basically, sbi_ipi_add_device()
> > will take write-lock whereas sbi_ipi_raw_clear() and
> > sbi_ipi_raw_send() will take read-lock.
>
> Fair enough; I was wrongly assuming the code was written lock-free on
> purpose. Do you think it's worth adding a rwlock implementation to
> OpenSBI for this? Alternatively, it would be easy to grab a regular
> spinlock in the relevant functions.'
In addition to IPIs, there are other areas in OpenSBI which can
benefit from rwlocks so I think we should definetly have rwlock
implementation in OpenSBI where:
1) read_lock() only spins if someone has taken write lock
2) write_lock() spins if someone has taken read/write lock
Regards,
Anup
More information about the opensbi
mailing list