From owner-cvs-src@FreeBSD.ORG Wed Apr 23 20:36:24 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167491065677; Wed, 23 Apr 2008 20:36:24 +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 6DCA08FC19; Wed, 23 Apr 2008 20:36:23 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.1/8.14.1/ALCHEMY.FRANKEN.DE) with ESMTP id m3NKaMrk071957; Wed, 23 Apr 2008 22:36:22 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.1/8.14.1/Submit) id m3NKaMXF071956; Wed, 23 Apr 2008 22:36:22 +0200 (CEST) (envelope-from marius) Date: Wed, 23 Apr 2008 22:36:22 +0200 From: Marius Strobl To: Sam Leffler Message-ID: <20080423203622.GA66545@alchemy.franken.de> References: <200803201619.m2KGJQr7033985@repoman.freebsd.org> <20080412193358.GA44768@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080412193358.GA44768@alchemy.franken.de> User-Agent: Mutt/1.4.2.3i Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/usb ehci.c ohci.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 20:36:24 -0000 On Sat, Apr 12, 2008 at 09:33:58PM +0200, Marius Strobl wrote: > On Thu, Mar 20, 2008 at 04:19:26PM +0000, Sam Leffler wrote: > > sam 2008-03-20 16:19:25 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/usb ehci.c ohci.c > > Log: > > Workaround design botch in usb: blindly mixing bus_dma with PIO does not > > work on architectures with a write-back cache as the PIO writes end up > > in the cache which the sync(BUS_DMASYNC_POSTREAD) in usb_transfer_complete > > then discards; compensate in the xfer methods that do PIO by pushing the > > writes out of the cache before usb_transfer_complete is called. > > > > This fixes USB on xscale and likely other places. > > > > Sponsored by: hobnob > > Reviewed by: cognet, imp > > MFC after: 1 month > > > > Revision Changes Path > > 1.62 +16 -0 src/sys/dev/usb/ehci.c > > 1.171 +16 -0 src/sys/dev/usb/ohci.c > > This causes a crash during boot on sparc64. Looks like map is still > NULL at that point. > Are you ok with the change below or would that also prevent your kludge from taking effect? Marius Index: ehci.c =================================================================== RCS file: /usr/data/bsd/cvs/fbsd/src/sys/dev/usb/ehci.c,v retrieving revision 1.62 diff -u -r1.62 ehci.c --- ehci.c 20 Mar 2008 16:19:25 -0000 1.62 +++ ehci.c 23 Apr 2008 20:23:58 -0000 @@ -664,6 +664,8 @@ usbd_pipe_handle pipe = xfer->pipe; bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag; struct usb_dma_mapping *dmap = &xfer->dmamap; + if (dmap->map == NULL) + return; bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_PREWRITE); } Index: ohci.c =================================================================== RCS file: /usr/data/bsd/cvs/fbsd/src/sys/dev/usb/ohci.c,v retrieving revision 1.171 diff -u -r1.171 ohci.c --- ohci.c 20 Mar 2008 16:19:25 -0000 1.171 +++ ohci.c 21 Apr 2008 19:13:54 -0000 @@ -1571,6 +1571,8 @@ usbd_pipe_handle pipe = xfer->pipe; bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag; struct usb_dma_mapping *dmap = &xfer->dmamap; + if (dmap->map == NULL) + return; bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_PREWRITE); }