Bug 438947 - Map MMIO aperture failed when region's size(4K) < PageSize(16K)
Map MMIO aperture failed when region's size(4K) < PageSize(16K)
Product: Fedora
Classification: Fedora
Component: xorg-x11-drv-ati (Show other bugs)
ia64 Linux
low Severity medium
: ---
: ---
Assigned To: Dave Airlie
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks: fedora-ia64
  Show dependency treegraph
Reported: 2008-03-25 23:57 EDT by Zhan, Yi
Modified: 2008-03-26 19:28 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-26 19:28:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to fix ia64 map MMIO aperture issue (1.29 KB, patch)
2008-03-25 23:57 EDT, Zhan, Yi
no flags Details | Diff

  None (edit)
Description Zhan, Yi 2008-03-25 23:57:34 EDT
Description of problem:

I ran into this issue on IA64. When I tried to start X server, ati driver failed
    (EE) MACH64(0): Unable to map mmio aperture. Argument list too long (7) .

By looking into this closer I found that the issue is caused by a call to
pci_device_map_range() when trying to map MMIO aperture.
        int err = pci_device_map_range(pVideo,
                                       mode, &pATI->pMMIO);

Here the PageSize, which is 16K on ia64, is passed as the size argument but the
size of the corresponding region in my ati card is only 4K.  
        Region 0: Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
        Region 1: I/O ports at 5800 [size=256]
        Region 2: Memory at fbfd0000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at fbfa0000 [disabled] [size=128K]

Then an E2BIG is returned when the pci_device_map_range() checks arguments and
the X server failed to start. I also do some investigation about why I didn't
run into this on F8. It turns out recently X server changed to use libpciaccess
instead of previous xf86* method. Previously xf86MapPciMem() is used to do the
map and somehow allow the map succeed. 

I saw this on IA64, but I image that other platform which has a 4k region2 ati
card and 16K page size would run into the same issue. I think the real region
size instead of PageSize would be passed to the MMIO map and unmap functions in
this case. I will attach a patch to do this. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Zhan, Yi 2008-03-25 23:57:34 EDT
Created attachment 299093 [details]
patch to fix ia64 map MMIO aperture issue
Comment 2 Dave Airlie 2008-03-26 02:32:19 EDT
its probably easier to just fix this to do the same path for all systems
regardless of pagesize.

I've put a modified patch into fedoras driver now it should be in
xf86-video-ati-6.8.0-5 when it hits rawhide.
Comment 3 Zhan, Yi 2008-03-26 07:09:26 EDT
Thanks, I have checked out the source from fedora cvs and it works fine :) Any
other info is needed?  
Comment 4 Dave Airlie 2008-03-26 19:28:39 EDT
nope I've put the fix upstream as well, thanks for testing.

Note You need to log in before you can comment on or make changes to this bug.