Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43630 - [PATCH] xfree using kernel 2.6.3 un Ultra 5 (mach64) does not work
Summary: [PATCH] xfree using kernel 2.6.3 un Ultra 5 (mach64) does not work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: Sparc All
: High major (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-03 10:51 UTC by Daniel Seyffer
Modified: 2004-07-06 02:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gentoo-sparc-mach64.patch (gentoo-sparc-mach64.patch,571 bytes, patch)
2004-03-03 10:52 UTC, Daniel Seyffer
Details | Diff
*UNTESTED* updated patch that shouldn't nuke 2.4/non-sparc (xfree-4.3.99-pci-domains.patch,1.16 KB, patch)
2004-03-09 17:42 UTC, Ciaran McCreesh
Details | Diff
*UNTESTED* updated patch that shouldn't nuke 2.4/non-sparc attempt 2 (xfree-4.3.99-pci-domains.patch,1.16 KB, patch)
2004-03-10 11:40 UTC, Ciaran McCreesh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Seyffer 2004-03-03 10:51:34 UTC
Hi,

As already discussed on IRC (at least I bugged folks there since the weekend...)  xfree in combination with kernel 2.6.3 using Sun Ultra 5's onboard mach64 based chipset does not work.
It will always fail to detect the device (no device detected).


Doing an strace I noticed that it tries to read /proc/bus/pci/
Someone on #gentoo-sparc (ciaranm? I don't remember for sure) pointed to a few lines of xfree sourcecode that does pci bus scanning.

Quick grep for the code lead me to xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c (line 112 following)

Solution is to replace the references "/proc/bus/pci/%02x/%02x.%1x" with "/proc/bus/pci/0000:%02x/%02x.%1x"

Please find attached a trivial quick-and-dirty patch for xfree-4.3.99.902 that so far works fine for me...
Comment 1 Daniel Seyffer 2004-03-03 10:52:41 UTC
Created attachment 26787 [details, diff]
gentoo-sparc-mach64.patch
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-03 12:28:18 UTC
Is this patch compatible with 2.4 kernels?
Comment 3 Ciaran McCreesh 2004-03-03 12:33:27 UTC
Nope, the patch as it stands will break everything except 2.6.x on sparc. It should also be using sysfs rather than the procfs interface.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-03 12:40:38 UTC
Adding a runtime check for kernel version would be nice, as well as making this patch generic enough to apply on all archs (might need #if/#ifdef magic).
Comment 5 Ciaran McCreesh 2004-03-03 12:54:03 UTC
I think the best thing to do would be to try in this order at runtime:
* sysfs, domains enabled
* sysfs, no domains
* procfs, no domains

Checking for procfs + domains is pretty much irrelevant, because domains are only in 2.6.x kernels, and we can assume that /sys is there.

Shouldn't need any #if magic, just someone who can remember how to check whether a directory exists in C :)
Comment 6 Michael Hellwig 2004-03-04 06:13:52 UTC
btw, patch works for me, revelling in full X glory again ..
Comment 7 Ciaran McCreesh 2004-03-09 17:42:06 UTC
Created attachment 27127 [details, diff]
*UNTESTED* updated patch that shouldn't nuke 2.4/non-sparc

Ok. I can't test this right now because my only mach64able box can't be
rebooted for another few days... However, assuming I didn't screw up, the patch
I'm attaching should work on both 2.4.x and 2.6.x, and won't break non-sparc.
Then again, I've not even tried to compile it, and I can't code C, so could
someone brave please test? :)
Comment 8 Ciaran McCreesh 2004-03-10 11:40:26 UTC
Created attachment 27166 [details, diff]
*UNTESTED* updated patch that shouldn't nuke 2.4/non-sparc attempt 2

Uhm, I think I got the conditional the wrong way round... Oops... How about
this one?
Comment 9 Todd Sunderlin (RETIRED) gentoo-dev 2004-03-11 07:07:25 UTC
Worked fine for me, back at 16 bit color using ati driver.

All I did was:

1) created patch file
2) edited up the ebuild using epatch to include the patch
    (epatch /usr/portage/distfiles/patchname)

3) let it compile, worked fine.
Comment 10 Jason Wever (RETIRED) gentoo-dev 2004-03-13 14:14:33 UTC
ciaranm's latest patch above works both on ultra 5 and blade 100 systems for me.

how soon can we get it rolled into the X ebuild?
Comment 11 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-13 17:13:23 UTC
Anyone try it on other archs yet?
Comment 12 Jason Wever (RETIRED) gentoo-dev 2004-03-13 17:34:13 UTC
I could try building it on x86, but I have no mach64 cards to test against.
Comment 13 Ciaran McCreesh 2004-03-13 17:41:35 UTC
It's not just mach64, it's *any* PCI card.
Comment 14 Ciaran McCreesh 2004-03-20 17:03:12 UTC
Works on x86 for me...
Comment 15 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-03-20 22:24:15 UTC
No, this should not be converted to use sysfs, why do you think it should?

Xfree86 mmaps the pci device through the /proc/bus/pci/... file and then directly talks to it, right?  sysfs has no such functionality.

Patch looks sane to me.
Comment 16 Sven Blumenstein (RETIRED) gentoo-dev 2004-03-21 13:39:38 UTC
Works for me too, please include soon.
Comment 17 Markus Nigbur (RETIRED) gentoo-dev 2004-03-23 15:19:32 UTC
Nice, finally it works.
/me does a happy dance
Comment 18 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-25 07:58:35 UTC
Based on some comments on IRC, my understanding is that this patch is only for 4.3.99. Since I'm not particularly interested in continuing to maintain xfree 4.3.99, especially once X.org makes a release, I'll plan to add it to the X.org release instead. It should apply pretty clean since that's quite close to xfree-4.4.
Comment 19 Jason Wever (RETIRED) gentoo-dev 2004-03-25 08:26:02 UTC
What timeframe are we looking at for the next X.org release?  I only ask because this patch applies to the more popular machines for users to have, and we get questions about how they will work on 2.6 and people trying it out every day.  Currently without this patch, these machines cannot use XFree at all on 2.6, and if we're talking more than a week or so until the next X.org release, I'd really like to get this patch put into X.4.3.99.
Comment 20 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-25 08:29:05 UTC
Tuesday or so.
Comment 21 SpanKY gentoo-dev 2004-04-04 23:35:10 UTC
here's just another 'me too' ...

i needed the aforementioned patch in order to get X up and running
Comment 22 Donnie Berkholz (RETIRED) gentoo-dev 2004-04-09 15:43:11 UTC
In xorg-x11 patchset 0.3
Comment 23 Donnie Berkholz (RETIRED) gentoo-dev 2004-07-06 02:53:46 UTC
Upstreamed:
http://freedesktop.org/bugzilla/show_bug.cgi?id=827