* [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
@ 2025-11-02 23:01 Aurelien Jarno
2025-11-02 23:01 ` [PATCH v5 1/2] " Aurelien Jarno
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Aurelien Jarno @ 2025-11-02 23:01 UTC (permalink / raw)
To: linux-kernel, Lee Jones, Sebastian Reichel, Troy Mitchell,
Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, open list:RISC-V ARCHITECTURE:Keyword:riscv,
open list:RISC-V SPACEMIT SoC Support:Keyword:spacemit
Cc: Aurelien Jarno, open list:SYSTEM RESET/SHUTDOWN DRIVERS,
open list:RISC-V SPACEMIT SoC Support,
open list:RISC-V SPACEMIT SoC Support
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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
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/20251026224424.1891541-1-aurelien@aurel32.net/
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/20251021201451.1013640-1-aurelien@aurel32.net/
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/20251019191519.3898095-1-aurelien@aurel32.net/
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/20250927220824.1267318-1-aurelien@aurel32.net/
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
--
2.47.2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-02 23:01 [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Aurelien Jarno
@ 2025-11-02 23:01 ` Aurelien Jarno
2025-11-02 23:02 ` [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip Aurelien Jarno
2025-11-03 0:48 ` (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Sebastian Reichel
2 siblings, 0 replies; 14+ messages in thread
From: Aurelien Jarno @ 2025-11-02 23:01 UTC (permalink / raw)
To: linux-kernel, Lee Jones, Sebastian Reichel, Troy Mitchell,
Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, open list:RISC-V ARCHITECTURE:Keyword:riscv,
open list:RISC-V SPACEMIT SoC Support:Keyword:spacemit,
open list:SYSTEM RESET/SHUTDOWN DRIVERS
Cc: Aurelien Jarno, open list:SYSTEM RESET/SHUTDOWN DRIVERS,
open list:RISC-V SPACEMIT SoC Support,
open list:RISC-V SPACEMIT SoC Support
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.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
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
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 8248895ca9038..f6c1bcbb57def 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -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
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
index 51da87e05ce76..0e4ae6f6b5c55 100644
--- a/drivers/power/reset/Makefile
+++ b/drivers/power/reset/Makefile
@@ -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
diff --git a/drivers/power/reset/spacemit-p1-reboot.c b/drivers/power/reset/spacemit-p1-reboot.c
new file mode 100644
index 0000000000000..9ec3d1fff8f3d
--- /dev/null
+++ b/drivers/power/reset/spacemit-p1-reboot.c
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 by Aurelien Jarno
+ */
+
+#include <linux/bits.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/reboot.h>
+
+/* Power Control Register 2 */
+#define PWR_CTRL2 0x7e
+#define PWR_CTRL2_SHUTDOWN BIT(2) /* Shutdown request */
+#define PWR_CTRL2_RST BIT(1) /* Reset request */
+
+static int spacemit_p1_pwroff_handler(struct sys_off_data *data)
+{
+ struct regmap *regmap = data->cb_data;
+ int ret;
+
+ /* Put the PMIC into shutdown state */
+ ret = regmap_set_bits(regmap, PWR_CTRL2, PWR_CTRL2_SHUTDOWN);
+ if (ret) {
+ dev_err(data->dev, "shutdown failed: %d\n", ret);
+ return notifier_from_errno(ret);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static int spacemit_p1_restart_handler(struct sys_off_data *data)
+{
+ struct regmap *regmap = data->cb_data;
+ int ret;
+
+ /* Put the PMIC into reset state */
+ ret = regmap_set_bits(regmap, PWR_CTRL2, PWR_CTRL2_RST);
+ if (ret) {
+ dev_err(data->dev, "restart failed: %d\n", ret);
+ return notifier_from_errno(ret);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static int spacemit_p1_reboot_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct regmap *regmap;
+ int ret;
+
+ regmap = dev_get_regmap(dev->parent, NULL);
+ if (!regmap)
+ return -ENODEV;
+
+ ret = devm_register_power_off_handler(dev, &spacemit_p1_pwroff_handler,
+ regmap);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to register power off handler\n");
+
+ ret = devm_register_restart_handler(dev, spacemit_p1_restart_handler,
+ regmap);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to register restart handler\n");
+
+ return 0;
+}
+
+static const struct platform_device_id spacemit_p1_reboot_id_table[] = {
+ { "spacemit-p1-reboot", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, spacemit_p1_reboot_id_table);
+
+static struct platform_driver spacemit_p1_reboot_driver = {
+ .driver = {
+ .name = "spacemit-p1-reboot",
+ },
+ .probe = spacemit_p1_reboot_probe,
+ .id_table = spacemit_p1_reboot_id_table,
+};
+module_platform_driver(spacemit_p1_reboot_driver);
+
+MODULE_DESCRIPTION("SpacemiT P1 reboot/poweroff driver");
+MODULE_LICENSE("GPL");
--
2.47.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip
2025-11-02 23:01 [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Aurelien Jarno
2025-11-02 23:01 ` [PATCH v5 1/2] " Aurelien Jarno
@ 2025-11-02 23:02 ` Aurelien Jarno
2025-11-03 0:48 ` (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Sebastian Reichel
2 siblings, 0 replies; 14+ messages in thread
From: Aurelien Jarno @ 2025-11-02 23:02 UTC (permalink / raw)
To: linux-kernel, Lee Jones, Sebastian Reichel, Troy Mitchell,
Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, open list:RISC-V ARCHITECTURE:Keyword:riscv,
open list:RISC-V SPACEMIT SoC Support:Keyword:spacemit
Cc: Aurelien Jarno, open list:SYSTEM RESET/SHUTDOWN DRIVERS,
open list:RISC-V SPACEMIT SoC Support,
open list:RISC-V SPACEMIT SoC Support
Add a "spacemit-p1-reboot" cell for the SpacemiT P1 chip.
Signed-off-by: Aurelien Jarno <aurelien@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", },
};
--
2.47.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-02 23:01 [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Aurelien Jarno
2025-11-02 23:01 ` [PATCH v5 1/2] " Aurelien Jarno
2025-11-02 23:02 ` [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip Aurelien Jarno
@ 2025-11-03 0:48 ` Sebastian Reichel
2025-11-04 1:24 ` Troy Mitchell
2 siblings, 1 reply; 14+ messages in thread
From: Sebastian Reichel @ 2025-11-03 0:48 UTC (permalink / raw)
To: linux-kernel, Lee Jones, Sebastian Reichel, Troy Mitchell,
Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, linux-riscv, spacemit, Aurelien Jarno
Cc: linux-pm, linux-riscv, spacemit
On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
>
> [...]
Applied, thanks!
[1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
commit: 28124cc0fb8c7dc01a6834d227351e25d9a92c58
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-03 0:48 ` (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Sebastian Reichel
@ 2025-11-04 1:24 ` Troy Mitchell
2025-11-05 9:34 ` Lee Jones
2025-11-05 9:35 ` Lee Jones
0 siblings, 2 replies; 14+ messages in thread
From: Troy Mitchell @ 2025-11-04 1:24 UTC (permalink / raw)
To: Sebastian Reichel, linux-kernel, Lee Jones, Sebastian Reichel,
Troy Mitchell, Yixun Lan, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, linux-riscv, spacemit, Aurelien Jarno
Cc: linux-pm
On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
>
> On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> >
> > [...]
>
> 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-04 1:24 ` Troy Mitchell
@ 2025-11-05 9:34 ` Lee Jones
2025-11-05 9:42 ` Troy Mitchell
2025-11-05 9:35 ` Lee Jones
1 sibling, 1 reply; 14+ messages in thread
From: Lee Jones @ 2025-11-05 9:34 UTC (permalink / raw)
To: Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Tue, 04 Nov 2025, Troy Mitchell wrote:
> On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> >
> > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > >
> > > [...]
> >
> > 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?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-04 1:24 ` Troy Mitchell
2025-11-05 9:34 ` Lee Jones
@ 2025-11-05 9:35 ` Lee Jones
2025-11-05 9:40 ` Troy Mitchell
1 sibling, 1 reply; 14+ messages in thread
From: Lee Jones @ 2025-11-05 9:35 UTC (permalink / raw)
To: Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Tue, 04 Nov 2025, Troy Mitchell wrote:
> On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> >
> > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > >
> > > [...]
> >
> > 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?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 9:35 ` Lee Jones
@ 2025-11-05 9:40 ` Troy Mitchell
0 siblings, 0 replies; 14+ messages in thread
From: Troy Mitchell @ 2025-11-05 9:40 UTC (permalink / raw)
To: Lee Jones, Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Wed, Nov 05, 2025 at 09:35:44AM +0000, Lee Jones wrote:
> On Tue, 04 Nov 2025, Troy Mitchell wrote:
>
> > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > >
> > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > > >
> > > > [...]
> > >
> > > 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
>
> --
> Lee Jones [李琼斯]
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 9:34 ` Lee Jones
@ 2025-11-05 9:42 ` Troy Mitchell
2025-11-05 10:08 ` Lee Jones
2025-11-05 22:49 ` Aurelien Jarno
0 siblings, 2 replies; 14+ messages in thread
From: Troy Mitchell @ 2025-11-05 9:42 UTC (permalink / raw)
To: Lee Jones, Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> On Tue, 04 Nov 2025, Troy Mitchell wrote:
>
> > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > >
> > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dependency is here.
> > > >
> > > > [...]
> > >
> > > 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
>
> --
> Lee Jones [李琼斯]
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 9:42 ` Troy Mitchell
@ 2025-11-05 10:08 ` Lee Jones
2025-11-05 10:11 ` Lee Jones
2025-11-05 22:49 ` Aurelien Jarno
1 sibling, 1 reply; 14+ messages in thread
From: Lee Jones @ 2025-11-05 10:08 UTC (permalink / raw)
To: Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Wed, 05 Nov 2025, Troy Mitchell wrote:
> On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> > On Tue, 04 Nov 2025, Troy Mitchell wrote:
> >
> > > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > > >
> > > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> dependency is here.
> > > > >
> > > > > [...]
> > > >
> > > > 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.
Okay, thanks. I was mostly checking that you weren't referring to the
MFD patch, which doesn't represent a true dependency.
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 10:08 ` Lee Jones
@ 2025-11-05 10:11 ` Lee Jones
2025-11-05 13:10 ` Troy Mitchell
0 siblings, 1 reply; 14+ messages in thread
From: Lee Jones @ 2025-11-05 10:11 UTC (permalink / raw)
To: Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Wed, 05 Nov 2025, Lee Jones wrote:
> On Wed, 05 Nov 2025, Troy Mitchell wrote:
>
> > On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> > > On Tue, 04 Nov 2025, Troy Mitchell wrote:
> > >
> > > > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > > > >
> > > > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > dependency is here.
> > > > > >
> > > > > > [...]
> > > > >
> > > > > 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.
>
> 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.
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 10:11 ` Lee Jones
@ 2025-11-05 13:10 ` Troy Mitchell
0 siblings, 0 replies; 14+ messages in thread
From: Troy Mitchell @ 2025-11-05 13:10 UTC (permalink / raw)
To: Lee Jones, Troy Mitchell
Cc: Sebastian Reichel, linux-kernel, Sebastian Reichel, Yixun Lan,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, spacemit, Aurelien Jarno, linux-pm
On Wed, Nov 05, 2025 at 10:11:49AM +0000, Lee Jones wrote:
> On Wed, 05 Nov 2025, Lee Jones wrote:
>
> > On Wed, 05 Nov 2025, Troy Mitchell wrote:
> >
> > > On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> > > > On Tue, 04 Nov 2025, Troy Mitchell wrote:
> > > >
> > > > > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > > > > >
> > > > > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > dependency is here.
> > > > > > >
> > > > > > > [...]
> > > > > >
> > > > > > 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.
> >
> > 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
>
> --
> Lee Jones [李琼斯]
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 9:42 ` Troy Mitchell
2025-11-05 10:08 ` Lee Jones
@ 2025-11-05 22:49 ` Aurelien Jarno
2025-11-06 1:03 ` Troy Mitchell
1 sibling, 1 reply; 14+ messages in thread
From: Aurelien Jarno @ 2025-11-05 22:49 UTC (permalink / raw)
To: Troy Mitchell
Cc: Lee Jones, Sebastian Reichel, linux-kernel, Sebastian Reichel,
Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, linux-riscv, spacemit, linux-pm
On 2025-11-05 17:42, Troy Mitchell wrote:
> On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> > On Tue, 04 Nov 2025, Troy Mitchell wrote:
> >
> > > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > > >
> > > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> dependency is here.
Oh indeed, I have forgotten about this part.
> > > > >
> > > > > [...]
> > > >
> > > > 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.
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
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot
2025-11-05 22:49 ` Aurelien Jarno
@ 2025-11-06 1:03 ` Troy Mitchell
0 siblings, 0 replies; 14+ messages in thread
From: Troy Mitchell @ 2025-11-06 1:03 UTC (permalink / raw)
To: Troy Mitchell, Lee Jones, Sebastian Reichel, linux-kernel,
Sebastian Reichel, Yixun Lan, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, linux-riscv, spacemit, linux-pm
On Wed, Nov 05, 2025 at 11:49:37PM +0100, Aurelien Jarno wrote:
> On 2025-11-05 17:42, Troy Mitchell wrote:
> > On Wed, Nov 05, 2025 at 09:34:21AM +0000, Lee Jones wrote:
> > > On Tue, 04 Nov 2025, Troy Mitchell wrote:
> > >
> > > > On Mon, Nov 03, 2025 at 01:48:33AM +0100, Sebastian Reichel wrote:
> > > > >
> > > > > On Mon, 03 Nov 2025 00:01:58 +0100, Aurelien Jarno wrote:
> > > > > > 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/20251009-k1-i2c-atomic-v4-1-a89367870286@linux.spacemit.com/
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > dependency is here.
>
> Oh indeed, I have forgotten about this part.
>
> > > > > >
> > > > > > [...]
> > > > >
> > > > > 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.
>
> 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
>
> Regards
> Aurelien
>
> --
> Aurelien Jarno GPG: 4096R/1DDD8C9B
> aurelien@aurel32.net http://aurel32.net
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-11-06 1:04 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-02 23:01 [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Aurelien Jarno
2025-11-02 23:01 ` [PATCH v5 1/2] " Aurelien Jarno
2025-11-02 23:02 ` [PATCH v5 2/2] mfd: simple-mfd-i2c: add a reboot cell for the SpacemiT P1 chip Aurelien Jarno
2025-11-03 0:48 ` (subset) [PATCH v5 0/2] driver: reset: spacemit-p1: add driver for poweroff/reboot Sebastian Reichel
2025-11-04 1:24 ` Troy Mitchell
2025-11-05 9:34 ` Lee Jones
2025-11-05 9:42 ` Troy Mitchell
2025-11-05 10:08 ` Lee Jones
2025-11-05 10:11 ` Lee Jones
2025-11-05 13:10 ` Troy Mitchell
2025-11-05 22:49 ` Aurelien Jarno
2025-11-06 1:03 ` Troy Mitchell
2025-11-05 9:35 ` Lee Jones
2025-11-05 9:40 ` Troy Mitchell
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).