Skip to contentSkip to conversation

Xserver startup locks system... git bisect results

BUG Mark M. Hoffman 6 participants 14 messages Dec 15, 2005 – Dec 27, 2005 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

Hello:

Quoted 6 lines · git bisect

47807ce381acc34a7ffee2b42e35e96c0f322e52 is first bad commit
diff-tree 47807ce381acc34a7ffee2b42e35e96c0f322e52 (from 0e670506668a43e1355b8f10c33d081a676bd521)

Author: Dave Airlie <[email protected]>
Date:   Tue Dec 13 04:18:41 2005 +0000

[drm] fix radeon aperture issue

With this one applied, my machine locks up tight just after starting the Xserver. Some info (dmesg, lspci, config) is here:

http://members.dca.net/mhoffman/lkml-20051214/

I can put a serial console on it if necessary, but not until about this time tomorrow.

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#1 lore raw
Quoted 10 lines · Mark M. Hoffman

Hello:

Quoted 6 lines · git bisect

47807ce381acc34a7ffee2b42e35e96c0f322e52 is first bad commit
diff-tree 47807ce381acc34a7ffee2b42e35e96c0f322e52 (from 0e670506668a43e1355b8f10c33d081a676bd521)

Author: Dave Airlie <[email protected]>
Date:   Tue Dec 13 04:18:41 2005 +0000

[drm] fix radeon aperture issue

Quoted 7 lines

With this one applied, my machine locks up tight just after starting the Xserver. Some info (dmesg, lspci, config) is here:

http://members.dca.net/mhoffman/lkml-20051214/

I can put a serial console on it if necessary, but not until about this time tomorrow.

You have to love this X radeon driver ... you can't fix one bug without breaking something else, it's one of the worst piece of crap I've ever seen...

What would be useful now is the X version and maybe trying a little hack in the X driver. Do you have ways to rebuild the X driver at all ?

The problem is, that patch actually fixes some users... Ah, also, could you maybe add some printk's around the code that is modified by that patch and try to catch the value it tries to use before the lockup ?

That is, print the values of:

dev_priv->fb_location

and

RADEON_READ(RADEON_CONFIG_APER_SIZE)

Thanks,
Ben.

#2 lore raw

Ah, also, something else you can try, is replace

	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_APER_SIZE);

with

#define RADEON_CONFIG_MEMSIZE                         0x00F8  
	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_MEMSIZE);

And tell us if it helps ?

Ben.

#3 lore raw
Quoted 4 lines · Benjamin Herrenschmidt

Ah, also, something else you can try, is replace

	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_APER_SIZE);

Actually, the above should read

+ RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;

With the patch that is causing your problem...

Quoted 16 lines

with

#define RADEON_CONFIG_MEMSIZE                         0x00F8  
	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_MEMSIZE);

And tell us if it helps ?

Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 4 lines · Benjamin Herrenschmidt

Ah, also, something else you can try, is replace

	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_APER_SIZE);

Actually, the above should read

+ RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;

With the patch below, my powerbook will sleep and wake up successfully.

Paul.

drivers/char/drm/radeon_cp.c +1 -1
index 9f2b4ef..465fdc2 100644
@@ -1522,7 +1522,7 @@ static int radeon_do_init_cp(drm_device_
 
 	dev_priv->gart_size = init->gart_size;
 	dev_priv->gart_vm_start = dev_priv->fb_location
-	    + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
+	    + RADEON_READ(RADEON_CONFIG_MEMSIZE);
 
 #if __OS_HAS_AGP
 	if (!dev_priv->is_pci)
drivers/char/drm/radeon_drv.h +1 -0
index 7bda7e3..d92ccee 100644
@@ -379,6 +379,7 @@ extern int r300_do_cp_cmdbuf(drm_device_
 #	define RADEON_PLL_WR_EN			(1 << 7)
 #define RADEON_CLOCK_CNTL_INDEX		0x0008
 #define RADEON_CONFIG_APER_SIZE		0x0108
+#define RADEON_CONFIG_MEMSIZE		0x00f8
 #define RADEON_CRTC_OFFSET		0x0224
 #define RADEON_CRTC_OFFSET_CNTL		0x0228
 #	define RADEON_CRTC_TILE_EN		(1 << 15)
#5 lore raw

Hi Paul, Benjamin:

Quoted 8 lines · Paul Mackerras
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 4 lines · Benjamin Herrenschmidt

Ah, also, something else you can try, is replace

	dev_priv->gart_vm_start = dev_priv->fb_location
	    + RADEON_READ(RADEON_CONFIG_APER_SIZE);
Quoted 6 lines
Quoted 3 lines

Actually, the above should read

+ RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;

With the patch below, my powerbook will sleep and wake up successfully.

I added the printk's you (BH) asked for to Paul's patch, resulting in the patch below. It works fine so far. Here's the relevant kernel log:

Dec 15 22:39:47 jupiter kernel: dev_priv->fb_location is 0xe8000000
Dec 15 22:39:47 jupiter kernel: RADEON_READ(RADEON_CONFIG_APER_SIZE) is 0x08000000
Dec 15 22:39:47 jupiter kernel: [drm] Loading R200 Microcode

Let me know if you need any more info. Thanks.

drivers/char/drm/radeon_cp.c +6 -1
@@ -1522,7 +1522,12 @@ static int radeon_do_init_cp(drm_device_
 
 	dev_priv->gart_size = init->gart_size;
 	dev_priv->gart_vm_start = dev_priv->fb_location
-	    + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
+	    + RADEON_READ(RADEON_CONFIG_MEMSIZE);
+
+printk(KERN_INFO "dev_priv->fb_location is 0x%08x\n",
+	dev_priv->fb_location);
+printk(KERN_INFO "RADEON_READ(RADEON_CONFIG_APER_SIZE) is 0x%08x\n",
+	RADEON_READ(RADEON_CONFIG_APER_SIZE));
 
 #if __OS_HAS_AGP
 	if (!dev_priv->is_pci)
drivers/char/drm/radeon_drv.h +1 -0
@@ -379,6 +379,7 @@ extern int r300_do_cp_cmdbuf(drm_device_
 #	define RADEON_PLL_WR_EN			(1 << 7)
 #define RADEON_CLOCK_CNTL_INDEX		0x0008
 #define RADEON_CONFIG_APER_SIZE		0x0108
+#define RADEON_CONFIG_MEMSIZE		0x00f8
 #define RADEON_CRTC_OFFSET		0x0224
 #define RADEON_CRTC_OFFSET_CNTL		0x0228
 #	define RADEON_CRTC_TILE_EN		(1 << 15)
Signature · 2 lines
Mark M. Hoffman
[email protected]
#6 lore raw
Quoted 2 lines · Mark M. Hoffman

I added the printk's you (BH) asked for to Paul's patch, resulting in the patch below. It works fine so far. Here's the relevant kernel log:

Ok, sounds good, it's also the right way to go. However, Linus, don't merge that patch "as-is" as some chips have a bug with CONFIG_MEMSIZE being 0 instead of 8k. I'll send you a proper patch and I'll fix the remaining problems on X side (it's still bogus, though the DRM "fixes it up" now).

Ben.

#7 lore raw
In reply to Mark M. Hoffman

Finally fixes the radeon memory mapping bug that was incorrectly fixed by the previous patch. This time, we use the actual vram size as the size to calculate how far to move the AGP aperture from the framebuffer in card's memory space. If there are still issues with this patch, they are due to bugs in the X driver that I'm working on fixing too.

drivers/char/drm/radeon_cp.c +7 -2
Index: linux-work/drivers/char/drm/radeon_cp.c
===================================================================
@@ -1312,6 +1312,8 @@
 static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;;
+	unsigned int mem_size;
+
 	DRM_DEBUG("\n");
 
 	dev_priv->is_pci = init->is_pci;
@@ -1521,8 +1523,11 @@
 					  + dev_priv->fb_location) >> 10));
 
 	dev_priv->gart_size = init->gart_size;
-	dev_priv->gart_vm_start = dev_priv->fb_location
-	    + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
+
+	mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE);
+	if (mem_size == 0)
+		mem_size = 0x800000;
+	dev_priv->gart_vm_start = dev_priv->fb_location + mem_size;
 
 #if __OS_HAS_AGP
 	if (!dev_priv->is_pci)
drivers/char/drm/radeon_drv.h +1 -0
Index: linux-work/drivers/char/drm/radeon_drv.h
===================================================================
@@ -379,6 +379,7 @@
 #	define RADEON_PLL_WR_EN			(1 << 7)
 #define RADEON_CLOCK_CNTL_INDEX		0x0008
 #define RADEON_CONFIG_APER_SIZE		0x0108
+#define RADEON_CONFIG_MEMSIZE		0x00f8
 #define RADEON_CRTC_OFFSET		0x0224
 #define RADEON_CRTC_OFFSET_CNTL		0x0228
 #	define RADEON_CRTC_TILE_EN		(1 << 15)
Acked-by
#8 lore raw
Quoted 9 lines

Finally fixes the radeon memory mapping bug that was incorrectly fixed by the previous patch. This time, we use the actual vram size as the size to calculate how far to move the AGP aperture> from the framebuffer in card's memory space. If there are still issues with this patch, they are due to bugs in the X driver that I'm working on fixing too.

Quoted 42 lines

Index: linux-work/drivers/char/drm/radeon_cp.c
===================================================================

drivers/char/drm/radeon_cp.c +7 -2
@@ -1312,6 +1312,8 @@
 static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;;
+	unsigned int mem_size;
+
 	DRM_DEBUG("\n");
 
 	dev_priv->is_pci = init->is_pci;
@@ -1521,8 +1523,11 @@
 					  + dev_priv->fb_location) >> 10));
 
 	dev_priv->gart_size = init->gart_size;
-	dev_priv->gart_vm_start = dev_priv->fb_location
-	    + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
+
+	mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE);
+	if (mem_size == 0)
+		mem_size = 0x800000;
+	dev_priv->gart_vm_start = dev_priv->fb_location + mem_size;
 
 #if __OS_HAS_AGP
 	if (!dev_priv->is_pci)

Index: linux-work/drivers/char/drm/radeon_drv.h
===================================================================

drivers/char/drm/radeon_drv.h +1 -0
@@ -379,6 +379,7 @@
 #	define RADEON_PLL_WR_EN			(1 << 7)
 #define RADEON_CLOCK_CNTL_INDEX		0x0008
 #define RADEON_CONFIG_APER_SIZE		0x0108
+#define RADEON_CONFIG_MEMSIZE		0x00f8
 #define RADEON_CRTC_OFFSET		0x0224
 #define RADEON_CRTC_OFFSET_CNTL		0x0228
 #	define RADEON_CRTC_TILE_EN		(1 << 15)
Signature · 3 lines
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
Linux kernel - DRI, VAX / pam_smb / ILUG
#9 lore raw
In reply to Benjamin Herrenschmidt
Quoted 6 lines · Benjamin Herrenschmidt

Finally fixes the radeon memory mapping bug that was incorrectly fixed by the previous patch. This time, we use the actual vram size as the size to calculate how far to move the AGP aperture from the framebuffer in card's memory space. If there are still issues with this patch, they are due to bugs in the X driver that I'm working on fixing too.

My amd64 machine with an agp radeon9200SE locks up tight on xserver start (with an MCE) unless I revert both patches. I'm using x.org 6.9 compiled from the debian svn tree. The output of 'lspci -vv' is available here:

http://www.lucidts.com/~will/lspcivv.txt

Please let me know of any testing I can do on x.org radeon DDX patches, or any additional information I can provide.

--
Will Dyson

#10 lore raw
Quoted 13 lines · Will Dyson
Quoted 6 lines · Benjamin Herrenschmidt

Finally fixes the radeon memory mapping bug that was incorrectly fixed by the previous patch. This time, we use the actual vram size as the size to calculate how far to move the AGP aperture from the framebuffer in card's memory space. If there are still issues with this patch, they are due to bugs in the X driver that I'm working on fixing too.

My amd64 machine with an agp radeon9200SE locks up tight on xserver start (with an MCE) unless I revert both patches. I'm using x.org 6.9 compiled from the debian svn tree. The output of 'lspci -vv' is available here:

Quoted 4 lines

http://www.lucidts.com/~will/lspcivv.txt

Please let me know of any testing I can do on x.org radeon DDX patches, or any additional information I can provide.

Can you try the additional patch I sent ? If it doesn't help, I'll try to send later today or tomorow a patch adding more debug informations so I can figure out what's going on...

Ben.

#11 lore raw
In reply to Benjamin Herrenschmidt

Hi Benjamin:

Quoted 19 lines · Benjamin Herrenschmidt
Quoted 10 lines · Mark M. Hoffman

Hello:

Quoted 6 lines · git bisect

47807ce381acc34a7ffee2b42e35e96c0f322e52 is first bad commit
diff-tree 47807ce381acc34a7ffee2b42e35e96c0f322e52 (from 0e670506668a43e1355b8f10c33d081a676bd521)

Author: Dave Airlie <[email protected]>
Date:   Tue Dec 13 04:18:41 2005 +0000

[drm] fix radeon aperture issue

Quoted 7 lines

With this one applied, my machine locks up tight just after starting the Xserver. Some info (dmesg, lspci, config) is here:

http://members.dca.net/mhoffman/lkml-20051214/

I can put a serial console on it if necessary, but not until about this time tomorrow.

Quoted 6 lines

You have to love this X radeon driver ... you can't fix one bug without breaking something else, it's one of the worst piece of crap I've ever seen...

What would be useful now is the X version and maybe trying a little hack in the X driver. Do you have ways to rebuild the X driver at all ?

Check the link again for log & config. I have not built any part of X from source before. But if it's necessary, I will try it.

Quoted 11 lines

The problem is, that patch actually fixes some users... Ah, also, could you maybe add some printk's around the code that is modified by that patch and try to catch the value it tries to use before the lockup ?

That is, print the values of:

dev_priv->fb_location

and

RADEON_READ(RADEON_CONFIG_APER_SIZE)

These suggestions, along with later ones that involve recompiles... I will try them late this evening (EST).

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#12 lore raw
In reply to Mark M. Hoffman
Quoted 4 lines
Quoted 1 line

[drm] fix radeon aperture issue

With this one applied, my machine locks up tight just after starting the Xserver. Some info (dmesg, lspci, config) is here:

Can you give me an Xorg.0.log and /etc/X11/xorg.conf

I've got the same card here and it seems to work for me .. so maybe its a configuration issue..

Dave.

#13 lore raw

Hi Dave:

Quoted 9 lines · Dave Airlie
Quoted 4 lines
Quoted 1 line

[drm] fix radeon aperture issue

With this one applied, my machine locks up tight just after starting the Xserver. Some info (dmesg, lspci, config) is here:

Can you give me an Xorg.0.log and /etc/X11/xorg.conf

I've got the same card here and it seems to work for me .. so maybe its a configuration issue..

I've added both files here:

http://members.dca.net/mhoffman/lkml-20051214/

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]