Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 21 additions & 6 deletions arch/arm64/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
}
}

Expand Down
Loading