[PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip
Troy Mitchell
troy.mitchell at linux.spacemit.com
Wed Mar 11 00:48:13 PDT 2026
On Wed Mar 11, 2026 at 3:08 PM CST, Yanko Kaneti wrote:
> On Wed, 2026-03-11 at 10:58 +0800, Troy Mitchell wrote:
>> On Wed Mar 4, 2026 at 4:38 AM CST, Aurelien Jarno wrote:
>> Hi, Aurelien and Yanko,
>> > Hi,
>> >
>> > On 2026-03-02 22:34, Yanko Kaneti wrote:
>> > > Hello,
>> > >
>> > > On Mon, 2026-03-02 at 21:08 +0100, Aurelien Jarno wrote:
>> > > > On 2026-03-01 23:16, Aurelien Jarno wrote:
>> > > > > On 2026-02-27 13:29, Yanko Kaneti wrote:
>> > > > > > On Thu, 2026-02-26 at 22:32 +0100, Aurelien Jarno wrote:
>> > > > > > > Hi,
>> > > > > > >
>> > > > > > > On 2026-02-26 16:32, Yanko Kaneti wrote:
>> > > > > > > > Hello,
>> > > > > > > >
>> > > > > > > > On Mon, 2025-11-03 at 00:02 +0100, Aurelien Jarno wrote:
>> > > > > > > > > Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.
>> > > > > > > > >
>> > > > > > > > > Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
>> > > > > > > > > ---
>> > > > > > > > > v5: no changes
>> > > > > > > > >
>> > > > > > > > > drivers/mfd/simple-mfd-i2c.c | 1 +
>> > > > > > > > > 1 file changed, 1 insertion(+)
>> > > > > > > > >
>> > > > > > > > > diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
>> > > > > > > > > index 0a607a1e3ca1d..542d378cdcd1f 100644
>> > > > > > > > > --- a/drivers/mfd/simple-mfd-i2c.c
>> > > > > > > > > +++ b/drivers/mfd/simple-mfd-i2c.c
>> > > > > > > > > @@ -99,6 +99,7 @@ static const struct regmap_config spacemit_p1_regmap_config = {
>> > > > > > > > > };
>> > > > > > > > >
>> > > > > > > > > static const struct mfd_cell spacemit_p1_cells[] = {
>> > > > > > > > > + { .name = "spacemit-p1-reboot", },
>> > > > > > > > > { .name = "spacemit-p1-regulator", },
>> > > > > > > > > { .name = "spacemit-p1-rtc", },
>> > > > > > > > > };
>> > > > > > > >
>> > > > > > > > Perhaps its safe to merge this one now that everything P1 and I2C is
>> > > > > > > > already in linus tip ?
>> > > > > > >
>> > > > > > > Unfortunately, this patchset is still missing:
>> > > > > > > https://lore.kernel.org/all/20260207-b4-k3-i2c-pio-v7-0-626942d94d91@linux.spacemit.com/
>> > > > > > >
>> > > > > > > This means the reboots work most of the time, but are not 100% reliable,
>> > > > > > > and that's the reason why this patch got blocked from merging.
>> > > > > >
>> > > > > > I see. Thanks. Sounds to me like sometimes working compared to never
>> > > > > > working is better , but anyway..
>> > > > >
>> > > > > I agree with that, but the decision was to hold on this patch until the
>> > > > > I2C PIO part got merged.
>> > > > >
>> > > > > > FWIW with this patch and the pio patcheset I get this rcu splat on
>> > > > > > reboot (which is still working). Similar splat is there without the pio
>> > > > > > patcheset.
>> > > > >
>> > > > > I haven't been able to reproduce the issue here after 10+ reboots on a
>> > > > > BPI-F3 board, but I tried the patch on top of 6.19. I'll try to build a
>> > > > > 7.0.0-rc2 kernel and report back.
>> > > >
>> > > > I have tried that, and I am still unable to reproduce the issue with a
>> > > > 7.0.0-rc2 kernel and a BPI-F3 board.
>> > >
>> > > I can still see it on every reboot (with the patches that allow reboot
>> > > to work). Do you have CONFIG_PREEMPT_RCU in your config ? its default on
>> > > when anything PREEMPT is selected. In Fedora its CONFIG_PREEMPT_DYNAMIC
>> > > that flips it.
>> >
>> > Thanks for the hint, that option was not activated here, it's not the
>> > riscv64 defconfig. With it I am also able to reproduce the issue. I'll
>> > try to debug that and report back.
>> I have sent a patch to address this issue here[1].
>>
>> Could you please test it on your hardware when you have a chance?
>>
>> - Troy
>>
>> Link:
>> https://lore.kernel.org/all/20260311-v7-0-rc1-rv-dis-int-before-restart-v1-1-bc46b4351cac@linux.dev/ [1]
>
> Thanks Troy. Seem to fix the issue here.
> No splat and reboot still works OK on the R2S
Thank you and Aurelien for the test.
To be honest, I'm still not entirely sure if this is the right fix.
I’m curious why RISC-V doesn't disable interrupts during this task,
as ARM and PowerPC do.
I've sent this out with an RFC prefix and am looking forward to getting
some feedback from the community.
- Troy
>
> - Yanko
More information about the linux-riscv
mailing list