2023-08-02 09:36:52

by Yuan Tan

[permalink] [raw]
Subject: [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.

Signed-off-by: Yuan Tan <[email protected]>
---
arch/mips/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index fc6fba925aea..a2827488efef 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -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
--
2.34.1



2023-08-05 19:39:23

by Zhangjin Wu

[permalink] [raw]
Subject: [RFC 0/1] 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

> 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(+)
>
> --
> 2.34.1

2023-08-08 17:53:47

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: [RFC 0/1] mips: malta: Select PCI_QUIRKS if POWER_RESET_PIIX4_POWEROFF is enabled

On Sun, 6 Aug 2023, Zhangjin Wu wrote:

> 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