From: Wilken Gottwalt <wilken.gottwalt@posteo.net>
To: Indrek Kruusa <indrek.kruusa@gmail.com>
Cc: Nguyen Minh Tien <tien.nguyenminh@embeddedlinux.blog>,
Bjorn Andersson <andersson@kernel.org>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
linux-remoteproc@vger.kernel.org, linux-sunxi@lists.linux.dev,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] hwspinlock: sun6i: Allwinner D1 and T113 support
Date: Thu, 22 Oct 2026 19:19:54 +0000 [thread overview]
Message-ID: <20261022211952.7293f8b6@posteo.net> (raw)
In-Reply-To: <20261022190203.1998156-1-indrek.kruusa@gmail.com>
On Thu, 22 Oct 2026 22:01:15 +0300
Indrek Kruusa <indrek.kruusa@gmail.com> wrote:
> Hi,
>
> I managed to run this patch series on a Sipeed Lichee RV Dock (Allwinner D1),
> in this setup:
>
> - FreeRTOS on the HiFi4 DSP, running a task that contends for the lock
> - a test kernel module touching the same shared memory, with and without
> taking the lock
>
> The series is applied on top of v7.3-rc7.
>
> What I ran:
>
> - probe: 3005000.hwlock binds and the driver reports 32 locks
>
> - mutual exclusion: lock 0, taken alternately by the C906 and the HiFi4.
> Each side added 1 to a shared counter under the lock, 1,000,000 times:
>
> counter=2000000 expected=2000000 -> EXACT
> tripwire linux=0 dsp=0 -> no overlap
>
> A tripwire field is set while inside the critical section and read by the
> other side, so overlap is caught independently of the counter.
>
> - negative control, identical loop with the lock not taken:
>
> counter=1885761 expected=2000000 -> LOST UPDATES (5.7% lost)
> tripwire linux=100302 dsp=674915 -> OVERLAP DETECTED
>
> The loss rate in the negative control varies between runs (5-19% observed);
> the log linked below is one sample.
>
> Tested-by: Indrek Kruusa <indrek.kruusa@gmail.com>
>
> I put this test setup together with AI assistance. Sources, build
> instructions, ready-to-use images (DSP firmware included) for the RV Dock
> and for the Nezha (untested), and the captured console logs are here:
>
> https://github.com/ikruusa/d1-hwspinlock-test
Just out of curiousity, did you also had the impression, that the spinlocks
are quite slow? I did quite similar tests back then using a H5 SoC.
https://lore.kernel.org/lkml/cover.1615713499.git.wilken.gottwalt@posteo.net/T/
greetings,
Wilken
WARNING: multiple messages have this Message-ID (diff)
From: Wilken Gottwalt <wilken.gottwalt@posteo.net>
To: Indrek Kruusa <indrek.kruusa@gmail.com>
Cc: Nguyen Minh Tien <tien.nguyenminh@embeddedlinux.blog>,
Bjorn Andersson <andersson@kernel.org>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
linux-remoteproc@vger.kernel.org, linux-sunxi@lists.linux.dev,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] hwspinlock: sun6i: Allwinner D1 and T113 support
Date: Thu, 22 Oct 2026 19:19:54 +0000 [thread overview]
Message-ID: <20261022211952.7293f8b6@posteo.net> (raw)
In-Reply-To: <20261022190203.1998156-1-indrek.kruusa@gmail.com>
On Thu, 22 Oct 2026 22:01:15 +0300
Indrek Kruusa <indrek.kruusa@gmail.com> wrote:
> Hi,
>
> I managed to run this patch series on a Sipeed Lichee RV Dock (Allwinner D1),
> in this setup:
>
> - FreeRTOS on the HiFi4 DSP, running a task that contends for the lock
> - a test kernel module touching the same shared memory, with and without
> taking the lock
>
> The series is applied on top of v7.3-rc7.
>
> What I ran:
>
> - probe: 3005000.hwlock binds and the driver reports 32 locks
>
> - mutual exclusion: lock 0, taken alternately by the C906 and the HiFi4.
> Each side added 1 to a shared counter under the lock, 1,000,000 times:
>
> counter=2000000 expected=2000000 -> EXACT
> tripwire linux=0 dsp=0 -> no overlap
>
> A tripwire field is set while inside the critical section and read by the
> other side, so overlap is caught independently of the counter.
>
> - negative control, identical loop with the lock not taken:
>
> counter=1885761 expected=2000000 -> LOST UPDATES (5.7% lost)
> tripwire linux=100302 dsp=674915 -> OVERLAP DETECTED
>
> The loss rate in the negative control varies between runs (5-19% observed);
> the log linked below is one sample.
>
> Tested-by: Indrek Kruusa <indrek.kruusa@gmail.com>
>
> I put this test setup together with AI assistance. Sources, build
> instructions, ready-to-use images (DSP firmware included) for the RV Dock
> and for the Nezha (untested), and the captured console logs are here:
>
> https://github.com/ikruusa/d1-hwspinlock-test
Just out of curiousity, did you also had the impression, that the spinlocks
are quite slow? I did quite similar tests back then using a H5 SoC.
https://lore.kernel.org/lkml/cover.1615713499.git.wilken.gottwalt@posteo.net/T/
greetings,
Wilken
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-10-22 19:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 2:56 [PATCH 0/3] hwspinlock: sun6i: Allwinner D1 and T113 support Nguyen Minh Tien
2026-09-27 2:56 ` Nguyen Minh Tien
2026-09-27 2:56 ` [PATCH 1/3] hwspinlock: sun6i: Get the clock and the reset without names Nguyen Minh Tien
2026-09-27 2:56 ` Nguyen Minh Tien
2026-09-27 2:56 ` [PATCH 2/3] dt-bindings: hwlock: sun6i: Add compatible for Allwinner D1 Nguyen Minh Tien
2026-09-27 2:56 ` Nguyen Minh Tien
2026-09-28 16:51 ` Conor Dooley
2026-09-28 16:51 ` Conor Dooley
2026-09-27 2:56 ` [PATCH 3/3] riscv: dts: allwinner: d1-t113: Add the hardware spinlock Nguyen Minh Tien
2026-09-27 2:56 ` Nguyen Minh Tien
2026-09-27 11:27 ` Wilken Gottwalt
2026-09-27 11:27 ` Wilken Gottwalt
2026-09-30 13:02 ` Nguyen Minh Tien
2026-09-30 13:02 ` Nguyen Minh Tien
2026-09-30 14:05 ` Wilken Gottwalt
2026-09-30 14:05 ` Wilken Gottwalt
2026-10-02 7:32 ` Conor Dooley
2026-10-02 7:32 ` Conor Dooley
2026-10-02 7:48 ` Wilken Gottwalt
2026-10-02 7:48 ` Wilken Gottwalt
2026-10-02 7:50 ` Chen-Yu Tsai
2026-10-02 7:50 ` Chen-Yu Tsai
2026-10-02 8:37 ` Conor Dooley
2026-10-02 8:37 ` Conor Dooley
2026-10-02 7:48 ` Chen-Yu Tsai
2026-10-02 7:48 ` Chen-Yu Tsai
2026-10-22 19:01 ` [PATCH 0/3] hwspinlock: sun6i: Allwinner D1 and T113 support Indrek Kruusa
2026-10-22 19:01 ` Indrek Kruusa
2026-10-22 19:19 ` Wilken Gottwalt [this message]
2026-10-22 19:19 ` Wilken Gottwalt
2026-10-22 19:54 ` Indrek Kruusa
2026-10-22 19:54 ` Indrek Kruusa
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=20261022211952.7293f8b6@posteo.net \
--to=wilken.gottwalt@posteo.net \
--cc=andersson@kernel.org \
--cc=indrek.kruusa@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=tien.nguyenminh@embeddedlinux.blog \
--cc=wens@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.