From owner-svn-src-all@freebsd.org Sat Apr 28 00:16:55 2018 Return-Path: Delivered-To: svn-src-all@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 97F0FFB52EA; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@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 37872824DA; Sat, 28 Apr 2018 00:16:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BC925E43; Sat, 28 Apr 2018 00:16:55 +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 w3S0Gt9e038380; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3S0GtXH038379; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804280016.w3S0GtXH038379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Apr 2018 00:16:55 +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: r333080 - in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Commit-Revision: 333080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 00:16:55 -0000 Author: jhb Date: Sat Apr 28 00:16:54 2018 New Revision: 333080 URL: https://svnweb.freebsd.org/changeset/base/333080 Log: MFC 332733: Workaround fixed I/O port resources encoded as I/O port ranges in _CRS. ACPI I/O port descriptors use _MIN and _MAX fields to specify the set of allowable base (start) addresses for an I/O port resource along with a _LEN field specifying the length. A fixed resource is supposed to be encoded with _MIN == _MAX, but some buggy firmwares instead set _MAX to the end of the fixed range. Relocating I/O ranges only make sense in _PRS (possible resource settings), not in _CRS (current resource settings), so if an I/O port range with _MAX set set to the end of the range is present in _CRS, treat it as a fixed I/O port resource starting at _MIN. PR: 224096 Modified: stable/10/sys/dev/acpica/acpi_resource.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi_resource.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_resource.c Fri Apr 27 22:15:18 2018 (r333079) +++ stable/10/sys/dev/acpica/acpi_resource.c Sat Apr 28 00:16:54 2018 (r333080) @@ -515,6 +515,24 @@ acpi_res_set_iorange(device_t dev, void *context, uint if (cp == NULL) return; + + /* + * XXX: Some BIOSes contain buggy _CRS entries where fixed I/O + * ranges have the maximum base address (_MAX) to the end of the + * I/O range instead of the start. These are then treated as a + * relocatable I/O range rather than a fixed I/O resource. As a + * workaround, treat I/O resources encoded this way as fixed I/O + * ports. + */ + if (high == (low + length)) { + if (bootverbose) + device_printf(dev, + "_CRS has fixed I/O port range defined as relocatable\n"); + + bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); + return; + } + device_printf(dev, "I/O range not supported\n"); }