From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 22:09:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E88CA1065670; Wed, 19 Nov 2008 22:09:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8DAD8FC14; Wed, 19 Nov 2008 22:09:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJM93sc029940; Wed, 19 Nov 2008 22:09:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAJM933q029939; Wed, 19 Nov 2008 22:09:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200811192209.mAJM933q029939@svn.freebsd.org> From: Marius Strobl Date: Wed, 19 Nov 2008 22:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185108 - head/sys/dev/dcons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 19 Nov 2008 22:09:04 -0000 Author: marius Date: Wed Nov 19 22:09:03 2008 New Revision: 185108 URL: http://svn.freebsd.org/changeset/base/185108 Log: Given that the buffer dcons_crom(4) exposes is used for both input and output, set BUS_DMA_COHERENT when creating the DMA map used for loading the buffer. As a side-effect this solves locking issues on sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt filter, which are executed in a critical section, and iommu(4) has to use a sleep lock when taking advantage of the streaming buffer. Reported and tested by: kensmith Approved by: simokawa Modified: head/sys/dev/dcons/dcons_crom.c Modified: head/sys/dev/dcons/dcons_crom.c ============================================================================== --- head/sys/dev/dcons/dcons_crom.c Wed Nov 19 21:12:26 2008 (r185107) +++ head/sys/dev/dcons/dcons_crom.c Wed Nov 19 22:09:03 2008 (r185108) @@ -229,7 +229,7 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, 0, &sc->dma_map); + bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0);