From: Denis Mukhin <[email protected]> 

Use cpu_hlt() instead of open-coded "hlt" in pch_sysreset_power_off().

Also, replace the open-coded busy loop in efi_reset_system() and use
cpu_hlt().

Signed-off-by: Denis Mukhin <[email protected]>
---
Changes since v2:
- n/a

Changes since v1:
- dropped unneeded #include
- corrected the commit message
---
 drivers/sysreset/sysreset_x86.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sysreset/sysreset_x86.c b/drivers/sysreset/sysreset_x86.c
index c2f28c65280f..afb77d9c5c21 100644
--- a/drivers/sysreset/sysreset_x86.c
+++ b/drivers/sysreset/sysreset_x86.c
@@ -65,7 +65,7 @@ int pch_sysreset_power_off(struct udevice *dev)
        outl(reg32, pm.base + pm.pm1_cnt_ofs);
 
        for (;;)
-               asm("hlt");
+               cpu_hlt();
 }
 
 static int x86_sysreset_request(struct udevice *dev, enum sysreset_t type)
@@ -120,7 +120,8 @@ void __efi_runtime EFIAPI efi_reset_system(
 
        /* TODO EFI_RESET_SHUTDOWN */
 
-       while (1) { }
+       for (;;)
+               cpu_hlt();
 }
 #endif
 
-- 
2.54.0

Reply via email to