Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Sep 2010 12:37:37 +0530
From:      "Jayachandran C." <c.jayachandran@gmail.com>
To:        freebsd-mips@freebsd.org
Subject:   busdma_machdep.c with more than 512M memory
Message-ID:  <AANLkTimjmpOBOAncY9K9AhCodvp27t=XTQ9qZp4q8%2Bvv@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimjmpOBOAncY9K9AhCodvp27t=XTQ9qZp4q8%2Bvv>