summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2019-07-25 02:00:40 +0000
committerjmcneill <jmcneill@NetBSD.org>2019-07-25 02:00:40 +0000
commit47e21d79d7368af07e73a6587fbd85da111aeff5 (patch)
treeadce33a7d8c94280116af4ffb438a2fff7933396 /sys
parentf7848a949c291a713fa44438ae58e617e36e5b54 (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.c12
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;