lkml.org 
[lkml]   [2011]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectMap PCI resource to user space problem.
Hello,

when I try to map PCI resource of size < PAGE_SIZE to user space
with e.g. remap_pfn_range() the mapping seems to be created,
but the access to the PCI device just doesn't work (read returns 0xff).

The same happens when using sysfs. The device has
# ls -al /sys/bus/pci/devices/0000\:02\:09.0/resource*
-rw------- 1 root root 512 Jun 20 11:33 /sys/bus/pci/devices/0000:02:09.0/resource0
-rw------- 1 root root 256 Jun 20 11:33 /sys/bus/pci/devices/0000:02:09.0/resource1
-rw------- 1 root root 8388608 Jun 20 11:33 /sys/bus/pci/devices/0000:02:09.0/resource2
-rw------- 1 root root 262144 Jun 20 11:33 /sys/bus/pci/devices/0000:02:09.0/resource3

and when I mmap() resource0, a valid address is returned, but reading the
area always returns 0xff.

Since a kernel driver can access resource0 here without problems when using
ioremap(), I'm not sure what is wrong with the sysfs entry for user space
(or using remap_pfn_range() in own mmap function).
The only hint I have so far is the size, which is smaller than PAGE_SIZE.

What would be the correct way to map this area to user space?

Thanks,
Armin


\
 
 \ /
  Last update: 2011-06-20 11:47    [W:0.074 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site