Bus error after successful mmap of physical address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am sure there is a basic reason why this is not working but I just
can't see it.

I am booting with mem=512MB and trying to access a memory region at
0xC0000000 mapped by a fixed TLB entry.

My driver does,

vma->vm_flags = vma->vm_flags | VM_IO | VM_RESERVED ;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot) ;

	// Map the whole physically contiguous area in one piece
	if( (ret  = io_remap_pfn_range(vma , vma->vm_start, vma->vm_pgoff ,
vma->vm_end - vma->vm_start , vma->vm_page_prot)) < 0 )
    return ret;
	return 0

And my user space app does:

// open device
	vadr = mmap( NULL , 1024*1024 ,
PROT_WRITE|PROT_READ,MAP_NORESERVE|MAP_SHARED,device,0xC0000000);
	if(vadr == MAP_FAILED)
	{
		perror("mmap failed.\n");
		exit(-1);
	}


That goes OK, but then if I try to read or write from vadr I get a "Bus error".

Isn't that the correct way to map a physical address region to user
space? I just need to make sure that this is the case before starting
to debug the issue.

Thank a lot,
Alex


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux