Bug 19026 - pci-sysfs resourceN files are not available on all architectures
Summary: pci-sysfs resourceN files are not available on all architectures
Status: RESOLVED WORKSFORME
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/pciaccess (show other bugs)
Version: unspecified
Hardware: All All
: high major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard: 2011BRB_Reviewed
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-11 12:28 UTC by Matt Turner
Modified: 2017-03-13 19:45 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.