Re: [Bug #12608] 2.6.29-rc powerpc G5 Xorg legacy_mem regression

From: Hugh Dickins
Date: Fri Feb 06 2009 - 17:18:38 EST


On Fri, 6 Feb 2009, Jesse Barnes wrote:
>
> Hugh, did you get a chance to try my X patch (w/o Ben's patch applied)? If it
> also works, we should apply it to X too, if only to make porting to future
> platforms a little easier.

I have tried it now: I'm sorry to say it does not work, fails with
(WW) xf86MapDomainMem(): mmap() failure: No such device or address

Fatal server error:
AddScreen/ScreenInit failed for driver 0

The "mmap() failure" line is of course the one you're intentionally
showing, but the AddScreen/ScreenInit one is not what you want.
Presumably it demands something other than a NULL addr returned,
but I haven't followed that up at all.

I have tried the obvious patch below, which reverts to the original
code if the mmap fails: this works, but presumably negates much of
what you intended to achieve with legacy_mem.

Easy for me to try something else, fire away.

Hugh

--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -501,8 +501,10 @@ xf86MapDomainMemory(int ScreenNum, int F
if (fd >= 0)
close(fd);
if (addr == NULL || addr == MAP_FAILED) {
- perror("mmap failure");
- FatalError("xf86MapDomainMem(): mmap() failure\n");
+ xf86Msg(X_WARNING, "xf86MapDomainMem(): mmap() failure: %s\n",
+ strerror(errno));
+ return linuxMapPci(ScreenNum, Flags, dev, Base, Size,
+ PCIIOC_MMAP_IS_MEM);
}
return addr;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/