From owner-svn-src-all@FreeBSD.ORG Mon Jan 5 21:39:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75A4AF5; Mon, 5 Jan 2015 21:39:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5652D64471; Mon, 5 Jan 2015 21:39:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t05LdbFg058334; Mon, 5 Jan 2015 21:39:37 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t05LdaFd058332; Mon, 5 Jan 2015 21:39:36 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501052139.t05LdaFd058332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 5 Jan 2015 21:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276726 - in head/sys: dev/ofw powerpc/pseries X-SVN-Group: head 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.18-1 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, 05 Jan 2015 21:39:37 -0000 Author: nwhitehorn Date: Mon Jan 5 21:39:35 2015 New Revision: 276726 URL: https://svnweb.freebsd.org/changeset/base/276726 Log: Restore use of ofw_bus_intr_to_rl() in the pseries vdevice driver after fixing ofw_bus_intr_to_rl() to match the spec for unspecified interrupt-parent properties. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/powerpc/pseries/vdevice.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Mon Jan 5 20:50:44 2015 (r276725) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Jan 5 21:39:35 2015 (r276726) @@ -382,9 +382,17 @@ ofw_bus_intr_to_rl(device_t dev, phandle if (nintr > 0) { if (OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming direct parent\n"); - iparent = OF_parent(node); + for (iparent = node; iparent != 0; + iparent = OF_parent(node)) { + if (OF_hasprop(iparent, "interrupt-controller")) + break; + } + if (iparent == 0) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + iparent = OF_xref_from_node(iparent); } if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { @@ -430,3 +438,4 @@ ofw_bus_intr_to_rl(device_t dev, phandle free(intr, M_OFWPROP); return (err); } + Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Mon Jan 5 20:50:44 2015 (r276725) +++ head/sys/powerpc/pseries/vdevice.c Mon Jan 5 21:39:35 2015 (r276726) @@ -128,12 +128,14 @@ vdevice_attach(device_t dev) { phandle_t root, child; device_t cdev; - int icells, i, nintr, *intr; - phandle_t iparent; struct vdevice_devinfo *dinfo; root = ofw_bus_get_node(dev); + /* The XICP (root PIC) will handle all our interrupts */ + powerpc_register_pic(root_pic, OF_xref_from_node(root), + 1 << 24 /* 24-bit XIRR field */, 1 /* Number of IPIs */, FALSE); + for (child = OF_child(root); child != 0; child = OF_peer(child)) { dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); @@ -144,25 +146,7 @@ vdevice_attach(device_t dev) } resource_list_init(&dinfo->mdi_resources); - if (OF_searchprop(child, "#interrupt-cells", &icells, - sizeof(icells)) <= 0) - icells = 2; - if (OF_getprop(child, "interrupt-parent", &iparent, - sizeof(iparent)) <= 0) - iparent = -1; - nintr = OF_getprop_alloc(child, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - for (i = 0; i < nintr; i += icells) { - u_int irq = intr[i]; - if (iparent != -1) - irq = ofw_bus_map_intr(dev, iparent, - icells, &intr[i]); - - resource_list_add(&dinfo->mdi_resources, - SYS_RES_IRQ, i, irq, irq, i); - } - } + ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources); cdev = device_add_child(dev, NULL, -1); if (cdev == NULL) {