Bug 19017

Summary: Oops with agpgart on a startup
Product: [Retired] Red Hat Linux Reporter: Michal Jaegermann <michal>
Component: kernelAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-12-14 16:15:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2000-10-13 04:24:51 UTC
During startup modprobe ends up with a segmentation fault because
of the following oops:

Linux version 2.2.17-3 (root.redhat.com) (gcc version
egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)) #1 Thu Oct 5 16:55:13 EDT 2000
Booting GENERIC on Nautilus using machine vector NAUTILUS from SRM
Command line: root=/dev/hda1
Iron stat_cmd 2100006
Iron dramms 2060300
.....
Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 204M
agpgart: Detected AMD Irongate chipset
Unable to handle kernel paging request at virtual address 0000000062000004
modprobe(156): Oops 1
pc = [<fffffe000084cfc8>]  ra = [<fffffe000084cf9c>]  ps = 0000
v0 = 0000000000000000  t0 = 0000000062000000  t1 = 0000000062000000
t2 = 0000000003ec0000  t3 = 00000000000016c2  t4 = fffffe000085c000
t5 = fffffe000085c000  t6 = fffffffe00000000  t7 = fffffc000dd6c000
s0 = fffffe0000850f68  s1 = fffffe0000851080  s2 = fffffe0000850a88
s3 = 0000000000000001  s4 = 0000000000000001  s5 = fffffe0000850f68
s6 = fffffc000dd6ff00  a0 = fffffd01fe000014  a1 = 00000000000000b0
a2 = 0000000000000080  a3 = fffffc00005b32f0  a4 = fffffc000dd6fd70
a5 = fffffc000dd6fd68  t8 = 0000000000000001  t9 = fffffc0000582fdc
t10= 0000000000000000  t11= 0000000000000001  pv = fffffc000031d3a0
at = fffffe000085c000  gp = fffffe00008590c8  sp = fffffc000dd6fd98
Code:
 47f01412  or zero,128,a2
 4441f102  andnot t1,15,t1
 44420401  or t1,t1,t0
 b05e0020  stl t1,32(sp)
 4821f621  zapnot t0,15,t0
 b42a0000  stq t0,0(s1)
*b0610004  stl t2,4(t0)
 a6090028  ldq a0,40(sTrace: 331cb4 33b87c 310cf8 44fd60 

After that 'lsmod' produces, among other things,

agpgart                29984   1  (initializing)

and 'agpgart' is impossible to delete.  This happens because kudzu
generates this in /etc/sysconfig/hwconf:

class: OTHER
bus: PCI
detached: 0
driver: agpgart
desc: "Advanced Micro Devices [AMD]|AMD-751 [Irongate] System Controller"
vendorId: 1022
deviceId: 7006
subVendorId: 0000
subDeviceId: 0000
pciType: 1

which is inded correct as shown by 'lspci -tv'

-[00]-+-00.0  Advanced Micro Devices [AMD] AMD-751 [Irongate] System
Controller
      +-01.0-[02]--
      +-03.0  Acer Laboratories Inc. [ALi]: Unknown device 5453
      +-06.0  Acer Laboratories Inc. [ALi]: Unknown device 5451
      +-07.0  Acer Laboratories Inc. [ALi] M1533 PCI to ISA Bridge [Aladdin
IV]
      +-08.0  Symbios Logic Inc. (formerly NCR) 53c895
      +-09.0  Texas Instruments TVP4020 [Permedia 2]
      +-0b.0  Digital Equipment Corporation DECchip 21142/43
      +-10.0  Acer Laboratories Inc. [ALi] M5229 IDE
      +-11.0  Acer Laboratories Inc. [ALi] M7101 PMU
      \-14.0  Acer Laboratories Inc. [ALi] M5237 USB

  Michal
  michal
0)

Comment 1 Michal Jaegermann 2000-10-14 16:49:09 UTC
Opps happens on this code:

        /* Write out the address of the gatt table */
        OUTREG32(amd_irongate_private.registers, AMD_ATTBASE,
                 agp_bridge.gatt_bus_addr);

Line 1667 in drivers/char/agp/agpgart_be.c, function
amd_irongate_configure().


Comment 2 Michal Jaegermann 2000-10-17 17:36:58 UTC
Here is a patch:
--- linux-2.2.18px/drivers/char/agp/agp.h~      Tue Oct  3 16:03:13 2000
+++ linux-2.2.18px/drivers/char/agp/agp.h       Tue Oct 17 10:23:14 2000
@@ -27,6 +27,8 @@
 #ifndef _AGP_BACKEND_PRIV_H
 #define _AGP_BACKEND_PRIV_H 1
 
+#include <asm/io.h>
+
 enum aper_size_type {
        U8_APER_SIZE,
        U16_APER_SIZE,
@@ -119,13 +121,13 @@
        void (*free_by_type) (agp_memory *);
 };
 
-#define OUTREG32(mmap, addr, val)   *(volatile u32 *)(mmap + (addr)) = (val)
-#define OUTREG16(mmap, addr, val)   *(volatile u16 *)(mmap + (addr)) = (val)
-#define OUTREG8 (mmap, addr, val)   *(volatile u8 *) (mmap + (addr)) = (val)
-
-#define INREG32(mmap, addr)         *(volatile u32 *)(mmap + (addr))
-#define INREG16(mmap, addr)         *(volatile u16 *)(mmap + (addr))
-#define INREG8 (mmap, addr)         *(volatile u8 *) (mmap + (addr))
+#define OUTREG32(mmap, addr, val)   writel((val),(mmap + (addr)))
+#define OUTREG16(mmap, addr, val)   writew((val),(mmap + (addr)))
+#define OUTREG8 (mmap, addr, val)   writeb((val),(mmap + (addr)))
+
+#define INREG32(mmap, addr)         readl(mmap + (addr))
+#define INREG16(mmap, addr)         readw(mmap + (addr))
+#define INREG8 (mmap, addr)         readb(mmap + (addr))
 
 #define CACHE_FLUSH    agp_bridge.cache_flush
 #define A_SIZE_8(x)    ((aper_size_info_8 *) x)

The module still may be not doing anything useful but at least will
not oops.  For x86 patched code compiles to exactly the same binary
object file as before

Comment 3 Phil Copeland 2001-06-04 17:00:53 UTC
I believe this is fixed in the current rawhide kernels