Bug 19026

Summary: pci-sysfs resourceN files are not available on all architectures
Product: xorg Reporter: Matt Turner <mattst88>
Component: Lib/pciaccessAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED WORKSFORME QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high CC: armin76, diskman, idr, jeremyhu, pva, remi
Version: unspecified   
Hardware: All   
OS: All   
URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=485528
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:

Description Matt Turner 2008-12-11 12:28:33 UTC
This bug was filed by Julien Cristau at the Debian Bug Tracking system but never seemed to make it to fd.o's bugzilla.

> the pci_device_map_range() function from libpciaccess which is used by
> the X drivers to map pci BARs is implemented on linux using sysfs
> resourceN files, which the kernel only creates on architectures where
> HAVE_PCI_MMAP is defined.  This is not the case for alpha, parisc, mips
> and m68k, as far as I can tell.  See pci_create_resource_files() in
> linux/drivers/pci/pci-sysfs.c, and the respective include/asm-*/pci.h
> headers.
>
> This means that future versions of X (starting with xorg-server 1.5) are
> not going to work on these architectures unless this is fixed.  We need
> to either get the kernel fixed, or fall back to mmaping /dev/mem in
> libpciaccess.

Is it really acceptable to switch to libpciaccess and provide no fallback for these platforms?

Ideally, the solution is that each platform implement sysfs-pci resource in the kernel, but in the real world, you file a bug detailing the ideal situation and it rots for 6 months (http://bugzilla.kernel.org/show_bug.cgi?id=10893). Even if that were fixed tomorrow, at least PA-RISC, MIPS, and M68K systems are still left in the cold. I believe the BSDs have also run into problems with this.

Please implement a fallback in libpciaccess (directly access /dev/mem or similar).

By implementing even a temporary fallback (until all the kernel implementations are finished), it appears that the following bugs (symptoms of this problem) would be instantly fixed.

bug 16549, bug 15521, bug 17801.
Comment 1 RĂ©mi Cardona 2009-04-01 08:49:32 UTC
Ping, any updates here?
Comment 2 Jeremy Huddleston Sequoia 2011-10-16 16:33:25 UTC
Is pci_device_linux_sysfs_map_legacy sufficient for the needs of drivers to 
fallback on /dev/mem?
Comment 3 Matt Turner 2017-03-13 19:45:35 UTC
Alpha was fixed long ago. No one else seems to care (or their platforms have been fixed too)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.