From owner-svn-src-stable@freebsd.org Sat Jul 23 22:51:00 2016 Return-Path: Delivered-To: svn-src-stable@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 6827ABA39DE; Sat, 23 Jul 2016 22:51:00 +0000 (UTC) (envelope-from jhb@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 205F31195; Sat, 23 Jul 2016 22:51:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6NMoxPA061468; Sat, 23 Jul 2016 22:50:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6NMoxrp061467; Sat, 23 Jul 2016 22:50:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607232250.u6NMoxrp061467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 23 Jul 2016 22:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r303252 - in stable: 10/sys/dev/acpica/Osd 9/sys/dev/acpica/Osd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2016 22:51:00 -0000 Author: jhb Date: Sat Jul 23 22:50:59 2016 New Revision: 303252 URL: https://svnweb.freebsd.org/changeset/base/303252 Log: MFC 299977: Use polling spin loops for timeouts during early boot. Some ACPI operations such as mutex acquires and event waits accept a timeout. The ACPI OSD layer implements these timeouts by using regular sleep timeouts. However, this doesn't work during early boot before event timers are setup. Instead, use polling combined with DELAY() to spin. This fixes booting on upcoming Intel systems with Kaby Lake processors. Modified: stable/10/sys/dev/acpica/Osd/OsdSynch.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/acpica/Osd/OsdSynch.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- stable/10/sys/dev/acpica/Osd/OsdSynch.c Sat Jul 23 21:56:52 2016 (r303251) +++ stable/10/sys/dev/acpica/Osd/OsdSynch.c Sat Jul 23 22:50:59 2016 (r303252) @@ -188,6 +188,23 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl } break; default: + if (cold) { + /* + * Just spin polling the semaphore once a + * millisecond. + */ + while (!ACPISEM_AVAIL(as, Units)) { + if (Timeout == 0) { + status = AE_TIME; + break; + } + Timeout--; + mtx_unlock(&as->as_lock); + DELAY(1000); + mtx_lock(&as->as_lock); + } + break; + } tmo = timeout2hz(Timeout); while (!ACPISEM_AVAIL(as, Units)) { prevtick = ticks; @@ -381,6 +398,23 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI } break; default: + if (cold) { + /* + * Just spin polling the mutex once a + * millisecond. + */ + while (!ACPIMTX_AVAIL(am)) { + if (Timeout == 0) { + status = AE_TIME; + break; + } + Timeout--; + mtx_unlock(&am->am_lock); + DELAY(1000); + mtx_lock(&am->am_lock); + } + break; + } tmo = timeout2hz(Timeout); while (!ACPIMTX_AVAIL(am)) { prevtick = ticks;