From owner-freebsd-mips@freebsd.org Fri Oct 30 14:39:12 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E49A1EDDA for ; Fri, 30 Oct 2015 14:39:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27D5136E for ; Fri, 30 Oct 2015 14:39:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iofz202 with SMTP id z202so81564752iof.2 for ; Fri, 30 Oct 2015 07:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VxrRtnHikBtWdaDI6LwrHtmErC/LufDF2Qfa3MUwe38=; b=CPmM8QARU6aRcZD4/yIK7E9Y/voGqAsg4JEflESaK+il1eE5eHI9yMX+mOagYpILZ+ ZmMmZveG8boQ6rar6sPXGUwtvavb83/hWpcYiyGwM5tb3as6PwnuQvzX3yTZKJ9MACZm yLyUpvO1vWE0pu9oPRxYzcyoUCt1kjVQqYIqlv4UmPixHlobIuhfjggL6MWdamBcneOP lTsq+UNWapVx1H5emu+BqW4oCKJEVlvVr20vUzSxvrjy82X6KftANYUgGv+UFH+ehXvo Fx35mQY3f2SjpNjYPXhyO9awIQNluJjPQweQe7SbcGyg12dZ4/9DSL021EpAE2ORy8As ePWA== MIME-Version: 1.0 X-Received: by 10.107.46.142 with SMTP id u14mr9803913iou.165.1446215951073; Fri, 30 Oct 2015 07:39:11 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Fri, 30 Oct 2015 07:39:10 -0700 (PDT) In-Reply-To: References: <562CBEC3.8030308@rdtc.ru> <562E3027.4020806@grosbein.net> <562F75E2.9000505@grosbein.net> <5630E844.2080807@grosbein.net> <56321ED9.4050602@grosbein.net> <56323496.609@grosbein.net> <56325769.8070202@grosbein.net> <56328C54.1050709@grosbein.net> <56328DB1.9010105@grosbein.net> Date: Fri, 30 Oct 2015 07:39:10 -0700 Message-ID: Subject: Re: arge1 on TL WDR3600 From: Adrian Chadd To: Eugene Grosbein Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2015 14:39:12 -0000 And also try this: adrian@victoria:~/work/freebsd/head-embedded/src/sys/mips/mips % svn diff . Index: busdma_machdep.c =================================================================== --- busdma_machdep.c (revision 290082) +++ busdma_machdep.c (working copy) @@ -66,6 +66,9 @@ #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 +/* XXX */ +#define SYNC __asm volatile("sync") + struct bounce_zone; struct bus_dma_tag { @@ -1220,11 +1223,16 @@ if (STAILQ_FIRST(&map->bpages)) _bus_dmamap_sync_bp(dmat, map, op); - if (dmat->flags & BUS_DMA_COHERENT) + /* XXX ? */ + if (dmat->flags & BUS_DMA_COHERENT) { + SYNC; return; + } - if (map->flags & DMAMAP_UNCACHEABLE) + if (map->flags & DMAMAP_UNCACHEABLE) { + SYNC; return; + } aligned = (map->flags & DMAMAP_CACHE_ALIGNED) ? 1 : 0; .. I /think/ we also need to be doing SYNC operations on uncachable memory. Thanks, -a