Module Name: src Committed By: jmcneill Date: Thu Jul 25 02:00:40 UTC 2019
Modified Files: src/sys/arch/arm/arm: efi_runtime.c Log Message: 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.. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm/efi_runtime.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/arm/efi_runtime.c diff -u src/sys/arch/arm/arm/efi_runtime.c:1.1 src/sys/arch/arm/arm/efi_runtime.c:1.2 --- src/sys/arch/arm/arm/efi_runtime.c:1.1 Sun Oct 28 10:21:42 2018 +++ src/sys/arch/arm/arm/efi_runtime.c Thu Jul 25 02:00:40 2019 @@ -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;