From owner-svn-src-stable-11@freebsd.org Tue May 30 13:26:38 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E01B7CE91; Tue, 30 May 2017 13:26:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29D813CD; Tue, 30 May 2017 13:26:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UDQbsM012953; Tue, 30 May 2017 13:26:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UDQbdq012949; Tue, 30 May 2017 13:26:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201705301326.v4UDQbdq012949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 May 2017 13:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319207 - in stable/11/sys: arm64/arm64 conf dev/psci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 13:26:39 -0000 Author: andrew Date: Tue May 30 13:26:37 2017 New Revision: 319207 URL: https://svnweb.freebsd.org/changeset/base/319207 Log: MFC r317361: Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB the kernel calls this directly so the event handler is not called, meaning the computer fails to reboot. Modified: stable/11/sys/arm64/arm64/vm_machdep.c stable/11/sys/conf/options.arm64 stable/11/sys/dev/psci/psci.c stable/11/sys/dev/psci/psci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/vm_machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/vm_machdep.c Tue May 30 13:21:43 2017 (r319206) +++ stable/11/sys/arm64/arm64/vm_machdep.c Tue May 30 13:26:37 2017 (r319207) @@ -25,6 +25,8 @@ * */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -52,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DEV_PSCI +#include +#endif + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -112,7 +118,11 @@ void cpu_reset(void) { - printf("cpu_reset"); +#ifdef DEV_PSCI + psci_reset(); +#endif + + printf("cpu_reset failed"); while(1) __asm volatile("wfi" ::: "memory"); } Modified: stable/11/sys/conf/options.arm64 ============================================================================== --- stable/11/sys/conf/options.arm64 Tue May 30 13:21:43 2017 (r319206) +++ stable/11/sys/conf/options.arm64 Tue May 30 13:26:37 2017 (r319207) @@ -7,6 +7,8 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h +DEV_PSCI opt_platform.h + # SoC Support SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h Modified: stable/11/sys/dev/psci/psci.c ============================================================================== --- stable/11/sys/dev/psci/psci.c Tue May 30 13:21:43 2017 (r319206) +++ stable/11/sys/dev/psci/psci.c Tue May 30 13:26:37 2017 (r319207) @@ -221,6 +221,13 @@ psci_shutdown(void *xsc, int howto) /* System reset and off do not return. */ } +void +psci_reset(void) +{ + + psci_shutdown(NULL, 0); +} + static int psci_v0_1_init(device_t dev) { Modified: stable/11/sys/dev/psci/psci.h ============================================================================== --- stable/11/sys/dev/psci/psci.h Tue May 30 13:21:43 2017 (r319206) +++ stable/11/sys/dev/psci/psci.h Tue May 30 13:26:37 2017 (r319207) @@ -36,7 +36,7 @@ typedef int (*psci_callfn_t)(register_t, register_t, r extern int psci_present; -void psci_system_reset(void); +void psci_reset(void); int psci_cpu_on(unsigned long, unsigned long, unsigned long); int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t);