From 9b3c5afc00ebbc22c0d5b400bfb8ed8946fe67d1 Mon Sep 17 00:00:00 2001 From: Sukumar Ghorai Date: Thu, 7 Dec 2023 18:33:43 -0800 Subject: [PATCH] acpi: Reduce wait interval in delay loop for sleep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The optimization of sleep time in acpi code includes reducing the sleep duration and increasing the polling frequency within the acpi _ON/_OFF method. StorageD3Enable is activated in Google/Rex, and this optimization results in a saving of approximately 25ms in D3cold resume time, reducing it from around 160ms to 135ms. BUG=b:296206467 BRANCH=firmware-rex-15709.B TEST=boot test verified on google/rex verified _ON/_OFF Method in SSDT. verifid kernel log in s0ix test - 0000:00:06.0: PM: pci_pm_resume_noirq Change-Id: I7ba960cb78b42ff0108a48f00206b6df0c78ce7a Signed-off-by: Sukumar Ghorai Reviewed-on: https://review.coreboot.org/c/coreboot/+/79414 Tested-by: build bot (Jenkins) Reviewed-by: Jakub Czapiga Reviewed-by: Subrata Banik Reviewed-by: Jérémy Compostella --- src/acpi/acpigen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index ac95026562..64ec7343e1 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -2459,10 +2459,10 @@ void acpigen_write_delay_until_namestr_int(uint32_t wait_ms, const char *name, u uint32_t wait_ms_segment = 1; uint32_t segments = wait_ms; - /* Sleep in 16ms segments if delay is more than 32ms. */ - if (wait_ms > 32) { - wait_ms_segment = 16; - segments = wait_ms / 16; + /* Sleep in 2ms segments if delay is more than 2ms. */ + if (wait_ms > 2) { + wait_ms_segment = 2; + segments = wait_ms / wait_ms_segment; } acpigen_write_store_int_to_op(segments, LOCAL7_OP);