From owner-svn-src-head@freebsd.org Fri Jun 15 18:55:03 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 5C2F010184B3; Fri, 15 Jun 2018 18:55:03 +0000 (UTC) (envelope-from jhibbits@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 0B5B77DF1F; Fri, 15 Jun 2018 18:55:03 +0000 (UTC) (envelope-from jhibbits@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 D811D1B69E; Fri, 15 Jun 2018 18:55:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FIt2aO090778; Fri, 15 Jun 2018 18:55:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FIt2Qo090777; Fri, 15 Jun 2018 18:55:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806151855.w5FIt2Qo090777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 15 Jun 2018 18:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335226 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335226 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.26 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: Fri, 15 Jun 2018 18:55:03 -0000 Author: jhibbits Date: Fri Jun 15 18:55:02 2018 New Revision: 335226 URL: https://svnweb.freebsd.org/changeset/base/335226 Log: Check for a 'pci' prefix rather than a full match in get_addr_props Summary: Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for device_type, not 'pci'. Rather than enumerating all possible variants, just check for a 'pci' prefix. Reviewed by: nwhitehorn, breno.leitao_gmail.com Differential Revision: https://reviews.freebsd.org/D15817 Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Fri Jun 15 18:50:24 2018 (r335225) +++ head/sys/dev/ofw/ofw_subr.c Fri Jun 15 18:55:02 2018 (r335226) @@ -61,7 +61,9 @@ get_addr_props(phandle_t node, uint32_t *addrp, uint32 res = OF_getprop(node, "device_type", type, sizeof(type)); if (res != -1) { type[sizeof(type) - 1] = '\0'; - pci = (strcmp(type, "pci") == 0) ? 1 : 0; + if (strcmp(type, "pci") == 0 || + strcmp(type, "pciex")== 0) + pci = 1; } } if (addrp != NULL)