2007-05-22 08:41:13

by Mikael Pettersson

[permalink] [raw]
Subject: [BUG sparc64] 2.6.22-rc broke X on Ultra5

Just a FYI:

2.6.21 works fine on my Ultra5, but with 2.6.22-rc the X
server (from Aurora 2) fails to mmap() the PCI frame buffer
(atyfb).

I noticed a lot of PCI-related changes both in `dmesg' and
/var/log/Xorg.0.log between 2.6.21 and 2.6.22-rc, so my
guess is that PCI resources get broken somewhere.

I'll try a bisect between 2.6.21 and 2.6.22-rc1 next, but
I'm also willing to test patches in case anyone thinks they
know what the fix is.

/Mikael


2007-05-22 09:05:42

by David Miller

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

From: Mikael Pettersson <[email protected]>
Date: Tue, 22 May 2007 10:40:53 +0200

> 2.6.21 works fine on my Ultra5, but with 2.6.22-rc the X
> server (from Aurora 2) fails to mmap() the PCI frame buffer
> (atyfb).
>
> I noticed a lot of PCI-related changes both in `dmesg' and
> /var/log/Xorg.0.log between 2.6.21 and 2.6.22-rc, so my
> guess is that PCI resources get broken somewhere.
>
> I'll try a bisect between 2.6.21 and 2.6.22-rc1 next, but
> I'm also willing to test patches in case anyone thinks they
> know what the fix is.

Start your bisect with the change right before this one:

commit a2fb23af1c31ad6e0c281e56d385f803229d57fa
Author: David S. Miller <[email protected]>
Date: Wed Feb 28 23:35:04 2007 -0800

[SPARC64]: Probe PCI bus using OF device tree.

Almost entirely taken from the 64-bit PowerPC PCI code.

This allowed to eliminate a ton of cruft from the sparc64
PCI layer.

Signed-off-by: David S. Miller <[email protected]>

Unfortunately, if the tree works right before this change,
you can't just add this one because a subsequent fix is
needed before ultra5/ultra10 will work again, but it's
this one:

commit 01f94c4a6ced476ce69b895426fc29bfc48c69bd
Author: David S. Miller <[email protected]>
Date: Sun Mar 4 12:53:19 2007 -0800

[SPARC64]: Fix sabre pci controllers with new probing scheme.
...

So you could test these two commits:

deb66c4521e119442aa266553e8cbfc86eb71232
a2fb23af1c31ad6e0c281e56d385f803229d57fa

Thanks.

2007-05-30 19:33:47

by Mikael Pettersson

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

On Tue, 22 May 2007 02:05:34 -0700 (PDT), David Miller <[email protected]> wrote:
> From: Mikael Pettersson <[email protected]>
> Date: Tue, 22 May 2007 10:40:53 +0200
>
> > 2.6.21 works fine on my Ultra5, but with 2.6.22-rc the X
> > server (from Aurora 2) fails to mmap() the PCI frame buffer
> > (atyfb).
> >
> > I noticed a lot of PCI-related changes both in `dmesg' and
> > /var/log/Xorg.0.log between 2.6.21 and 2.6.22-rc, so my
> > guess is that PCI resources get broken somewhere.
> >
> > I'll try a bisect between 2.6.21 and 2.6.22-rc1 next, but
> > I'm also willing to test patches in case anyone thinks they
> > know what the fix is.
>
> Start your bisect with the change right before this one:
>
> commit a2fb23af1c31ad6e0c281e56d385f803229d57fa
> Author: David S. Miller <[email protected]>
> Date: Wed Feb 28 23:35:04 2007 -0800
>
> [SPARC64]: Probe PCI bus using OF device tree.
>
> Almost entirely taken from the 64-bit PowerPC PCI code.
>
> This allowed to eliminate a ton of cruft from the sparc64
> PCI layer.
>
> Signed-off-by: David S. Miller <[email protected]>
>
> Unfortunately, if the tree works right before this change,
> you can't just add this one because a subsequent fix is
> needed before ultra5/ultra10 will work again, but it's
> this one:
>
> commit 01f94c4a6ced476ce69b895426fc29bfc48c69bd
> Author: David S. Miller <[email protected]>
> Date: Sun Mar 4 12:53:19 2007 -0800
>
> [SPARC64]: Fix sabre pci controllers with new probing scheme.

You were spot on. 2.6.21 + patches up to but not including
the first one above works. Adding that one gave me a kernel
that wouldn't boot (hung after "uncompressing kernel").
Adding the second one above gave me a kernel that booted, but
where X failed to mmap() the frame buffer as I described.

/Mikael

2007-05-30 20:01:36

by David Miller

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

From: Mikael Pettersson <[email protected]>
Date: Wed, 30 May 2007 21:33:18 +0200 (MEST)

> You were spot on. 2.6.21 + patches up to but not including
> the first one above works. Adding that one gave me a kernel
> that wouldn't boot (hung after "uncompressing kernel").
> Adding the second one above gave me a kernel that booted, but
> where X failed to mmap() the frame buffer as I described.

Thanks for all of your testing.

I'll try to figure this out on one of my Ultra5's here.

2007-06-06 23:22:07

by David Miller

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

From: David Miller <[email protected]>
Date: Wed, 30 May 2007 13:01:40 -0700 (PDT)

> From: Mikael Pettersson <[email protected]>
> Date: Wed, 30 May 2007 21:33:18 +0200 (MEST)
>
> > You were spot on. 2.6.21 + patches up to but not including
> > the first one above works. Adding that one gave me a kernel
> > that wouldn't boot (hung after "uncompressing kernel").
> > Adding the second one above gave me a kernel that booted, but
> > where X failed to mmap() the frame buffer as I described.
>
> Thanks for all of your testing.
>
> I'll try to figure this out on one of my Ultra5's here.

So I did some more digging, got my ultra5 running and I can't
get it to work with both 2.6.20 and 2.6.22-rc4 :-) This is
with xorg-7.2, and they both fail with:

xf86MapPciMem: Could not mmap ...

which I assume is the error you're seeing.

Investigation reveals that X.org is erroneously trying to
do PCI mmap ioctl()'s on /sys/bus/pci/devices/*/config
files which is very very wrong. Again this happens for me
with both 2.6.20 and 2.6.22

Can you just quickly strace "Xorg" startup in the working
and non-working case? Just a simple:

strace -o x.log Xorg

would for both cases be fine.

You can email it to me privately, and I'll post here my
analysis with the relevant portions quoted so we don't
flood the list with strace dumps :-)

Thanks a lot!

2007-06-07 06:25:19

by Mikael Pettersson

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

On Wed, 06 Jun 2007 16:22:10 -0700 (PDT), David Miller <[email protected]> wrote:
> > From: Mikael Pettersson <[email protected]>
> > Date: Wed, 30 May 2007 21:33:18 +0200 (MEST)
> >
> > > You were spot on. 2.6.21 + patches up to but not including
> > > the first one above works. Adding that one gave me a kernel
> > > that wouldn't boot (hung after "uncompressing kernel").
> > > Adding the second one above gave me a kernel that booted, but
> > > where X failed to mmap() the frame buffer as I described.
> >
> > Thanks for all of your testing.
> >
> > I'll try to figure this out on one of my Ultra5's here.
>
> So I did some more digging, got my ultra5 running and I can't
> get it to work with both 2.6.20 and 2.6.22-rc4 :-) This is
> with xorg-7.2, and they both fail with:
>
> xf86MapPciMem: Could not mmap ...
>
> which I assume is the error you're seeing.

With 2.6.21 + the broken patches, yes. With 2.6.22-rc I got
a slightly different message which still said something about
a PCI mmap failure.

BTW, I have xorg-6.8.1 (Aurora 2.0 user-space), which might
explain why we see different behaviour.

> Investigation reveals that X.org is erroneously trying to
> do PCI mmap ioctl()'s on /sys/bus/pci/devices/*/config
> files which is very very wrong. Again this happens for me
> with both 2.6.20 and 2.6.22
>
> Can you just quickly strace "Xorg" startup in the working
> and non-working case? Just a simple:
>
> strace -o x.log Xorg
>
> would for both cases be fine.
>
> You can email it to me privately, and I'll post here my
> analysis with the relevant portions quoted so we don't
> flood the list with strace dumps :-)

I'm away from my ultra5 right now, but I should be able to do
this test on Monday next week.

/Mikael

2007-06-07 06:25:38

by David Miller

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

From: Mikael Pettersson <[email protected]>
Date: Thu, 7 Jun 2007 08:24:57 +0200 (MEST)

> I'm away from my ultra5 right now, but I should be able to do
> this test on Monday next week.

Thank you.

2007-06-09 09:43:17

by Dmitry Artamonow

[permalink] [raw]
Subject: Re: [BUG sparc64] 2.6.22-rc broke X on Ultra5

Good day!

Sorry for intruding, but I'm seeing the same problem on my U10 with
2.6.22-rc3 and Xorg-7.1+gentoo patches.

On Wed, Jun 06, 2007 at 04:22:10PM -0700, David Miller wrote:
> From: David Miller <[email protected]>
> Date: Wed, 30 May 2007 13:01:40 -0700 (PDT)
>
> > From: Mikael Pettersson <[email protected]>
> > Date: Wed, 30 May 2007 21:33:18 +0200 (MEST)
> >
> > > You were spot on. 2.6.21 + patches up to but not including
> > > the first one above works. Adding that one gave me a kernel
> > > that wouldn't boot (hung after "uncompressing kernel").
> > > Adding the second one above gave me a kernel that booted, but
> > > where X failed to mmap() the frame buffer as I described.
> >
> > Thanks for all of your testing.
> >
> > I'll try to figure this out on one of my Ultra5's here.
>
> So I did some more digging, got my ultra5 running and I can't
> get it to work with both 2.6.20 and 2.6.22-rc4 :-) This is
> with xorg-7.2, and they both fail with:
>
> xf86MapPciMem: Could not mmap ...
>
> which I assume is the error you're seeing.
>
> Investigation reveals that X.org is erroneously trying to
> do PCI mmap ioctl()'s on /sys/bus/pci/devices/*/config
> files which is very very wrong. Again this happens for me
> with both 2.6.20 and 2.6.22

Xorg-7.2 (to be more precise, xorg-server-1.2.0) never worked for me, you
can see my bug on gentoo bugzilla for more info:
http://bugs.gentoo.org/show_bug.cgi?id=167052
But Xorg-7.1 worked fine on kernels up and including 2.6.21

>
> Can you just quickly strace "Xorg" startup in the working
> and non-working case? Just a simple:
>
> strace -o x.log Xorg
>
> would for both cases be fine.
>
> You can email it to me privately, and I'll post here my
> analysis with the relevant portions quoted so we don't
> flood the list with strace dumps :-)
>
> Thanks a lot!

I sent David privately my .configs , Xorg.0.logs and strace logs for 2.6.21
and 2.6.22-rc3. Hope it helps.

--
Best regards,
Dmitry 'MAD' Artamonow