From owner-freebsd-mips@FreeBSD.ORG Wed Sep 1 07:07:38 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EC810656AB for ; Wed, 1 Sep 2010 07:07:38 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 658958FC0C for ; Wed, 1 Sep 2010 07:07:38 +0000 (UTC) Received: by gwj23 with SMTP id 23so3368990gwj.13 for ; Wed, 01 Sep 2010 00:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=H0yAk4d9+2Cr6hWSut/PrQp3YJiyCpyQc6CSjzO1UrQ=; b=sgIq2i2NIMVYG5dWOK5xXqI/lO+UeTaU+hwjk/xee4yNeXC2wMHTKKwTZ2UVcIfP3n xrBxlqxPU1K8LTo2DqTycmjwt1AUsF+J90lKvtlKWkx7ROBRSQWJAXzgvePiMN2YLskD r/55bD65bVX9g5Xfexv+0cAatl2y+yrENUoec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TaT71n3UqEidwq0cgWdicPr42WH7EfOTq4+JNbl6H1AmNx2zHSwWpXj1K+aufqmHPO 9fSY1MoRYB6XamXGy3lMHAOhSy8DxtmtzJEXUDYv3ndB4Q9j5zPR/DfhgSljyj6ZllNk AOPKihney7c/uoKSETx4w89R67qtq5Mk23mkY= MIME-Version: 1.0 Received: by 10.150.200.3 with SMTP id x3mr3149832ybf.348.1283324857639; Wed, 01 Sep 2010 00:07:37 -0700 (PDT) Received: by 10.150.96.8 with HTTP; Wed, 1 Sep 2010 00:07:37 -0700 (PDT) Date: Wed, 1 Sep 2010 12:37:37 +0530 Message-ID: From: "Jayachandran C." To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 07:07:38 -0000 I was looking at a few crashes I see with PCI drivers, and I think it is caused by an issue in busdma_machdep.c where physical address is directly converted using MIPS_PHYS_TO_KSEG1. I have not looked at it in detail, but it looks obviously wrong. Any suggestions on how to fix thiis is welcome, it probably needs an uncached TLB entry. On 64bit we could use XKPHYS uncached. --- 632 if (newmap->flags & DMAMAP_UNCACHEABLE) { 633 void *tmpaddr = (void *)*vaddr; 634 635 if (tmpaddr) { 636 tmpaddr = (void *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); 637 newmap->origbuffer = *vaddr; 638 newmap->allocbuffer = tmpaddr; 639 mips_dcache_wbinv_range((vm_offset_t)*vaddr, 640 dmat->maxsize); 641 *vaddr = tmpaddr; 642 } --- 1361 bpage->busaddr = pmap_kextract(bpage->vaddr); 1362 bpage->vaddr_nocache = 1363 (vm_offset_t)MIPS_PHYS_TO_KSEG1(bpage->busaddr); 1364 mtx_lock(&bounce_lock); Thanks, JC.