From owner-svn-src-all@freebsd.org Mon Dec 17 07:09:47 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 436D21331761; Mon, 17 Dec 2018 07:09:47 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7BCF86904; Mon, 17 Dec 2018 07:09:46 +0000 (UTC) (envelope-from grog@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 C989CB6DE; Mon, 17 Dec 2018 07:09:46 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH79krM043197; Mon, 17 Dec 2018 07:09:46 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH79kkG043196; Mon, 17 Dec 2018 07:09:46 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201812170709.wBH79kkG043196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Mon, 17 Dec 2018 07:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342160 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 342160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7BCF86904 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 17 Dec 2018 07:09:47 -0000 Author: grog Date: Mon Dec 17 07:09:46 2018 New Revision: 342160 URL: https://svnweb.freebsd.org/changeset/base/342160 Log: Work around BIOS quirks on HPE Proliant MicroServer Gen10 PR: 221350 Submitted by: Bob Bishop Reported by: Rafal Lukawiecki Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Dec 17 07:03:36 2018 (r342159) +++ head/sys/dev/pci/pci.c Mon Dec 17 07:09:46 2018 (r342160) @@ -230,6 +230,7 @@ struct pci_quirk { #define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ #define PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */ #define PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */ +#define PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */ int arg1; int arg2; }; @@ -311,6 +312,12 @@ static const struct pci_quirk pci_quirks[] = { { 0x167814e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715 */ { 0x167914e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715S */ + /* + * HPE Gen 10 VGA has a memory range that can't be allocated in the + * expected place. + */ + { 0x98741002, PCI_QUIRK_REALLOC_BAR, 0, 0 }, + { 0 } }; @@ -3283,7 +3290,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struc */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, flags); - if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) { + if ((pci_do_realloc_bars + || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR)) + && res == NULL && (start != 0 || end != ~0)) { /* * If the allocation fails, try to allocate a resource for * this BAR using any available range. The firmware felt