From owner-svn-src-all@freebsd.org Thu Mar 29 19:48:51 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 701CBF712F6; Thu, 29 Mar 2018 19:48:51 +0000 (UTC) (envelope-from landonf@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 2129680998; Thu, 29 Mar 2018 19:48:51 +0000 (UTC) (envelope-from landonf@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 1C0361E77C; Thu, 29 Mar 2018 19:48:51 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TJmoTu087680; Thu, 29 Mar 2018 19:48:50 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TJmogQ087678; Thu, 29 Mar 2018 19:48:50 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201803291948.w2TJmogQ087678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Thu, 29 Mar 2018 19:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331746 - in head/sys: dev/bhnd/bhndb mips/broadcom X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: dev/bhnd/bhndb mips/broadcom X-SVN-Commit-Revision: 331746 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.25 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, 29 Mar 2018 19:48:51 -0000 Author: landonf Date: Thu Mar 29 19:48:50 2018 New Revision: 331746 URL: https://svnweb.freebsd.org/changeset/base/331746 Log: bhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA translations unsupported by the backplane. Modified: head/sys/dev/bhnd/bhndb/bhndb.c head/sys/mips/broadcom/bhnd_nexus.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Thu Mar 29 19:48:17 2018 (r331745) +++ head/sys/dev/bhnd/bhndb/bhndb.c Thu Mar 29 19:48:50 2018 (r331746) @@ -2128,7 +2128,14 @@ bhndb_get_dma_translation(device_t dev, device_t child if (sc->bus_res->res->dma_tags == NULL) return (ENODEV); - /* Find the best matching descriptor for the requested type */ + /* Is the requested width supported? */ + if (width > BHND_DMA_ADDR_32BIT) { + /* Backplane must support 64-bit addressing */ + if (!(sc->chipid.chip_caps & BHND_CAP_BP64)) + width = BHND_DMA_ADDR_32BIT; + } + + /* Find the best matching descriptor for the requested width */ addr_mask = BHND_DMA_ADDR_BITMASK(width); match = NULL; Modified: head/sys/mips/broadcom/bhnd_nexus.c ============================================================================== --- head/sys/mips/broadcom/bhnd_nexus.c Thu Mar 29 19:48:17 2018 (r331745) +++ head/sys/mips/broadcom/bhnd_nexus.c Thu Mar 29 19:48:50 2018 (r331746) @@ -234,10 +234,11 @@ bhnd_nexus_get_dma_translation(device_t dev, device_t KASSERT(width > 0 && width <= BHND_DMA_ADDR_64BIT, ("invalid width %u", width)); + /* Is the requested width supported? */ if (width > BHND_DMA_ADDR_32BIT) { /* Backplane must support 64-bit addressing */ - if (!(bp->cc_caps & CHIPC_CAP_BKPLN64)) - return (ENOENT); + if (!(bp->cid.chip_caps & BHND_CAP_BP64)) + width = BHND_DMA_ADDR_32BIT; } /* No DMA address translation required */