Bug 98158 - Xorg error - SiS Driver works with Arch linux-lts 4.4.23-1 but fails with Arch linux 4.6.3-1 and later. libpciaccess?
Summary: Xorg error - SiS Driver works with Arch linux-lts 4.4.23-1 but fails with Arc...
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/SiS (show other bugs)
Version: 7.7 (2012.06)
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-07 20:58 UTC by James
Modified: 2018-08-10 20:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description James 2016-10-07 20:58:33 UTC
Arch Linux:
xf86-video-sis 0.10.8-2
xorg-server 1.18.4-1
/usr/lib/libpciaccess.so.0.11.1

Build Source:
http://xorg.freedesktop.org/releases/individual/driver/xf86-video-sis-0.10.8.tar.bz2

Hardware:
01:00.0 VGA compatible controller [0300]: Silicon Integrated Systems [SiS] 661/741/760 PCI/AGP or 662/761Gx PCIE VGA Display Adapter [1039:6330]

00:00.0 Host bridge [0600]: Silicon Integrated Systems [SiS] 661FX/M661FX/M661MX Host [1039:0661] (rev 11)

This is on an older generic Winbook laptop, circa 2005, with an Intel Celeron M and all SiS chipset.

The driver works fine with the linux-lts 4.4.23-1 kernel, but fails with, at least, the linux-4.6.3-1 kernel, and later kernels.  I've also tested with linux 4.7.6-1 and linux 4.8.0-1.

The only thing changing here is the kernel version.  The Xorg server and the SiS driver are exactly the same in each case.

The error occurs right after some "VESA BIOS detected" reporting, and is always:

 (EE) SIS(0): Unable to map FB aperture. Invalid argument (22)
 (EE) SIS(0): **************************************************
 (EE) SIS(0):                       ERROR:
 (EE) SIS(0): SiSMapMem() failed
 (EE) SIS(0):                   END OF MESSAGE
 (EE) SIS(0): **************************************************

which is from
http://code.metager.de/source/xref/xorg/driver/xf86-video-sis/src/sis_driver.c
 /usr/lib/xorg/modules/drivers/sis_drv.so

 7278         int err = pci_device_map_range(pSiS->PciInfo,
 7279                                   (ULong)pSiS->realFbAddress,
 7280                                   pSiS->FbMapSize,
 7281                                   PCI_DEV_MAP_FLAG_WRITABLE |
 7282                                   PCI_DEV_MAP_FLAG_WRITE_COMBINE,
 7283                                   (void *)&pSiSEnt->FbBase);

or - cannot tell which code path, since the error message is the same -

 7305         int err = pci_device_map_range(pSiS->PciInfo,
 7306                                   (ULong)pSiS->realFbAddress,
 7307                                   pSiS->FbMapSize,
 7308                                   PCI_DEV_MAP_FLAG_WRITABLE |
 7309                                   PCI_DEV_MAP_FLAG_WRITE_COMBINE,
 7310                                   (void *)&pSiS->FbBase);

which is in /xorg/lib/libpciaccess/src/common_interface.c,
http://code.metager.de/source/xref/xorg/lib/libpciaccess/src/common_interface.c

235/**
236 * Map the specified memory range so that it can be accessed by the CPU.
237 *
238 * Maps the specified memory range for access by the processor.  The pointer
239 * to the mapped region is stored in \c addr.  In addition, the
240 * \c pci_mem_region::memory pointer for the BAR will be updated.
241 *
242 * \param dev          Device whose memory region is to be mapped.
243 * \param base         Base address of the range to be mapped.
244 * \param size         Size of the range to be mapped.
245 * \param map_flags    Flag bits controlling how the mapping is accessed.
246 * \param addr         Location to store the mapped address.
247 *
248 * \return
249 * Zero on success or an \c errno value on failure.
250 *
251 * \sa pci_device_unmap_range
252 */
253 int
254 pci_device_map_range(struct pci_device *dev, pciaddr_t base,
255                      pciaddr_t size, unsigned map_flags,
256                      void **addr)
257 {
...
314    if (dev->regions[region].memory == NULL) {
315        err = (*pci_sys->methods->map_range)(dev,
316                                             &mappings[devp->num_mappings]);
317    }
...

http://code.metager.de/source/xref/xorg/lib/libpciaccess/src/pciaccess_private.h
184 extern struct pci_system * pci_sys;
...
159struct pci_system {
160    /**
161     * Platform dependent implementations of specific API routines.
162     */
163    const struct pci_system_methods * methods;
...
59 struct pci_system_methods {
...
64    int (*map_range)(struct pci_device *dev, struct pci_device_mapping *map);

which, presumably, is either from

http://code.metager.de/source/xref/xorg/lib/libpciaccess/src/x86_pci.c

815 static const struct pci_system_methods x86_pci_methods = {
...
819    .map_range = pci_device_x86_map_range,
...
639 pci_device_x86_map_range(struct pci_device *dev,
640    struct pci_device_mapping *map)
641 {
...

or from

http://code.metager.de/source/xref/xorg/lib/libpciaccess/src/linux_sysfs.c

969 static const struct pci_system_methods linux_sysfs_methods = {
...
974    .map_range = pci_device_linux_sysfs_map_range,
...
539 pci_device_linux_sysfs_map_range(struct pci_device *dev,
540                                 struct pci_device_mapping *map)
541 {
...


Somewhere, the pci_device_map_range{} function is not compatible with the newer kernel versions.

Is this really a SiS driver issue, or is this ultimately a libpciaccess issue?
Comment 1 James 2017-04-04 20:37:18 UTC
Running "git bisect", I have tracked this back to:

 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=90a545e981267e917b9d698ce07affd69787db87

The "quick fix" is to boot with the command-line parameter "iomem=relaxed".

But, as explored here, the proper fix may require changes to "libpciaccess".

Also:
 https://bugs.freedesktop.org/show_bug.cgi?id=99127
 "libpciaccess 0.13.4.10.r294.g099489b - incompatible with linux after version 4.4"
Comment 2 GitLab Migration User 2018-08-10 20:47:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis/issues/16.


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.