Skip to contentSkip to conversation

driver: reset: spacemit-p1: add driver for poweroff/reboot

PATCH Applied Aurelien Jarno 5 participants 29 messages Nov 2, 2025 – Apr 30

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v5 cover driver: reset: spacemit-p1: add driver for poweroff/reboot

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

Changes between version 4 and version 5:
- Change default to "MFD_SPACEMIT_P1"

Here is version 4 of this series:
https://lore.kernel.org/spacemit/[email protected]/

Changes between version 3 and version 4:
- Replace the "select" by a "depends on"
- Remove outdated Reviewed-by

Here is version 3 of this series:
https://lore.kernel.org/spacemit/[email protected]/

Changes between version 2 and version 3:
- Allow building as a module
- Remove outdated Acked-by and Tested-by
- Collect Reviewed-by

Here is version 2 of this series:
https://lore.kernel.org/spacemit/[email protected]/

Changes between version 1 and version 2:
- Rebase onto v6.18-rc1
- Use dev_err_probe() to simplify the code
- Fix indentation of patch 1
- Collect Acked-by and Tested-by
Here is version 1 of this series:
https://lore.kernel.org/spacemit/[email protected]/

Aurelien Jarno (2):
driver: reset: spacemit-p1: add driver for poweroff/reboot
mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

 drivers/mfd/simple-mfd-i2c.c             |  1 +
 drivers/power/reset/Kconfig              |  9 +++
 drivers/power/reset/Makefile             |  1 +
 drivers/power/reset/spacemit-p1-reboot.c | 88 ++++++++++++++++++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 drivers/power/reset/spacemit-p1-reboot.c
Signature · 1 line
2.47.2
#1 lore raw

PATCH v5 1/2 driver: reset: spacemit-p1: add driver for poweroff/reboot

This driver implements poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

The SpacemiT P1 support is implemented as a MFD driver, so the access is done directly through the regmap interface. Reboot or poweroff is triggered by setting a specific bit in a control register, which is automatically cleared by the hardware afterwards.

---
v5:
- Change default to "MFD_SPACEMIT_P1"

 drivers/power/reset/Kconfig              |  9 +++
 drivers/power/reset/Makefile             |  1 +
 drivers/power/reset/spacemit-p1-reboot.c | 88 ++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 drivers/power/reset/spacemit-p1-reboot.c
drivers/power/reset/Kconfig +9 -0
index 8248895ca9038..f6c1bcbb57def 100644
@@ -283,6 +283,15 @@ config POWER_RESET_KEYSTONE
 	help
 	  Reboot support for the KEYSTONE SoCs.
 
+config POWER_RESET_SPACEMIT_P1
+	tristate "SpacemiT P1 poweroff and reset driver"
+	depends on ARCH_SPACEMIT || COMPILE_TEST
+	depends on MFD_SPACEMIT_P1
+	default MFD_SPACEMIT_P1
+	help
+	  This driver supports power-off and reset operations for the SpacemiT
+	  P1 PMIC.
+
 config POWER_RESET_SYSCON
 	bool "Generic SYSCON regmap reset driver"
 	depends on OF
drivers/power/reset/Makefile +1 -0
index 51da87e05ce76..0e4ae6f6b5c55 100644
@@ -24,6 +24,7 @@ obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o
 obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
 obj-$(CONFIG_POWER_RESET_REGULATOR) += regulator-poweroff.o
 obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
+obj-$(CONFIG_POWER_RESET_SPACEMIT_P1) += spacemit-p1-reboot.o
 obj-$(CONFIG_POWER_RESET_ST) += st-poweroff.o
 obj-$(CONFIG_POWER_RESET_TH1520_AON) += th1520-aon-reboot.o
 obj-$(CONFIG_POWER_RESET_TORADEX_EC) += tdx-ec-poweroff.o
drivers/power/reset/spacemit-p1-reboot.c new file +88 -0

88 lines not on this page · raw message

Signature · 1 line
2.47.2
#2 lore raw

PATCH v5 2/2 mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

In reply to Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +1 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644
@@ -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", },
 };
Signature · 1 line
2.47.2
#3 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

mainline + patch + dts bits enabling i2c8 on the OrangePi RV2 and R2S allows both to soft reboot as expected.

-Yanko

#4 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hi,

Quoted 19 lines · Yanko Kaneti

Hello,

Quoted 16 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644
@@ -99,6 +99,7 @@ static const struct regmap_config spacemit_p1_regmap_config = {
 };
 
Quoted 8 lines

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 5 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
 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/[email protected]/

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.

Regards
Aurelien

Signature · 7 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#5 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 19 lines · Yanko Kaneti

Hello,

Quoted 16 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644
@@ -99,6 +99,7 @@ static const struct regmap_config spacemit_p1_regmap_config = {
 };
 
Quoted 8 lines

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 5 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
 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 ?

Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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..

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.

..

[   56.411363] systemd-shutdown[1]: Rebooting.
[   56.432988] reboot: Restarting system
[   56.434120] ------------[ cut here ]------------
[   56.438642] Voluntary context switch within RCU read-side critical section!
[   56.438665] WARNING: kernel/rcu/tree_plugin.h:332 at rcu_note_context_switch+0x370/0x510, CPU#0: systemd-shutdow/1
[   56.438693] Modules linked in: rfkill binfmt_misc vfat fat r8169 loop nfnetlink zram lz4hc_compress lz4_compress fuse
[   56.438733] CPU: 0 UID: 0 PID: 1 Comm: systemd-shutdow Not tainted 7.0.0-rc1+ #16 PREEMPT(full) 
[   56.438742] Hardware name: Unknown Unknown Product/Unknown Product, BIOS 2022.10ky-OpenWrt-r28427-6df0e3d02a 10/01/2022
[   56.438747] epc : rcu_note_context_switch+0x370/0x510
[   56.438757]  ra : rcu_note_context_switch+0x370/0x510
[   56.438764] epc : ffffffff801781b8 ra : ffffffff801781b8 sp : ffffffc6000432b0
[   56.438769]  gp : ffffffff83843a90 tp : ffffffd6048bdd00 t0 : ffffffff80036330
[   56.438774]  t1 : ffffffc600043080 t2 : 2d2d2d2d2d2d2d2d s0 : ffffffc600043330
[   56.438780]  s1 : ffffffd67eb15240 a0 : 000000000000003f a1 : ffffffff83559770
[   56.438784]  a2 : 0000000000000010 a3 : ffffffff83559b30 a4 : 0000000000000000
[   56.438789]  a5 : 0000000000000000 a6 : ffffffff83529700 a7 : ffffffff83559758
[   56.438793]  s2 : ffffffff83b55370 s3 : 0000000000000000 s4 : 0000000000000000
[   56.438798]  s5 : ffffffff83b55370 s6 : 0000000000000000 s7 : ffffffd605a1ccc0
[   56.438802]  s8 : 0000000000080009 s9 : 00000000fffc4890 s10: 0000000000000020
[   56.438806]  s11: ffffffff800b5160 t3 : 00000000ffffdfff t4 : 0000000000000001
[   56.438812]  t5 : 000000000000001f t6 : ffffffc600043098 ssp : 0000000000000000
[   56.438817] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[   56.438822] [<ffffffff801781b8>] rcu_note_context_switch+0x370/0x510
[   56.438832] [<ffffffff81285038>] __schedule+0x88/0x870
[   56.438844] [<ffffffff8128584e>] schedule+0x2e/0xa8
[   56.438851] [<ffffffff8128d9e4>] schedule_timeout+0x84/0x120
[   56.438860] [<ffffffff81286930>] wait_for_completion_timeout+0x78/0x148
[   56.438869] [<ffffffff80e30ab6>] spacemit_i2c_xfer_common+0x2d6/0x600
[   56.438881] [<ffffffff80e30e2a>] spacemit_i2c_xfer+0x1a/0x40
[   56.438887] [<ffffffff80e24d3a>] __i2c_transfer+0xf2/0x570
[   56.438896] [<ffffffff80e2520c>] i2c_transfer+0x54/0xc0
[   56.438903] [<ffffffff80c7fc02>] regmap_i2c_read+0x5a/0x98
[   56.438912] [<ffffffff80c791d4>] _regmap_raw_read+0xbc/0x380
[   56.438922] [<ffffffff80c794d0>] _regmap_bus_read+0x38/0x70
[   56.438930] [<ffffffff80c7776e>] _regmap_read+0x4e/0x1e0
[   56.438938] [<ffffffff80c7821c>] _regmap_update_bits+0xac/0xe8
[   56.438945] [<ffffffff80c79d04>] regmap_update_bits_base+0x5c/0x80
[   56.438953] [<ffffffff80e3ec1c>] spacemit_p1_restart_handler+0x2c/0x70
[   56.438963] [<ffffffff800b519a>] sys_off_notify+0x3a/0x60
[   56.438973] [<ffffffff800b3450>] notifier_call_chain+0x68/0x1a8
[   56.438980] [<ffffffff800b36c6>] atomic_notifier_call_chain+0x3e/0x60
[   56.438986] [<ffffffff800b5fb2>] do_kernel_restart+0x2a/0x40
[   56.438993] [<ffffffff80028b80>] machine_restart+0x18/0x28
[   56.439005] [<ffffffff800b618a>] kernel_restart+0x92/0xb8
[   56.439013] [<ffffffff800b64f2>] __do_sys_reboot+0x13a/0x238
[   56.439021] [<ffffffff800b671a>] __riscv_sys_reboot+0x22/0x38
[   56.439028] [<ffffffff8127ecfe>] do_trap_ecall_u+0x176/0x608
[   56.439036] [<ffffffff812926ec>] handle_exception+0x16c/0x178
[   56.439049] ---[ end tracsys: 0x0

Regards
Yanko

#6 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 3 lines

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.

At a first glance the problem seems to happen in the I2C PIO code. On which hardware is that happening?

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
#7 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hi,

Quoted 45 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 7 lines
Quoted 3 lines

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.

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
#8 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hello,

Quoted 50 lines · Aurelien Jarno
Quoted 49 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 3 lines

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.

Quoted 6 lines
Quoted 3 lines

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.

Regards
Yanko

#9 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hi,

Quoted 57 lines · Yanko Kaneti

Hello,

Quoted 54 lines · Aurelien Jarno
Quoted 52 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

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.

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
reviewer
#10 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

On Wed Mar 4, 2026 at 4:38 AM CST, Aurelien Jarno wrote:
Hi, Aurelien and Yanko,

Quoted 63 lines

Hi,

Quoted 60 lines · Yanko Kaneti

Hello,

Quoted 56 lines · Aurelien Jarno
Quoted 45 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 7 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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]

Quoted 3 lines

Regards
Aurelien

#11 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Hi,

Quoted 73 lines · Troy Mitchell

On Wed Mar 4, 2026 at 4:38 AM CST, Aurelien Jarno wrote:
Hi, Aurelien and Yanko,

Quoted 63 lines

Hi,

Quoted 60 lines · Yanko Kaneti

Hello,

Quoted 56 lines · Aurelien Jarno
Quoted 45 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 7 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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.

Quoted 8 lines

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, I confirm it fixes the issue \o/.

Regards
Aurelien

Signature · 7 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#12 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

In reply to Troy Mitchell
Quoted 73 lines · Troy Mitchell

On Wed Mar 4, 2026 at 4:38 AM CST, Aurelien Jarno wrote:
Hi, Aurelien and Yanko,

Quoted 63 lines

Hi,

Quoted 60 lines · Yanko Kaneti

Hello,

Quoted 56 lines · Aurelien Jarno
Quoted 45 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 7 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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.

Quoted 8 lines

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

- Yanko

reviewer
#13 lore raw

Re: [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

Quoted 78 lines · Yanko Kaneti
Quoted 77 lines · Troy Mitchell

On Wed Mar 4, 2026 at 4:38 AM CST, Aurelien Jarno wrote:
Hi, Aurelien and Yanko,

Quoted 63 lines

Hi,

Quoted 60 lines · Yanko Kaneti

Hello,

Quoted 56 lines · Aurelien Jarno
Quoted 45 lines · Aurelien Jarno
Quoted 32 lines · Yanko Kaneti
Quoted 31 lines · Aurelien Jarno

Hi,

Quoted 27 lines · Yanko Kaneti

Hello,

Quoted 14 lines · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

---
v5: no changes

 drivers/mfd/simple-mfd-i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/simple-mfd-i2c.c +0 -0
index 0a607a1e3ca1d..542d378cdcd1f 100644

drivers/mfd/simple-mfd-i2c.c static const struct regmap_config spacemit_p1_regmap_config = { · line 105

Quoted 7 lines
drivers/mfd/simple-mfd-i2c.c +1 -0
@@ -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 ?

Quoted 8 lines
Quoted 5 lines

Unfortunately, this patchset is still missing:
https://lore.kernel.org/all/[email protected]/

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.

Quoted 7 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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?

Quoted 7 lines
Quoted 4 lines

- 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

Quoted 2 lines

- Yanko

maintainer Applied
#14 lore raw

Re: (subset) [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

In reply to Aurelien Jarno
Quoted 1 line · Aurelien Jarno

Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.

Applied, thanks!

[2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip

      commit: b84a9ac61080735b615233e1231ddd19f6624869

--
Lee Jones [李琼斯]

#15 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

In reply to Aurelien Jarno
Quoted 8 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>
reviewer
#16 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 9 lines · Sebastian Reichel
Quoted 7 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

Quoted 6 lines
Quoted 1 line

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

- Troy

maintainer
#17 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 10 lines · Troy Mitchell
Quoted 9 lines · Sebastian Reichel
Quoted 7 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

Signature · 1 line
Lee Jones [李琼斯]
reviewer
#18 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 10 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

- Troy

Quoted 4 lines
Signature · 2 lines
-- 
Lee Jones [李琼斯]
maintainer
#19 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 19 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

[...]

Applied, thanks!

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

Signature · 1 line
Lee Jones [李琼斯]
maintainer
#20 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 23 lines · Lee Jones
Quoted 21 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

To save Sebastian some trouble, let's keep the reboot patch applied.

I'll hold off on the MFD one, which will ensure that reboot isn't probed.

Let me know when the dep is merged and I'll hoover up the rest of the set.

Signature · 1 line
Lee Jones [李琼斯]
reviewer
#21 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 31 lines · Lee Jones
Quoted 29 lines · Lee Jones
Quoted 26 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 10 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Quoted 8 lines
Quoted 2 lines

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

To save Sebastian some trouble, let's keep the reboot patch applied.

I'll hold off on the MFD one, which will ensure that reboot isn't probed.

Let me know when the dep is merged and I'll hoover up the rest of the set.

Okay. I'll reply this thread when the dependency is merged.

- Troy

Quoted 4 lines
Signature · 2 lines
-- 
Lee Jones [李琼斯]
reviewer
#22 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Hi Lee and Aurelien,

Quoted 35 lines · Troy Mitchell
Quoted 34 lines · Lee Jones
Quoted 31 lines · Lee Jones
Quoted 19 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

[...]

Applied, thanks!

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

Quoted 6 lines
Quoted 5 lines

To save Sebastian some trouble, let's keep the reboot patch applied.

I'll hold off on the MFD one, which will ensure that reboot isn't probed.

Let me know when the dep is merged and I'll hoover up the rest of the set.

Okay. I'll reply this thread when the dependency is merged.

Ths I2C PIO patchset has been merged here [1].

- Troy

#23 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

In reply to Lee Jones

Hi Lee,

Quoted 31 lines · Lee Jones
Quoted 29 lines · Lee Jones
Quoted 26 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 10 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Quoted 8 lines
Quoted 2 lines

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

To save Sebastian some trouble, let's keep the reboot patch applied.

I'll hold off on the MFD one, which will ensure that reboot isn't probed.

Let me know when the dep is merged and I'll hoover up the rest of the set.

The dependency is still not yet merged, although it has been ready for weeks, and I am just crossing fingers that it will get picked-up for for 7.1.

That said it's not a hard dependency, in most cases reboot will work, which is an improvement over no reboot driver. The missing I2C PIO patches are just there to make it reliable.

Therefore given the 7.1 merge window approaching, I believe it's better to merge this simple MFD patch and to not wait more.

Thanks
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
maintainer
#24 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 47 lines · Aurelien Jarno

Hi Lee,

Quoted 31 lines · Lee Jones
Quoted 29 lines · Lee Jones
Quoted 26 lines · Troy Mitchell
Quoted 11 lines · Lee Jones
Quoted 9 lines · Troy Mitchell
Quoted 8 lines · Sebastian Reichel
Quoted 6 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Quoted 10 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Quoted 8 lines
Quoted 2 lines

Okay, thanks. I was mostly checking that you weren't referring to the MFD patch, which doesn't represent a true dependency.

To save Sebastian some trouble, let's keep the reboot patch applied.

I'll hold off on the MFD one, which will ensure that reboot isn't probed.

Let me know when the dep is merged and I'll hoover up the rest of the set.

The dependency is still not yet merged, although it has been ready for weeks, and I am just crossing fingers that it will get picked-up for for 7.1.

Quoted 6 lines

That said it's not a hard dependency, in most cases reboot will work, which is an improvement over no reboot driver. The missing I2C PIO patches are just there to make it reliable.

Therefore given the 7.1 merge window approaching, I believe it's better to merge this simple MFD patch and to not wait more.

It's too late for v7.1 now.

I think this set has been well and truly forgotten.

Please rebase and submit a [RESEND] with the info in the cover letter.

Signature · 1 line
Lee Jones [李琼斯]
#25 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

In reply to Troy Mitchell
Quoted 6 lines · Troy Mitchell
Quoted 5 lines · Lee Jones
Quoted 3 lines · Troy Mitchell
Quoted 2 lines · Sebastian Reichel

On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Oh indeed, I have forgotten about this part.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

[...]

Applied, thanks!

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Note however this is not a strong dependency, it is needed to make the reset or power off reliable. Calling non-atomic i2c_transfer lead to a successful reset or power off a bit more than half of the time.

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
reviewer
#26 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 27 lines · Aurelien Jarno
Quoted 6 lines · Troy Mitchell
Quoted 5 lines · Lee Jones
Quoted 3 lines · Troy Mitchell
Quoted 2 lines · Sebastian Reichel

On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency is here.

Oh indeed, I have forgotten about this part.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

What is the dependency?

I point it out above.
Without this patch, reboot and shutdown would end up calling the non-atomic i2c_transfer.

Note however this is not a strong dependency, it is needed to make the reset or power off reliable. Calling non-atomic i2c_transfer lead to a successful reset or power off a bit more than half of the time.

Oh really? I never had success with the non-atomic transfer.

But however, as Lee pointed out, this patch doesn’t need to do anything special now.
We only needs to ensure that the MFD part won’t be probed.

- Troy

Quoted 8 lines

Regards
Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net
maintainer
#27 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

In reply to Troy Mitchell
Quoted 10 lines · Troy Mitchell
Quoted 9 lines · Sebastian Reichel
Quoted 7 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

[...]

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

And what is: ^[@kernel.org in your recipients list?

Signature · 1 line
Lee Jones [李琼斯]
reviewer
#28 lore raw

Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Quoted 14 lines · Lee Jones
Quoted 12 lines · Troy Mitchell
Quoted 11 lines · Sebastian Reichel
Quoted 8 lines · Aurelien Jarno

This adds poweroff/reboot support for the SpacemiT P1 PMIC chip, which is commonly paired with the SpacemiT K1 SoC.

Note: For reliable operation, this driver depends on a this patch that adds atomic transfer support to the SpacemiT I2C controller driver:
https://lore.kernel.org/spacemit/[email protected]/

[...]

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

Applied, thanks!

[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

      commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58

Should we apply it now? The dependency patch hasn’t been merged yet...

And what is: ^[@kernel.org in your recipients list?

Might have accidentally messed up my email...

- Troy

Quoted 4 lines
Signature · 2 lines
-- 
Lee Jones [李琼斯]