From owner-svn-src-all@freebsd.org Thu Nov 2 04:07:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA584E4E095; Thu, 2 Nov 2017 04:07:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id A45616BB5B; Thu, 2 Nov 2017 04:07:42 +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 vA247fTh095487; Thu, 2 Nov 2017 04:07:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA247fSi095484; Thu, 2 Nov 2017 04:07:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711020407.vA247fSi095484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 2 Nov 2017 04:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325305 - head/sys/dev/dpaa X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/dpaa X-SVN-Commit-Revision: 325305 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.23 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: Thu, 02 Nov 2017 04:07:43 -0000 Author: jhibbits Date: Thu Nov 2 04:07:41 2017 New Revision: 325305 URL: https://svnweb.freebsd.org/changeset/base/325305 Log: Fix interrupt handling for dtsec The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit number, which may not match the cell index. MFC after: 1 week Modified: head/sys/dev/dpaa/if_dtsec.c head/sys/dev/dpaa/if_dtsec.h head/sys/dev/dpaa/if_dtsec_fdt.c Modified: head/sys/dev/dpaa/if_dtsec.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec.c Thu Nov 2 04:05:03 2017 (r325304) +++ head/sys/dev/dpaa/if_dtsec.c Thu Nov 2 04:07:41 2017 (r325305) @@ -578,8 +578,6 @@ dtsec_attach(device_t dev) parent = device_get_parent(dev); sc->sc_dev = dev; sc->sc_mac_mdio_irq = NO_IRQ; - sc->sc_eth_id = device_get_unit(dev); - /* Check if MallocSmart allocator is ready */ if (XX_MallocSmartInit() != E_OK) Modified: head/sys/dev/dpaa/if_dtsec.h ============================================================================== --- head/sys/dev/dpaa/if_dtsec.h Thu Nov 2 04:05:03 2017 (r325304) +++ head/sys/dev/dpaa/if_dtsec.h Thu Nov 2 04:07:41 2017 (r325305) @@ -66,7 +66,7 @@ struct dtsec_softc { /* dTSEC data */ enum eth_dev_type sc_eth_dev_type; - uint8_t sc_eth_id; + uint8_t sc_eth_id; /* Ethernet ID within its frame manager */ uintptr_t sc_mac_mem_offset; e_EnetMode sc_mac_enet_mode; int sc_mac_mdio_irq; Modified: head/sys/dev/dpaa/if_dtsec_fdt.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_fdt.c Thu Nov 2 04:05:03 2017 (r325304) +++ head/sys/dev/dpaa/if_dtsec_fdt.c Thu Nov 2 04:07:41 2017 (r325305) @@ -136,7 +136,7 @@ dtsec_fdt_attach(device_t dev) phandle_t enet_node, phy_node; phandle_t fman_rxtx_node[2]; char phy_type[6]; - pcell_t fman_tx_cell; + pcell_t fman_tx_cell, mac_id; int rid; sc = device_get_softc(dev); @@ -191,6 +191,11 @@ dtsec_fdt_attach(device_t dev) sc->sc_mac_enet_mode = e_ENET_MODE_XGMII_10000; else return (ENXIO); + + if (OF_getencprop(enet_node, "cell-index", + (void *)&mac_id, sizeof(mac_id)) <= 0) + return (ENXIO); + sc->sc_eth_id = mac_id; /* Get RX/TX port handles */ if (OF_getprop(enet_node, "fsl,fman-ports", (void *)fman_rxtx_node,