From owner-svn-src-head@freebsd.org Thu Dec 6 04:25:13 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 DBBA3130D077; Thu, 6 Dec 2018 04:25:13 +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 811357B7DA; Thu, 6 Dec 2018 04:25:13 +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 6222A1E855; Thu, 6 Dec 2018 04:25:13 +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 wB64PDdi045070; Thu, 6 Dec 2018 04:25:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB64PDrs045069; Thu, 6 Dec 2018 04:25:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201812060425.wB64PDrs045069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 6 Dec 2018 04:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341614 - head/sys/powerpc/powermac X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powermac X-SVN-Commit-Revision: 341614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 811357B7DA X-Spamd-Result: default: False [-0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.45)[-0.445,0]; NEURAL_HAM_LONG(-0.08)[-0.083,0]; NEURAL_HAM_SHORT(-0.12)[-0.115,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 06 Dec 2018 04:25:14 -0000 Author: jhibbits Date: Thu Dec 6 04:25:12 2018 New Revision: 341614 URL: https://svnweb.freebsd.org/changeset/base/341614 Log: powerpc/powermac: Fix macgpio(4) child interrupt resource handling The 'interrupts' property is actually 2 words, not one, on macgpio child nodes. Open Firmware's getprop function might be returning the value copied, not the total size of the property, but FDT's returns the total size. Prior to this patch, this would cause the SYS_RES_IRQ resource list to not be populated when running with the 'usefdt' loader variable set, to convert the OFW device tree to a FDT. Since the property is always 2 words, read both words, and ignore the second. Tested by: Dennis Clarke (previous attempt) MFC after: 2 weeks Modified: head/sys/powerpc/powermac/macgpio.c Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Thu Dec 6 02:38:42 2018 (r341613) +++ head/sys/powerpc/powermac/macgpio.c Thu Dec 6 04:25:12 2018 (r341614) @@ -160,7 +160,7 @@ macgpio_attach(device_t dev) struct macgpio_devinfo *dinfo; phandle_t root, child, iparent; device_t cdev; - uint32_t irq; + uint32_t irq[2]; sc = device_get_softc(dev); root = sc->sc_node = ofw_bus_get_node(dev); @@ -193,13 +193,13 @@ macgpio_attach(device_t dev) resource_list_init(&dinfo->mdi_resources); - if (OF_getencprop(child, "interrupts", &irq, sizeof(irq)) == + if (OF_getencprop(child, "interrupts", irq, sizeof(irq)) == sizeof(irq)) { OF_searchencprop(child, "interrupt-parent", &iparent, sizeof(iparent)); resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ, - 0, MAP_IRQ(iparent, irq), MAP_IRQ(iparent, irq), - 1); + 0, MAP_IRQ(iparent, irq[0]), + MAP_IRQ(iparent, irq[0]), 1); } /* Fix messed-up offsets */