# instant reboot when Xorg exits on 8.1-RC2 with Radeon 4850



## swills@ (Jul 5, 2010)

Subject pretty much says it all. I've upgraded my 8.0-STABLE system to 8.1-RC2 and updated ports. I use KDM and can login to KDE4 just fine. However, when I log out, my system reboots. I've tried setting dumpdev in /etc/rc.conf in hopes of getting a panic message, but there isn't one. Any ideas would be appreciated.


----------



## swills@ (Jul 5, 2010)

I realized I should include more info. I'm using the radeonhd driver. I tried radeonhd-devel, but get the same behavior. Another thing I've noticed (by disabling kdm and using startx) is that it isn't the logout that causes the reboot, it's starting X the second time.


----------



## wblock@ (Jul 5, 2010)

swills said:
			
		

> I realized I should include more info. I'm using the radeonhd driver.



Use radeon instead.



> I tried radeonhd-devel, but get the same behavior. Another thing I've noticed (by disabling kdm and using startx) is that it isn't the logout that causes the reboot, it's starting X the second time.



/var/log/Xorg.0.log might be useful in seeing what's happening.


----------



## swills@ (Jul 5, 2010)

Ok, I'm using radeon driver now. Still the same thing happens.

Here's Xorg.0.log: http://pastebin.com/YuTjH1Qp

(tried to past it here, but it was too long)


----------



## wblock@ (Jul 5, 2010)

```
(EE) config/hal: couldn't initialise context: unknown error (null)
```

That looks odd but certainly shouldn't cause a reboot.  Nothing else really jumps out.

Maybe it's not X but something in KDE.  Do you still have the problem if you just run twm from .xinitrc?

```
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
```


----------



## swills@ (Jul 5, 2010)

Yep, doesn't really matter if it's KDM or if I disable that and run startx (with twm) from command line. First time it starts up fine, second time, instant reboot.


----------



## swills@ (Jul 5, 2010)

FWIW, I tried disabling DRI but it still does the same thing.


----------



## wblock@ (Jul 5, 2010)

Worth testing with Composite disabled, but that seems doubtful.

Are there any odd things going on, like custom CFLAGS or overclocking?


----------



## swills@ (Jul 5, 2010)

The CPU is overclocked, but only slightly and that has never been a problem before. It's an Intel Core i7 920, currently at 3ghz, and from what I've read, it can handle a lot more. Been like that for over a year and never had any problems on 8.0

There are no custom CFLAGS.

Disabling Composite didn't change anything.


----------



## wblock@ (Jul 5, 2010)

No problems on 8.0 with xorg 7.5?  So the only thing that changed was you went to 8.1-RC2?


----------



## swills@ (Jul 5, 2010)

When I was on 8.0 I was also on Xorg 7.4. Both were upgraded at the same time. Sorry if that was misleadingly worded.


----------



## adamk (Jul 5, 2010)

What happens if you unload the 'radeon' kernel module after starting X, and then reloading it manually before starting X the second time?

Adam


----------



## swills@ (Jul 5, 2010)

With my current xorg.conf, radeon kernel modules is not even getting loaded. And yet the problem still happens.


----------



## adamk (Jul 5, 2010)

I suggest opening up a FreeBSD problem report and reporting this on the freebsd-x11 mailing list.

Adam


----------



## wblock@ (Jul 5, 2010)

swills said:
			
		

> With my current xorg.conf, radeon kernel modules is not even getting loaded. And yet the problem still happens.



Sorry, I don't understand.  radeon.ko should be auto-loaded when you start X, and should still be hanging around after exit:


```
% kldstat
Id Refs Address    Size     Name
...
 7    1 0xc6487000 68000    radeon.ko
 8    1 0xc64ef000 13000    drm.ko
```

Unless you have it built into the kernel (but why?).

Just to make sure I'm not assuming something:
WITHOUT_NOUVEAU=yes in /etc/make.conf
upgraded to 8.1-rc2 via source; didn't forget installworld!


----------



## adamk (Jul 5, 2010)

wblock said:
			
		

> Sorry, I don't understand.  radeon.ko should be auto-loaded when you start X, and should still be hanging around after exit:
> 
> 
> ```
> ...



He said he disabled DRI previously, so I assume that's why radeon isn't getting loaded.  

The odd thing here is that most graphics related reboots and hangs are due to the kernel DRM code, but apparently that's not the case for the OP.

Adam


----------



## wblock@ (Jul 5, 2010)

adamk said:
			
		

> He said he disabled DRI previously, so I assume that's why radeon isn't getting loaded.



Assumption on my part; if it didn't make any difference, I'd have turned it back on to avoid changing more than one thing at a time.


----------



## swills@ (Jul 5, 2010)

Fair point, but it was easier to test with it already disabled and since it didn't make a difference, I didn't bother testing the other way. I do have WITHOUT_NOUVEAU=yes in /etc/make.conf, BTW.


----------



## swills@ (Jul 5, 2010)

PR submitted...


----------



## swills@ (Jul 6, 2010)

Decided to try unloading radeon and drm after the first start. Now when I try to startx the second time, I get:


```
(EE) Failed to load module "fbdev" (module does not exist, 0)
(EE) RADEON(0): No valid MMIO address
(EE) Screen(s) found, but none have a usable configuration.
```
If I then manually load them, it changes slightly to:


```
(EE) Failed to load module "fbdev" (module does not exist, 0)
(EE) RADEON(0): No valid linear framebuffer address
(EE) Screen(s) found, but none have a usable configuration.
```
No idea what to make of that.


----------



## swills@ (Jul 6, 2010)

Oh, and if I then switch it to radeonhd, I get:


```
(EE) RADEONHD(0): No Video RAM detected.
(EE) Screen(s) found, but none have a usable configuration.
```
With this in the log:



```
(II) RADEONHD(0): Analog TV Default Mode: 8
(II) RADEONHD(0): Found default TV Mode PAL
(II) RADEONHD(0): The detected amount of videoram exceeds the PCI BAR aperture.
(II) RADEONHD(0): Using only 0kB of the total 1048576kB.
(EE) RADEONHD(0): No Video RAM detected.
(II) UnloadModule: "radeonhd"
(EE) Screen(s) found, but none have a usable configuration.
```
Seems like a bug in drm, but I'm not sure.


----------



## adamk (Jul 6, 2010)

It doesn't make sense that it's a bug in the DRM since you have this problem even when the 'radeon' kernel module isn't loaded.

Adam


----------



## wblock@ (Jul 6, 2010)

swills said:
			
		

> The CPU is overclocked, but only slightly and that has never been a problem before. It's an Intel Core i7 920, currently at 3ghz, and from what I've read, it can handle a lot more. Been like that for over a year and never had any problems on 8.0



Back to this: you have a newer version of the OS along with different xorg-server and drivers.  Maybe now it's touchier about the overclocking.


----------



## swills@ (Jul 7, 2010)

Don't think so. The response I got to the PR was that it's a known software bug. See

http://old.nabble.com/freebsd7,-radeon,-xorg-server-->-deadlock-or-so-td27524122.html


----------



## swills@ (Jul 10, 2010)

Also see:

http://lists.freebsd.org/pipermail/freebsd-x11/2010-May/009706.html


----------



## swills@ (Jul 10, 2010)

*Solved!*

I'm happy to report a BIOS update has solved this problem! Haven't gotten compositing back yet, but I'll get there.

Edit: Got compositing working.


----------

