Skip to contentSkip to conversation

reset: small cleanups for x86

PATCH In review Denis Mukhin via U-Boot 3 participants 5 messages Jul 29 – Aug 20

lore
Share & tools
lore
#0 lore raw

cover reset: small cleanups for x86

This is small cleanup series for x86 reset device driver.

Patch 1 introduces a small fixup for the x86 reset driver. Patch 2 introduces a small fixup for the x86 EFI reset driver.

Denis Mukhin (2):
reset: x86: Use cpu_hlt() in pch_sysreset_power_off()
reset: x86: Use cpu_hlt() in efi_reset_system()

 drivers/sysreset/sysreset_x86.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH 1/2 reset: x86: Use cpu_hlt() in pch_sysreset_power_off()

From: Denis Mukhin <[email protected]>

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

---
Original patch: https://lore.kernel.org/u-boot/[email protected]/

---
 drivers/sysreset/sysreset_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/sysreset/sysreset_x86.c +1 -1
index c2f28c65280f..05a3ff9c8363 100644
@@ -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)
Signature · 1 line
2.54.0
#2 lore raw

PATCH 2/2 reset: x86: Use cpu_hlt() in efi_reset_system()

In reply to Denis Mukhin via U-Boot

From: Denis Mukhin <[email protected]>

Use cpu_hlt() in busy loop in efi_reset_system() similarly to pch_sysreset_power_off().

Note, this is safe for __efi_runtime-annotated efi_reset_system(), because cpu_hlt() expands to a bare "hlt".

---
Original patch: https://lore.kernel.org/u-boot/[email protected]/

---
 drivers/sysreset/sysreset_x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/sysreset/sysreset_x86.c +2 -1
index 05a3ff9c8363..afb77d9c5c21 100644
@@ -120,7 +120,8 @@ void __efi_runtime EFIAPI efi_reset_system(
 
 	/* TODO EFI_RESET_SHUTDOWN */
 
-	while (1) { }
+	for (;;)
+		cpu_hlt();
 }
 #endif
 
Signature · 1 line
2.54.0
#3 lore raw
In reply to Denis Mukhin via U-Boot
Quoted 11 lines · Denis Mukhin via U-Boot

This is small cleanup series for x86 reset device driver.

Patch 1 introduces a small fixup for the x86 reset driver. Patch 2 introduces a small fixup for the x86 EFI reset driver.

Denis Mukhin (2):
reset: x86: Use cpu_hlt() in pch_sysreset_power_off()
reset: x86: Use cpu_hlt() in efi_reset_system()

 drivers/sysreset/sysreset_x86.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Just following up on that mini-cleanup series.

This is re-submission of the reviewed patches originally posted here:

https://lore.kernel.org/u-boot/[email protected]/
https://lore.kernel.org/u-boot/[email protected]/

Thanks,
Denis

#4 lore raw

Hi Denis,

Quoted 14 lines · On Tue, 18 Aug 2026 at 14:05, <[email protected]> wrote:
Quoted 11 lines · Denis Mukhin via U-Boot

This is small cleanup series for x86 reset device driver.

Patch 1 introduces a small fixup for the x86 reset driver. Patch 2 introduces a small fixup for the x86 EFI reset driver.

Denis Mukhin (2):
reset: x86: Use cpu_hlt() in pch_sysreset_power_off()
reset: x86: Use cpu_hlt() in efi_reset_system()

 drivers/sysreset/sysreset_x86.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 6 lines

Just following up on that mini-cleanup series.

This is re-submission of the reviewed patches originally posted here:

https://lore.kernel.org/u-boot/[email protected]/
https://lore.kernel.org/u-boot/[email protected]/

Yes, I have reviewed these.

Regards,
Simon