Skip to contentSkip to conversation

mips: malta: Select PCI_QUIRKS if POWER_RESET_PIIX4_POWEROFF is enabled

RFC In review Yuan Tan 3 participants 5 messages Aug 2, 2023 – Aug 8, 2023 MIPS

lore
Share & tools
lore

Yuan Tan

author
#0 lore raw

cover mips: malta: Select PCI_QUIRKS if POWER_RESET_PIIX4_POWEROFF is enabled

Hi list,

I just found that the on QEMU Malta, POWER_RESET_PIIX4_POWEROFF relay on PCI_QUIRKS to work, or else the reboot will hang.

Welcome everyone's suggestions.

Yuan Tan (1):
mips: malta: select PCI_QUIRK for POWER_RESET_PIIX4_POWEROFF

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.34.1
author
#1 lore raw

RFC 1/1 mips: malta: select PCI_QUIRK for POWER_RESET_PIIX4_POWEROFF

Select PCI_QUIRKS for malta if POWER_RESET_PIIX4_POWEROFF enabled.

Syscall reboot relies on PCI_QUIRKS, or else the reboot will hang.

---
 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index fc6fba925aea..a2827488efef 100644
@@ -547,6 +547,7 @@ config MIPS_MALTA
 	select MIPS_L1_CACHE_SHIFT_6
 	select MIPS_MSC
 	select PCI_GT64XXX_PCI0
+	select PCI_QUIRKS if POWER_RESET_PIIX4_POWEROFF
 	select SMP_UP if SMP
 	select SWAP_IO_SPACE
 	select SYS_HAS_CPU_MIPS32_R1
Signature · 1 line
2.34.1
#2 lore raw

cover mips: malta: Select PCI_QUIRKS if POWER_RESET_PIIX4_POWEROFF is enabled

Hi, Yuan

To even further reduce the time cost & waste of finding the exact poweroff options for malta, I suggest to directly select the required options when CONFIG_POWER_RESET=y:

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

But it looks a little ugly, let's think about how to improve it.

And aslo, due to the same reason, it is possible to send a RFC patchset to select required poweroff options for CONFIG_POWER_RESET=y of the other architectures, like the CONFIG_ACPI=y and CONFIG_PCI=y options for i386/x86_64 and the CONFIG_MACINTOSH_DRIVERS=y and CONFIG_ADB_CUDA=y for ppc g3beige.

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 there after a 'poweroff' command, which is a very bad experience for the automatical tests. Currently, based on tinyconfig, it is very hard to find the exact poweroff options, some architectures simply enable poweroff support by default, the others' poweroff options are hidden deeply, which make things very hard.

Thanks,
Zhangjin

Quoted 15 lines

Hi list,

I just found that the on QEMU Malta, POWER_RESET_PIIX4_POWEROFF relay on PCI_QUIRKS to work, or else the reboot will hang.

Welcome everyone's suggestions.

Yuan Tan (1):
mips: malta: select PCI_QUIRK for POWER_RESET_PIIX4_POWEROFF

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.34.1
#3 lore raw
Quoted 9 lines · Zhangjin Wu

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 there after a 'poweroff' command, which is a very bad experience for the automatical tests. Currently, based on tinyconfig, it is very hard to find the exact poweroff options, some architectures simply enable poweroff support by default, the others' poweroff options are hidden deeply, which make things very hard.

The settings are a bit buried indeed and I was hit by that myself at one
point when upgrading the kernel using old .config, but honestly I think we want to let people strip the kernel from options they don't want or need, so I think it will best be sorted by presetting the useful options in the respective defconfigs and then maybe guard the more critical ones with `if EXPERT'.

Maciej

#4 lore raw
In reply to Yuan Tan
Quoted 2 lines · Yuan Tan

I just found that the on QEMU Malta, POWER_RESET_PIIX4_POWEROFF relay on PCI_QUIRKS to work, or else the reboot will hang.

I'll check if it is reproducible with actual hardware, otherwise it might
be an issue to fix in QEMU.

Maciej