Skip to contentSkip to conversation

Kconfig: Add dependencies of POWER_RESET for MIPS Malta

PATCH In review Yuan Tan 2 participants 4 messages Sep 16, 2023 – Sep 17, 2023 MIPS

lore
Share & tools
lore

Yuan Tan

author
#0 lore raw

v4 cover Kconfig: Add dependencies of POWER_RESET for MIPS Malta

These patches are to add dependencies of POWER_RESET for MIPS Malta.

To simplify the enablement of the poweroff support, selecting the required options for CONFIG_POWER_RESET=y may make many people happy especially when they are using a customized config (maybe tinyconfig based) for a target qemu board. Without normal poweroff support from the kernel side, qemu will simply hang[1] there after a 'poweroff' command, which is a very bad experience for the automatical tests.

However, CONFIG_POWER_RESET is ineffective if there are no dependencies that enable certain devices in Kconfig.

Currently, based on tinyconfig, it is very hard to find the exact poweroff related option[2]. Some architectures' poweroff works well without any dependence, the others' poweroff options are hidden deeply, which make things hard.

After multiple verifications, these options have been identified as the minimum dependencies required for poweroff to function normally. Additionally, 'make savedefconfig' simplifies the defconfig automatically.

Zhangjin and I invested a significant amount of time in searching for the current options on these devices. We hope that this set of patches will save time for others. If community like it, we will consider adding dependencies for POWER_RESET on other devices.

We hope every device's CONFIG_POWER_RESET will have proper dependencies. :)

---
[1]: https://lore.kernel.org/lkml/511b2f6009fb830b3f32b4be3dca99596c684fa3.1689759351.git.falcon@tinylab.org/
[2]: https://lore.kernel.org/all/983843582e52e83fba79ad45cea6c79e1f62ec6c.1690489039.git.falcon@tinylab.org/

v1: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/

---
Changes in v2:
- Fix the mistake of using spaces instead of tabs in kconfig.

Changes in v3:
- Enable POWER_RESET and simplify the deconfig.
- Select ADB_CUDA in PPC_PMAC32 only.

Changes in v4:
- Squash last two commits.

Yuan Tan (2):
MIPS: Cleanup malta_defconfig
Kconfig: add dependencies of POWER_RESET for mips malta

 arch/mips/Kconfig                 |  3 +++
 arch/mips/configs/malta_defconfig | 39 ++++++-------------------------
 2 files changed, 10 insertions(+), 32 deletions(-)

base-commit: e7513eccb7d7f82e28f4730210b42da71edaa6a6

Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v4 1/2 MIPS: Cleanup malta_defconfig

Use 'make savedefconfig' to cleanup malta_defconfig.

---
 arch/mips/configs/malta_defconfig | 39 +++++++------------------------
 1 file changed, 8 insertions(+), 31 deletions(-)
arch/mips/configs/malta_defconfig +8 -31
index ae1a7793e810..7ae07d57b79a 100644
@@ -6,18 +6,17 @@ CONFIG_NAMESPACES=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_MIPS_MALTA=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_CPU_MIPS32_R2=y
 CONFIG_PAGE_SIZE_16KB=y
 CONFIG_NR_CPUS=8
 CONFIG_HZ_100=y
-CONFIG_PCI=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -133,19 +132,6 @@ CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_IP6_NF_MATCH_AH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_MATCH_FRAG=m
-CONFIG_IP6_NF_MATCH_OPTS=m
-CONFIG_IP6_NF_MATCH_HL=m
-CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_TARGET_HL=m
-CONFIG_IP6_NF_FILTER=m
-CONFIG_IP6_NF_TARGET_REJECT=m
-CONFIG_IP6_NF_MANGLE=m
-CONFIG_IP6_NF_RAW=m
 CONFIG_BRIDGE_NF_EBTABLES=m
 CONFIG_BRIDGE_EBT_BROUTE=m
 CONFIG_BRIDGE_EBT_T_FILTER=m
@@ -177,7 +163,6 @@ CONFIG_IPDDP=m
 CONFIG_IPDDP_ENCAP=y
 CONFIG_PHONET=m
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_CBQ=m
 CONFIG_NET_SCH_HTB=m
 CONFIG_NET_SCH_HFSC=m
 CONFIG_NET_SCH_PRIO=m
@@ -186,16 +171,12 @@ CONFIG_NET_SCH_SFQ=m
 CONFIG_NET_SCH_TEQL=m
 CONFIG_NET_SCH_TBF=m
 CONFIG_NET_SCH_GRED=m
-CONFIG_NET_SCH_DSMARK=m
 CONFIG_NET_SCH_NETEM=m
 CONFIG_NET_SCH_INGRESS=m
 CONFIG_NET_CLS_BASIC=m
-CONFIG_NET_CLS_TCINDEX=m
 CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
-CONFIG_NET_CLS_RSVP=m
-CONFIG_NET_CLS_RSVP6=m
 CONFIG_NET_CLS_FLOW=m
 CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_POLICE=y
@@ -211,6 +192,7 @@ CONFIG_CFG80211=m
 CONFIG_MAC80211=m
 CONFIG_MAC80211_MESH=y
 CONFIG_RFKILL=m
+CONFIG_PCI=y
 CONFIG_DEVTMPFS=y
 CONFIG_CONNECTOR=m
 CONFIG_MTD=y
@@ -220,7 +202,6 @@ CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_MTD_UBI=m
 CONFIG_MTD_UBI_GLUEBI=m
 CONFIG_BLK_DEV_FD=m
@@ -396,20 +377,16 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_HMAC=y
-CONFIG_CRYPTO_XCBC=m
-CONFIG_CRYPTO_MD4=m
-CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_ANUBIS=m
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_FCRYPT=m
-CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_XCBC=m
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v4 2/2 Kconfig: add dependencies of POWER_RESET for mips malta

In reply to Yuan Tan

MIPS Malta's power off depends on PCI, PCI_QUIRKS, and POWER_RESET_PIIX4_POWEROFF to work. Enable them when POWER_RESET is set for convenience.
Then regenerate malta_defconfig with 'make savedefconfig'.

---
 arch/mips/Kconfig                 | 3 +++
 arch/mips/configs/malta_defconfig | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/mips/Kconfig +3 -0
index fc6fba925aea..b63a93e39f23 100644
@@ -547,6 +547,9 @@ config MIPS_MALTA
 	select MIPS_L1_CACHE_SHIFT_6
 	select MIPS_MSC
 	select PCI_GT64XXX_PCI0
+	select PCI if POWER_RESET
+	select PCI_QUIRKS if POWER_RESET
+	select POWER_RESET_PIIX4_POWEROFF if POWER_RESET
 	select SMP_UP if SMP
 	select SWAP_IO_SPACE
 	select SYS_HAS_CPU_MIPS32_R1
arch/mips/configs/malta_defconfig +0 -2
index 7ae07d57b79a..99049e993192 100644
@@ -192,7 +192,6 @@ CONFIG_CFG80211=m
 CONFIG_MAC80211=m
 CONFIG_MAC80211_MESH=y
 CONFIG_RFKILL=m
-CONFIG_PCI=y
 CONFIG_DEVTMPFS=y
 CONFIG_CONNECTOR=m
 CONFIG_MTD=y
@@ -284,7 +283,6 @@ CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_PIIX4_POWEROFF=y
 CONFIG_POWER_RESET_SYSCON=y
 # CONFIG_HWMON is not set
 CONFIG_FB=y
Signature · 1 line
2.34.1
Reviewed-by on v4 2/2
#3 lore raw

Re: [PATCH v4 2/2] Kconfig: add dependencies of POWER_RESET for mips malta

Quoted 6 lines · Yuan Tan

MIPS Malta's power off depends on PCI, PCI_QUIRKS, and POWER_RESET_PIIX4_POWEROFF to work. Enable them when POWER_RESET is set for convenience.
Then regenerate malta_defconfig with 'make savedefconfig'.

I haven't suggested that, just reviewed your patches, so:

Quoted 1 line

(I don't remember Christophe suggesting this either)

Quoted 41 lines
---
  arch/mips/Kconfig                 | 3 +++
  arch/mips/configs/malta_defconfig | 2 --
  2 files changed, 3 insertions(+), 2 deletions(-)
arch/mips/Kconfig +3 -0
index fc6fba925aea..b63a93e39f23 100644
@@ -547,6 +547,9 @@ config MIPS_MALTA
  	select MIPS_L1_CACHE_SHIFT_6
  	select MIPS_MSC
  	select PCI_GT64XXX_PCI0
+	select PCI if POWER_RESET
+	select PCI_QUIRKS if POWER_RESET
+	select POWER_RESET_PIIX4_POWEROFF if POWER_RESET
  	select SMP_UP if SMP
  	select SWAP_IO_SPACE
  	select SYS_HAS_CPU_MIPS32_R1
arch/mips/configs/malta_defconfig +0 -2
index 7ae07d57b79a..99049e993192 100644
@@ -192,7 +192,6 @@ CONFIG_CFG80211=m
  CONFIG_MAC80211=m
  CONFIG_MAC80211_MESH=y
  CONFIG_RFKILL=m
-CONFIG_PCI=y
  CONFIG_DEVTMPFS=y
  CONFIG_CONNECTOR=m
  CONFIG_MTD=y
@@ -284,7 +283,6 @@ CONFIG_MOUSE_PS2_ELANTECH=y
  CONFIG_SERIAL_8250=y
  CONFIG_SERIAL_8250_CONSOLE=y
  CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_PIIX4_POWEROFF=y
  CONFIG_POWER_RESET_SYSCON=y
  # CONFIG_HWMON is not set
  CONFIG_FB=y