From owner-freebsd-current@FreeBSD.ORG Mon Oct 2 21:17:59 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0168D16A4CA; Mon, 2 Oct 2006 21:17:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2ACF43D64; Mon, 2 Oct 2006 21:17:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k92LHaxx019899; Mon, 2 Oct 2006 17:17:36 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ariff Abdullah Date: Mon, 2 Oct 2006 17:12:37 -0400 User-Agent: KMail/1.9.1 References: <59493.1159791753@critter.freebsd.dk> <200610021500.00727.jhb@freebsd.org> <20061003043453.334093bd.ariff@FreeBSD.org> In-Reply-To: <20061003043453.334093bd.ariff@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610021712.38017.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 02 Oct 2006 17:17:38 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1976/Mon Oct 2 16:33:20 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: phk@phk.freebsd.dk, freebsd-current@freebsd.org Subject: Re: sound/driver/hda and ia64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2006 21:17:59 -0000 On Monday 02 October 2006 16:34, Ariff Abdullah wrote: > On Mon, 2 Oct 2006 14:59:59 -0400 > John Baldwin wrote: > > On Monday 02 October 2006 08:50, Ariff Abdullah wrote: > > > On Mon, 02 Oct 2006 12:22:33 +0000 > > > Poul-Henning Kamp wrote: > > > > > > > > During a "make universe" ia64 fails with the following errors. > > > > > > > > I wouldn't expect a sound driver to call any of those functions > > > > at all, what's going on ? > > > > > > > > > [....] > > > > > > > > > > I wish BUS_DMA_NOCACHE has real meaning (like what NetBSD did) > > > since uncached DMA is pretty much guarantee to make the driver > > > works on broken i386/amd86 hardwares. > > > > > > Should we just narrow this down to i386/amd64 , or give > > > BUS_DMA_NOCACHE a real meaning as part of bus_dmamem_alloc() ? > > > > > > I'm open for suggestion. > > > > I can probably fix NOCACHE for i386/amd64 for the bus_dmamem_alloc() > > case. Try this patch: > > > > --- //depot/vendor/freebsd/src/sys/amd64/amd64/busdma_machdep.c 2006/06/01 > > 04:50:42 > > +++ //depot/user/jhb/acpipci/amd64/amd64/busdma_machdep.c 2006/10/02 18:58:21 > > @@ -48,6 +48,7 @@ > > #include > > #include > > #include > > +#include > > > > #define MAX_BPAGES 8192 > > > > @@ -522,6 +523,9 @@ > > } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { > > printf("bus_dmamem_alloc failed to align memory properly."); > > } > > + if (flags & BUS_DMA_NOCACHE) > > + pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, > > + PAT_UNCACHEABLE); > > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", > > __func__, dmat, dmat->flags, ENOMEM); > > return (0); > > --- //depot/vendor/freebsd/src/sys/i386/i386/busdma_machdep.c 2006/09/26 > > 23:16:33 > > +++ //depot/user/jhb/acpipci/i386/i386/busdma_machdep.c 2006/10/02 18:58:21 > > @@ -51,6 +51,7 @@ > > #include > > #include > > #include > > +#include > > > > #define MAX_BPAGES 512 > > #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 > > @@ -530,6 +531,9 @@ > > } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { > > printf("bus_dmamem_alloc failed to align memory > > properly.\n"); > > } > > + if (flags & BUS_DMA_NOCACHE) > > + pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, > > + PAT_UNCACHEABLE); > > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", > > __func__, dmat, dmat->flags, ENOMEM); > > return (0); > > > > > I guess these are what we're looking for. I can't tell whether it > really works or not (finding such buggy hardware is quite difficult), > but this will make lot of things easier for drivers. > > Any objections? I guess you should go ahead, John. It needs testing. :) Can you find a victim? -- John Baldwin