From owner-svn-src-head@freebsd.org Thu May 3 19:00:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DE66FB6200; Thu, 3 May 2018 19:00:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390688C25C; Thu, 3 May 2018 19:00:51 +0000 (UTC) (envelope-from jkim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3401C23D1D; Thu, 3 May 2018 19:00:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w43J0pbm049694; Thu, 3 May 2018 19:00:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w43J0olU049691; Thu, 3 May 2018 19:00:50 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201805031900.w43J0olU049691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 3 May 2018 19:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333222 - in head/sys: dev/acpica dev/acpica/Osd x86/acpica X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys: dev/acpica dev/acpica/Osd x86/acpica X-SVN-Commit-Revision: 333222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 19:00:51 -0000 Author: jkim Date: Thu May 3 19:00:50 2018 New Revision: 333222 URL: https://svnweb.freebsd.org/changeset/base/333222 Log: Redo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce. AcpiOsEnterSleep() was meant to implement this feature. Reviewed by: avg Modified: head/sys/dev/acpica/Osd/OsdHardware.c head/sys/dev/acpica/acpi.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 18:20:35 2018 (r333221) +++ head/sys/dev/acpica/Osd/OsdHardware.c Thu May 3 19:00:50 2018 (r333222) @@ -37,9 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +extern int acpi_susp_bounce; + ACPI_STATUS AcpiOsEnterSleep(UINT8 SleepState, UINT32 RegaValue, UINT32 RegbValue) { + + /* If testing device suspend only, back out of everything here. */ + if (acpi_susp_bounce) + return (AE_CTRL_TERMINATE); return (AE_OK); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu May 3 18:20:35 2018 (r333221) +++ head/sys/dev/acpica/acpi.c Thu May 3 19:00:50 2018 (r333222) @@ -287,15 +287,10 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, default_register_wid /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); -static int acpi_susp_bounce; +int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); -int acpi_susp_deep_bounce; -SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_deep_bounce, CTLFLAG_RW, - &acpi_susp_deep_bounce, 0, "Don't actually suspend, " - "bail out just before entering the sleep state."); - /* * ACPI can only be loaded as a module by the loader; activating it after * system bootstrap time is not useful, and can be fatal to the system. @@ -2951,10 +2946,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state) goto backout; } slp_state = ACPI_SS_DEV_SUSPEND; - - /* If testing device suspend only, back out of everything here. */ - if (acpi_susp_bounce) - goto backout; status = AcpiEnterSleepStatePrep(state); if (ACPI_FAILURE(status)) { Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Thu May 3 18:20:35 2018 (r333221) +++ head/sys/x86/acpica/acpi_wakeup.c Thu May 3 19:00:50 2018 (r333222) @@ -79,7 +79,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); extern int acpi_resume_beep; extern int acpi_reset_video; -extern int acpi_susp_deep_bounce; +extern int acpi_susp_bounce; #ifdef SMP extern struct susppcb **susppcbs; @@ -277,9 +277,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) PTD[KPTDI] = PTD[LOWPTDI]; #endif - if (acpi_susp_deep_bounce) - resumectx(pcb); - /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); @@ -291,6 +288,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) AcpiFormatException(status)); return (0); /* couldn't sleep */ } + + if (acpi_susp_bounce) + resumectx(pcb); for (;;) ia32_pause();