From owner-freebsd-sparc64@FreeBSD.ORG Mon Oct 31 19:45:03 2011 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE500106564A; Mon, 31 Oct 2011 19:45:03 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 128378FC18; Mon, 31 Oct 2011 19:45:02 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p9VJj2Ex034493; Mon, 31 Oct 2011 20:45:02 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p9VJj2V8034492; Mon, 31 Oct 2011 20:45:02 +0100 (CET) (envelope-from marius) Date: Mon, 31 Oct 2011 20:45:02 +0100 From: Marius Strobl To: Edward Tomasz Napiera?a Message-ID: <20111031194501.GA34421@alchemy.franken.de> References: <52DDA484-9D3D-4305-9692-ADBD7C68BD0B@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52DDA484-9D3D-4305-9692-ADBD7C68BD0B@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-sparc64@freebsd.org Subject: Re: Fixing bus_dma_tag_create(NULL, ?). X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 19:45:03 -0000 On Mon, Oct 31, 2011 at 02:52:58PM +0100, Edward Tomasz Napiera?a wrote: > On sparc64, calling bus_dma_tag_create(9) with NULL tag will result in instant > panic due to KASSERT. Patch below fixes all the instances I could find. It also fixes > several places unrelated to sparc64, just to give a good example. > > Now, the problem is - the changes are trivial and mechanical, but I have no way > to test most of it, simply because I don't have hardware handled by these drivers. > And I'm not really sure how to proceed from this point. Any ideas? > > Patch can be found at: > > http://people.freebsd.org/~trasz/sparc64-bus_dma_tag_create.diff > I prefer to leave the NULL parent tag usage in as a marker that a driver hasn't been reviewed and fixed to also work on !x86 as typically drivers only written with x86 in mind also have other bus_dma(9) and endianness related bugs, miss bus barriers, have alignment issues or even aren't actually 64-bit clean etc. Also I think it's better that a users gets a clean panic when trying to use such a driver than a randomly broken driver that could cause data corruption etc. I won't stop you from committing that patch though. It certainly doesn't matter to commit it untested for asr(4), which likely will be i386-only forever, as well as blkfront(4) and ndis(4). Marius