diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2019-07-25 02:00:40 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2019-07-25 02:00:40 +0000 |
| commit | 47e21d79d7368af07e73a6587fbd85da111aeff5 (patch) | |
| tree | adce33a7d8c94280116af4ffb438a2fff7933396 /sys | |
| parent | f7848a949c291a713fa44438ae58e617e36e5b54 (diff) | |
Only try to call EFI RT's reset once. If it faults for some reason, just
return an error so the kernel will try to PSCI reset instead. Otherwise
we get stuck in an endless loop..
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/arm/arm/efi_runtime.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/arm/arm/efi_runtime.c b/sys/arch/arm/arm/efi_runtime.c index 10582d73ba8..8d794ce3f40 100644 --- a/sys/arch/arm/arm/efi_runtime.c +++ b/sys/arch/arm/arm/efi_runtime.c @@ -1,4 +1,4 @@ -/* $NetBSD: efi_runtime.c,v 1.1 2018/10/28 10:21:42 jmcneill Exp $ */ +/* $NetBSD: efi_runtime.c,v 1.2 2019/07/25 02:00:40 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.1 2018/10/28 10:21:42 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.2 2019/07/25 02:00:40 jmcneill Exp $"); #include <sys/param.h> #include <sys/mutex.h> @@ -113,13 +113,19 @@ arm_efirt_settime(struct efi_tm *tm) int arm_efirt_reset(enum efi_reset type) { + static int reset_called = false; efi_status status; if (RT == NULL || RT->rt_reset == NULL) return ENXIO; mutex_enter(&efi_lock); - status = RT->rt_reset(type, 0, 0, NULL); + if (reset_called == false) { + reset_called = true; + status = RT->rt_reset(type, 0, 0, NULL); + } else { + status = 1; + } mutex_exit(&efi_lock); if (status) return EIO; |
