diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9526a1b399fcd..2e6fa8b49752e 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -552,6 +552,13 @@ Kernel parameters apm= [APM] Advanced Power Management See header of arch/x86/kernel/apm_32.c. + apple_keep_idle_nop + [ARM64,EARLY] On T6050 and T8142, keep idle=nop. + These cores idle in WFI by default, and an idle=nop + that the boot loader appends is ignored, because the + kernel preserves the registers WFI loses there. With + this flag idle=nop spins the idle loop as elsewhere. + apparmor= [APPARMOR] Disable or enable AppArmor at boot time Format: { "0" | "1" } See security/apparmor/Kconfig help text diff --git a/arch/arm64/kernel/idle.c b/arch/arm64/kernel/idle.c index 267677adc220a..0d76030f78205 100644 --- a/arch/arm64/kernel/idle.c +++ b/arch/arm64/kernel/idle.c @@ -50,6 +50,18 @@ early_param("idle", setup_idle); * yet, so it is a plain flag. */ static bool apple_wfi_loses_regs __ro_after_init; +static bool apple_keep_idle_nop __initdata; + +/* + * The boot loader appends idle=nop after the user's arguments, so it cannot + * be overridden on the command line. This flag keeps it anyway. + */ +static int __init setup_apple_keep_idle_nop(char *arg) +{ + apple_keep_idle_nop = true; + return 0; +} +early_param("apple_keep_idle_nop", setup_apple_keep_idle_nop); void __init apple_wfi_quirk_init(void) { @@ -60,14 +72,17 @@ void __init apple_wfi_quirk_init(void) pr_info("Apple: preserving registers across WFI\n"); } /* - * aura passes idle=nop on M5 for kernels without this quirk. Spinning - * idle keeps all ten cores busy (cpuidle's WFI state spins too), and - * the SoC sits near 90 C and throttles; WFI is safe here. + * aura (J813) and m1n1 (T6050) pass idle=nop on M4 and later for + * kernels without this quirk. Spinning idle keeps every core busy + * (cpuidle's WFI states spin too): on T8142 the SoC sits near 90 C + * and throttles, on T6050 the system draws about 10 W more at idle. + * WFI is safe here. */ - if (idle == ARM64_IDLE_NOP && - (model == MIDR_APPLE_T8142_E || model == MIDR_APPLE_T8142_P)) { + if (idle == ARM64_IDLE_NOP && !apple_keep_idle_nop && + (model == MIDR_APPLE_T8142_E || model == MIDR_APPLE_T8142_P || + model == MIDR_APPLE_T6050_064 || model == MIDR_APPLE_T6050_065)) { idle = ARM64_IDLE_WFI; - pr_info("Apple: T8142 idles in WFI, ignoring idle=nop\n"); + pr_info("Apple: idling in WFI, ignoring idle=nop\n"); } }