Bug 12161

Summary: crash at server startup with an avivo driver
Product: xorg Reporter: Dodji Seketeli <dodji>
Component: Driver/avivoAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 12160    
Bug Blocks:    

Description Dodji Seketeli 2007-08-25 12:59:10 UTC
I did compile a server from master, revision 4eed88af8b7b6881b44ccf9f4a5c5875af6d2b78 (Fri Aug 24 18:06:50 2007 -0700) containing the pci rework.

I also compiled the avivo driver, revision 6ab229becb97631c6990a2c677b82d839a0ae6f1 (Wed Aug 22 01:32:08 2007 +0200).

My card is an ati mobility x1400, PCI device ID PCI_CHIP_M54_7145.

When I start the server I compiled, it crashes instantly with the following trace:

(gdb) run
Starting program: /etc/X11/X -config /home/dodji/prefix/xorg/etc/X11/xorg.conf
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1211938624 (LWP 2477)]

X Window System Version 7.2.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 7.2
Build Operating System: Linux 2.6.22-1-686 i686
Current Operating System: Linux coin 2.6.22-1-686 #1 SMP Sun Jul 29 14:37:42 UTC 2007 i686
Build Date: 25 August 2007  10:45:33AM

        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Aug 25 21:25:34 2007
(++) Using config file: "/home/dodji/prefix/xorg/etc/X11/xorg.conf"
(II) Module "i2c" already built-in
(II) Module "ddc" already built-in
[tcsetpgrp failed in terminal_inferior: Operation not permitted]
(II) Module "ramdac" already built-in

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211938624 (LWP 2477)]
0xb7b889d2 in avivo_i2c_gpio123_put_bits (b=0x8279718, Clock=1, data=1) at avivo_i2c.c:83
83          OUTREG(b->DriverPrivate.uval + 0x8, val);
(gdb) p b
$1 = (I2CBusPtr) 0x8279718
(gdb) bt
#0  0xb7b889d2 in avivo_i2c_gpio123_put_bits (b=0x8279718, Clock=1, data=1) at avivo_i2c.c:83
#1  0x0811fb25 in I2CRaiseSCL (b=0x8279718, sda=1, timeout=5) at xf86i2c.c:115
#2  0x0811fbca in I2CStart (b=0x8279718, timeout=5) at xf86i2c.c:154
#3  0x08120118 in I2CAddress (d=0xbfdb1d00, addr=160) at xf86i2c.c:359
#4  0x081201fd in xf86I2CProbeAddress (b=0x8279718, addr=160) at xf86i2c.c:400
#5  0xb7b87ef3 in avivo_output_detect_ddc_dac (output=0x82797a8) at avivo_output.c:318
#6  0x0810dda6 in xf86ProbeOutputModes (scrn=0x8277f08, maxX=2048, maxY=2048) at xf86Crtc.c:1257
#7  0x0810e80c in xf86InitialConfiguration (scrn=0x8277f08, canGrow=0) at xf86Crtc.c:1560
#8  0xb7b890be in avivo_preinit (screen_info=0x8277f08, flags=0) at avivo.c:456
#9  0x080ba22a in InitOutput (pScreenInfo=0x8266860, argc=3, argv=0xbfdb2134) at xf86Init.c:755
#10 0x080728a7 in main (argc=3, argv=0xbfdb2134, envp=0xbfdb2144) at main.c:369
(gdb) frame 0
#0  0xb7b889d2 in avivo_i2c_gpio123_put_bits (b=0x8279718, Clock=1, data=1) at avivo_i2c.c:83
83          OUTREG(b->DriverPrivate.uval + 0x8, val);
(gdb) l
78          unsigned long  val;
79
80          val = 0;
81          val |= (Clock ? 0:(1<<0));
82          val |= (data ? 0:(1<<8));
83          OUTREG(b->DriverPrivate.uval + 0x8, val);
84          /* read back to improve reliability on some cards. */
85          val = INREG(b->DriverPrivate.uval + 0x8);
86      }
(gdb) p val
$2 = 0
(gdb) p b->DriverPrivate.uval
$3 = 32320
Comment 1 Dodji Seketeli 2007-08-25 13:00:58 UTC
Oh, I forgot to add that to get the tree to compile, I did apply the patch https://bugs.freedesktop.org/attachment.cgi?id=11273 before. So the crash I am having does happen with that patch.
Comment 2 Dodji Seketeli 2007-08-26 11:36:35 UTC
Okay,

It seems the crash was due to the driver not being completely ported to the pciaccess rework code base.

So I tried to provide a patch that at maps MMIO and framebuffer memory into virtuall address space using the libpciaccess library and the crash has disappeared for me.

The patch is at https://bugs.freedesktop.org/attachment.cgi?id=11282
Comment 3 Jerome Glisse 2007-08-28 15:33:00 UTC
Should be fixed now :)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.