Re: panic in radeondrm_attachhook

2018-04-24 Thread Jonathan Gray
On Tue, Apr 24, 2018 at 02:25:24PM +0200, Alexander Bluhm wrote:
> On Tue, Apr 24, 2018 at 08:18:42PM +1000, Jonathan Gray wrote:
> > After spending some time trying to track this down I have come up with
> > the diff below and included it in ~jsg/radeon.diff.4 can you confirm
> > that it works for you as well?
> 
> With this diff my machine boots fine.  No monitor connect, so I
> cannot test X11.  When I blindly run startx and kill it with Ctrl-C,
> I get on the console:
> 
> Can't enable IRQ/MSI because no handler is installed

This is expected, the interrupt handler is only established when the ring
tests pass and acceleration is enabled.  When init is aborted after
firmware is not found acceleration is disabled.

> 
> I have no firmware, so I do not expect that it works.  No crash is
> enough for me.

Thanks for reporting and testing the fix.

> 
> bluhm
> 
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>   
> The Regents of the University of California.  All rights reserved.
>   
> Copyright (c) 1995-2018 OpenBSD. All rights reserved.  
> https://www.OpenBSD.org  
> 
> OpenBSD 6.3-current (GENERIC.MP) #0: Tue Apr 24 14:03:04 CEST 2018
> r...@ot1.obsd-lab.genua.de:/usr/src/sys/arch/i386/compile/GENERIC.MP
> real mem  = 2145783808 (2046MB)
> avail mem = 2091991040 (1995MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 @ 
> 0x7feea000 (35 entries)
> bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
> bios0: Supermicro PDSM4+
> acpi0 at bios0: rev 0
> acpi0: sleep states S0 S1 S4 S5
> acpi0: tables DSDT FACP MCFG APIC BOOT SSDT
> acpi0: wakeup devices PXHA(S5) PXHB(S5) DEV3(S5) EXP1(S5) EXP5(S5) EXP6(S5) 
> PCIB(S5) KBC0(S1) MSE0(S1) COM1(S5) COM2(S5) USB1(S4) USB2(S4) USB3(S4) 
> USB4(S4) EUSB(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimcfg0 at acpi0 addr 0xf000, bus 0-14
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 
> GHz
> cpu0: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 266MHz
> cpu0: mwait min=64, max=64, C-substates=0.2, IBE
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 
> GHz
> cpu1: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
> ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
> ioapic1 at mainbus0: apid 3 pa 0xfecc, version 20, 24 pins
> ioapic2 at mainbus0: apid 4 pa 0xfecc0400, version 20, 24 pins
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 2 (PXHA)
> acpiprt2 at acpi0: bus 3 (PXHB)
> acpiprt3 at acpi0: bus -1 (DEV3)
> acpiprt4 at acpi0: bus 9 (EXP1)
> acpiprt5 at acpi0: bus 13 (EXP5)
> acpiprt6 at acpi0: bus 14 (EXP6)
> acpiprt7 at acpi0: bus 15 (PCIB)
> acpicpu0 at acpi0: C1(@1 halt!)
> acpicpu1 at acpi0: C1(@1 halt!)
> acpicmos0 at acpi0
> "PNP0A05" at acpi0 not configured
> acpibtn0 at acpi0: PWRB
> bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x2600
> ipmi at mainbus0 not configured
> cpu0: Enhanced SpeedStep disabled by BIOS
> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> pchb0 at pci0 dev 0 function 0 "Intel E7230 Host" rev 0xc0
> ppb0 at pci0 dev 1 function 0 "Intel E7230 PCIE" rev 0xc0: apic 2 int 16
> pci1 at ppb0 bus 1
> ppb1 at pci1 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
> pci2 at ppb1 bus 2
> em0 at pci2 dev 2 function 0 "Intel 82545GM" rev 0x04: apic 3 int 4, address 
> 00:04:23:cd:41:fb
> "Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 1 not configured
> ppb2 at pci1 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
> pci3 at ppb2 bus 3
> em1 at pci3 dev 1 function 0 "Intel 82545GM" rev 0x04: apic 4 int 0, address 
> 00:1b:21:0e:6e:8e
> ami0 at pci3 dev 3 function 0 "Symbios Logic MegaRAID" rev 0x01: apic 4 int 4
> ami0: LSI 520, 64b/lhc, FW 1L47, BIOS vG121, 128MB RAM
> ami0: 1 channels, 0 FC loops, 2 logical drives
> scsibus1 at ami0: 40 targets
> sd0 at scsibus1 targ 0 lun 0:  SCSI2 0/direct fixed
> sd0: 35045MB, 512 bytes/sector, 71772160 sectors
> sd1 at scsibus1 targ 1 lun 0:  SCSI2 0/direct fixed
> sd1: 140271MB, 512 bytes/sector, 287275008 sectors
> scsibus2 at ami0: 16 targets
> "Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 3 not configured
> ppb3 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: apic 2 int 17
> pci4 at ppb3 bus 9
> ppb4 

Re: panic in radeondrm_attachhook

2018-04-24 Thread Alexander Bluhm
On Tue, Apr 24, 2018 at 08:18:42PM +1000, Jonathan Gray wrote:
> After spending some time trying to track this down I have come up with
> the diff below and included it in ~jsg/radeon.diff.4 can you confirm
> that it works for you as well?

With this diff my machine boots fine.  No monitor connect, so I
cannot test X11.  When I blindly run startx and kill it with Ctrl-C,
I get on the console:

Can't enable IRQ/MSI because no handler is installed

I have no firmware, so I do not expect that it works.  No crash is
enough for me.

bluhm

Copyright (c) 1982, 1986, 1989, 1991, 1993  
The Regents of the University of California.  All rights reserved.  
Copyright (c) 1995-2018 OpenBSD. All rights reserved.  https://www.OpenBSD.org  

OpenBSD 6.3-current (GENERIC.MP) #0: Tue Apr 24 14:03:04 CEST 2018
r...@ot1.obsd-lab.genua.de:/usr/src/sys/arch/i386/compile/GENERIC.MP
real mem  = 2145783808 (2046MB)
avail mem = 2091991040 (1995MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 @ 
0x7feea000 (35 entries)
bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
bios0: Supermicro PDSM4+
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP MCFG APIC BOOT SSDT
acpi0: wakeup devices PXHA(S5) PXHB(S5) DEV3(S5) EXP1(S5) EXP5(S5) EXP6(S5) 
PCIB(S5) KBC0(S1) MSE0(S1) COM1(S5) COM2(S5) USB1(S4) USB2(S4) USB3(S4) 
USB4(S4) EUSB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-14
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfecc, version 20, 24 pins
ioapic2 at mainbus0: apid 4 pa 0xfecc0400, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PXHA)
acpiprt2 at acpi0: bus 3 (PXHB)
acpiprt3 at acpi0: bus -1 (DEV3)
acpiprt4 at acpi0: bus 9 (EXP1)
acpiprt5 at acpi0: bus 13 (EXP5)
acpiprt6 at acpi0: bus 14 (EXP6)
acpiprt7 at acpi0: bus 15 (PCIB)
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
acpicmos0 at acpi0
"PNP0A05" at acpi0 not configured
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x2600
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep disabled by BIOS
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel E7230 Host" rev 0xc0
ppb0 at pci0 dev 1 function 0 "Intel E7230 PCIE" rev 0xc0: apic 2 int 16
pci1 at ppb0 bus 1
ppb1 at pci1 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci2 at ppb1 bus 2
em0 at pci2 dev 2 function 0 "Intel 82545GM" rev 0x04: apic 3 int 4, address 
00:04:23:cd:41:fb
"Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 1 not configured
ppb2 at pci1 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci3 at ppb2 bus 3
em1 at pci3 dev 1 function 0 "Intel 82545GM" rev 0x04: apic 4 int 0, address 
00:1b:21:0e:6e:8e
ami0 at pci3 dev 3 function 0 "Symbios Logic MegaRAID" rev 0x01: apic 4 int 4
ami0: LSI 520, 64b/lhc, FW 1L47, BIOS vG121, 128MB RAM
ami0: 1 channels, 0 FC loops, 2 logical drives
scsibus1 at ami0: 40 targets
sd0 at scsibus1 targ 0 lun 0:  SCSI2 0/direct fixed
sd0: 35045MB, 512 bytes/sector, 71772160 sectors
sd1 at scsibus1 targ 1 lun 0:  SCSI2 0/direct fixed
sd1: 140271MB, 512 bytes/sector, 287275008 sectors
scsibus2 at ami0: 16 targets
"Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 3 not configured
ppb3 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: apic 2 int 17
pci4 at ppb3 bus 9
ppb4 at pci0 dev 28 function 4 "Intel 82801G PCIE" rev 0x01: apic 2 int 17
pci5 at ppb4 bus 13
em2 at pci5 dev 0 function 0 "Intel 82573E" rev 0x03: msi, address 
00:30:48:8c:50:20
ppb5 at pci0 dev 28 function 5 "Intel 82801G PCIE" rev 0x01: apic 2 int 16
pci6 at ppb5 bus 14
em3 at pci6 dev 0 function 0 "Intel 82573L" rev 0x00: msi, address 
00:30:48:8c:50:21
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 2 int 

Re: panic in radeondrm_attachhook

2018-04-24 Thread Jonathan Gray
On Tue, Apr 24, 2018 at 01:53:07PM +0200, Mark Kettenis wrote:
> > Date: Tue, 24 Apr 2018 20:18:42 +1000
> > From: Jonathan Gray 
> > 
> > On Wed, Apr 18, 2018 at 06:55:35PM +0200, Alexander Bluhm wrote:
> > > On Thu, Apr 19, 2018 at 12:10:04AM +1000, Jonathan Gray wrote:
> > > > That's with the big radeon update diff as well?
> > > 
> > > That was current.  Boots fine.
> > > 
> > > With ~jsg/radeon.diff.2 it still crashes.  I have checked, it is
> > > the diff with
> > > 
> > > if (rdev->rio_mem_size > 0)
> > > bus_space_unmap(rdev->iot, rdev->rio_mem, 
> > > rdev->rio_mem_size);
> > > 
> > > initializing kernel modesetting (RV100 0x1002:0x515E 0x1002:0x515E).
> > > radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
> > > error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
> > > drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
> > > drm:pid0:r100_init *ERROR* Disabling GPU acceleration
> > > uvm_fault(0xd0cae21c, 0xd11e2000, 0, 1) -> e
> > > kernel: page fault trap, code=0
> > > Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> > > ddb{0}> trace
> > > pmap_page_remove_pae(d11e2768) at pmap_page_remove_pae+0x18
> > > ttm_tt_destroy(d5765a00) at ttm_tt_destroy+0x61
> > > ttm_bo_cleanup_refs_or_queue(d572eb28) at 
> > > ttm_bo_cleanup_refs_or_queue+0x2b3
> > > ttm_bo_unref(d0f63ed8) at ttm_bo_unref+0x69
> > > radeon_bo_unref(d572eb28) at radeon_bo_unref+0x27
> > > radeon_wb_fini(d572d000) at radeon_wb_fini+0x49
> > > r100_init(d572d000) at r100_init+0x409
> > > radeon_device_init(d572d000,d5701400,d570143c,840001) at 
> > > radeon_device_init+0x7
> > > 97
> > > radeondrm_attachhook(d572d000) at radeondrm_attachhook+0x2b
> > > config_process_deferred_mountroot() at 
> > > config_process_deferred_mountroot+0x2c
> > > main(0) at main+0x7bf
> > 
> > After spending some time trying to track this down I have come up with
> > the diff below and included it in ~jsg/radeon.diff.4 can you confirm
> > that it works for you as well?
> 
> That fix is correct.  UVM works differently from the Linux VM system,
> so we can't really implement kunmap().  Maybe we should rename it (to
> kunmap_virt()?).

That is a good idea.  I'd like to get the radeondrm update in first though.

> 
> Cheers,
> 
> Mark
> 
> 
> > diff --git sys/dev/pci/drm/ttm/ttm_bo_util.c 
> > sys/dev/pci/drm/ttm/ttm_bo_util.c
> > index 3b26d865be2..da6c459bd39 100644
> > --- sys/dev/pci/drm/ttm/ttm_bo_util.c
> > +++ sys/dev/pci/drm/ttm/ttm_bo_util.c
> > @@ -644,7 +644,7 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
> > vunmap(map->virtual, bo->mem.bus.size);
> > break;
> > case ttm_bo_map_kmap:
> > -   kunmap(map->page);
> > +   kunmap(map->virtual);
> > break;
> > case ttm_bo_map_premapped:
> > break;
> > 
> > 
> 



Re: panic in radeondrm_attachhook

2018-04-24 Thread Mark Kettenis
> Date: Tue, 24 Apr 2018 20:18:42 +1000
> From: Jonathan Gray 
> 
> On Wed, Apr 18, 2018 at 06:55:35PM +0200, Alexander Bluhm wrote:
> > On Thu, Apr 19, 2018 at 12:10:04AM +1000, Jonathan Gray wrote:
> > > That's with the big radeon update diff as well?
> > 
> > That was current.  Boots fine.
> > 
> > With ~jsg/radeon.diff.2 it still crashes.  I have checked, it is
> > the diff with
> > 
> > if (rdev->rio_mem_size > 0)
> > bus_space_unmap(rdev->iot, rdev->rio_mem, 
> > rdev->rio_mem_size);
> > 
> > initializing kernel modesetting (RV100 0x1002:0x515E 0x1002:0x515E).
> > radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
> > error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
> > drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
> > drm:pid0:r100_init *ERROR* Disabling GPU acceleration
> > uvm_fault(0xd0cae21c, 0xd11e2000, 0, 1) -> e
> > kernel: page fault trap, code=0
> > Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> > ddb{0}> trace
> > pmap_page_remove_pae(d11e2768) at pmap_page_remove_pae+0x18
> > ttm_tt_destroy(d5765a00) at ttm_tt_destroy+0x61
> > ttm_bo_cleanup_refs_or_queue(d572eb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
> > ttm_bo_unref(d0f63ed8) at ttm_bo_unref+0x69
> > radeon_bo_unref(d572eb28) at radeon_bo_unref+0x27
> > radeon_wb_fini(d572d000) at radeon_wb_fini+0x49
> > r100_init(d572d000) at r100_init+0x409
> > radeon_device_init(d572d000,d5701400,d570143c,840001) at 
> > radeon_device_init+0x7
> > 97
> > radeondrm_attachhook(d572d000) at radeondrm_attachhook+0x2b
> > config_process_deferred_mountroot() at 
> > config_process_deferred_mountroot+0x2c
> > main(0) at main+0x7bf
> 
> After spending some time trying to track this down I have come up with
> the diff below and included it in ~jsg/radeon.diff.4 can you confirm
> that it works for you as well?

That fix is correct.  UVM works differently from the Linux VM system,
so we can't really implement kunmap().  Maybe we should rename it (to
kunmap_virt()?).

Cheers,

Mark


> diff --git sys/dev/pci/drm/ttm/ttm_bo_util.c sys/dev/pci/drm/ttm/ttm_bo_util.c
> index 3b26d865be2..da6c459bd39 100644
> --- sys/dev/pci/drm/ttm/ttm_bo_util.c
> +++ sys/dev/pci/drm/ttm/ttm_bo_util.c
> @@ -644,7 +644,7 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
>   vunmap(map->virtual, bo->mem.bus.size);
>   break;
>   case ttm_bo_map_kmap:
> - kunmap(map->page);
> + kunmap(map->virtual);
>   break;
>   case ttm_bo_map_premapped:
>   break;
> 
> 



Re: panic in radeondrm_attachhook

2018-04-24 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 06:55:35PM +0200, Alexander Bluhm wrote:
> On Thu, Apr 19, 2018 at 12:10:04AM +1000, Jonathan Gray wrote:
> > That's with the big radeon update diff as well?
> 
> That was current.  Boots fine.
> 
> With ~jsg/radeon.diff.2 it still crashes.  I have checked, it is
> the diff with
> 
> if (rdev->rio_mem_size > 0)
> bus_space_unmap(rdev->iot, rdev->rio_mem, rdev->rio_mem_size);
> 
> initializing kernel modesetting (RV100 0x1002:0x515E 0x1002:0x515E).
> radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
> error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
> drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
> drm:pid0:r100_init *ERROR* Disabling GPU acceleration
> uvm_fault(0xd0cae21c, 0xd11e2000, 0, 1) -> e
> kernel: page fault trap, code=0
> Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> ddb{0}> trace
> pmap_page_remove_pae(d11e2768) at pmap_page_remove_pae+0x18
> ttm_tt_destroy(d5765a00) at ttm_tt_destroy+0x61
> ttm_bo_cleanup_refs_or_queue(d572eb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
> ttm_bo_unref(d0f63ed8) at ttm_bo_unref+0x69
> radeon_bo_unref(d572eb28) at radeon_bo_unref+0x27
> radeon_wb_fini(d572d000) at radeon_wb_fini+0x49
> r100_init(d572d000) at r100_init+0x409
> radeon_device_init(d572d000,d5701400,d570143c,840001) at 
> radeon_device_init+0x7
> 97
> radeondrm_attachhook(d572d000) at radeondrm_attachhook+0x2b
> config_process_deferred_mountroot() at config_process_deferred_mountroot+0x2c
> main(0) at main+0x7bf

After spending some time trying to track this down I have come up with
the diff below and included it in ~jsg/radeon.diff.4 can you confirm
that it works for you as well?

diff --git sys/dev/pci/drm/ttm/ttm_bo_util.c sys/dev/pci/drm/ttm/ttm_bo_util.c
index 3b26d865be2..da6c459bd39 100644
--- sys/dev/pci/drm/ttm/ttm_bo_util.c
+++ sys/dev/pci/drm/ttm/ttm_bo_util.c
@@ -644,7 +644,7 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
vunmap(map->virtual, bo->mem.bus.size);
break;
case ttm_bo_map_kmap:
-   kunmap(map->page);
+   kunmap(map->virtual);
break;
case ttm_bo_map_premapped:
break;



Re: panic in radeondrm_attachhook

2018-04-19 Thread Carlos Cardenas
On Fri, Apr 20, 2018 at 10:28:22AM +1000, Jonathan Gray wrote:
> On Thu, Apr 19, 2018 at 09:46:54AM -0700, Carlos Cardenas wrote:
> > On Thu, Apr 19, 2018 at 03:03:51PM +1000, Jonathan Gray wrote:
> > > On Wed, Apr 18, 2018 at 06:59:42PM -0700, Carlos Cardenas wrote:
> > > > On Thu, Apr 19, 2018 at 09:35:19AM +1000, Jonathan Gray wrote:
> > > > > On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> > > > > > Howdy.
> > > > > > 
> > > > > > Please excuse this poor bug report, I'm not able to obtain more 
> > > > > > info as
> > > > > > the system locks hard (below is transcribed by hand).
> > > > > > 
> > > > > > On a clean install, with the latest snap (as of time of email):
> > > > > > OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> > > > > > 
> > > > > > CPU: AMD A8-7670K Radeon R7 aka Kaveri
> > > > > > 
> > > > > > extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> > > > > > bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> > > > > > radeon_device_fini(800de000) at radeon_device_fini+0x43
> > > > > > radeondrm_detach_kms(0,800de000) at 
> > > > > > radeondrm_detach_kms+0x33
> > > > > > config_detach(800dd600,800de000) at 
> > > > > > config_detach+0x14e
> > > > > > radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> > > > > > config_process_deferred_mountroot() at 
> > > > > > config_process_deferred_mountroot+0x56
> > > > > > main(6dd84e08) at main+0x80f
> > > > > 
> > > > > See the other thread on bugs.  Not sure when a snapshot with the fix
> > > > > will go out.
> > > > 
> > > > I'm tracking bluhm's thread as well.
> > > > 
> > > > With snap #209 (which has that patch), we get further along from a clean
> > > > install:
> > > > 
> > > > initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
> > > > cik_cp: Failed to load firmware "radeon/KAVERI_pfp.bin"
> > > > error: [drm:pid0:cik_init] *ERROR* Failed to load Firmware!
> > > > drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
> > > > ttm_pool_mm_shrink_fini: stub
> > > > drm0 detached
> > > > radeondrm0 detached
> > > > vendor "ATI", unknown product 0x1313 (class display subclass VGA, rev 
> > > > 0xd4) at
> > > > pci0 dev 1 function 0 not configured
> > > > init: can't open /dev/console: Device not configured
> > > > init: can't open /dev/console: Device not configured
> > > > init: can't open /dev/console: Device not configured
> > > > [repeats]
> > > 
> > > So I'm quite sure you are booting via uefi with efifb here.
> > > There was previously no code that reprobed efifb as efifb isn't probed
> > > via pci devices.
> > > 
> > > The following on top of radeon.diff.2 works here when removing the
> > > firmware and booting via efiboot on a mullins system.
> > > 
> > 
> > That was itattached are two dmesg's:
> > * one after a clean install with no firmware loaded
> > * one after first boot with firmware loaded
> > 
> > With the firmware loaded, there's an artifact of a vertical purple line
> > along the left side of the screen (x=0) but everything seems to be ok (X
> > looks nice).
> 
> Are you setting a different gop mode via efiboot/boot.conf ?

Negative.

> 
> If you compile a kernel with efifb commented out (not just disabled via ukc)
> do the ring tests pass?

The tests still fail with the same messages:
initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
error: [drm:pid0:cik_ring_test] *ERROR* radeon: ring 2 test failed 
(scratch(0x3010C)=0xCAFEDEAD)
error: [drm:pid0:cik_sdma_ring_test] *ERROR* radeon: ring 3 test failed 
(0xCAFEDEAD)
drm:pid0:cik_init *ERROR* disabling GPU acceleration
Can't enable IRQ/MSI because no handler is installed
radeondrm0: 1920x1080, 32bpp

> 
> Proper acceleration on kaveri requires building Mesa 17.3 against ports
> libLLVM.  But the ring tests should still pass without that.

+--+
Carlos



Re: panic in radeondrm_attachhook

2018-04-19 Thread Jonathan Gray
On Thu, Apr 19, 2018 at 09:46:54AM -0700, Carlos Cardenas wrote:
> On Thu, Apr 19, 2018 at 03:03:51PM +1000, Jonathan Gray wrote:
> > On Wed, Apr 18, 2018 at 06:59:42PM -0700, Carlos Cardenas wrote:
> > > On Thu, Apr 19, 2018 at 09:35:19AM +1000, Jonathan Gray wrote:
> > > > On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> > > > > Howdy.
> > > > > 
> > > > > Please excuse this poor bug report, I'm not able to obtain more info 
> > > > > as
> > > > > the system locks hard (below is transcribed by hand).
> > > > > 
> > > > > On a clean install, with the latest snap (as of time of email):
> > > > > OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> > > > > 
> > > > > CPU: AMD A8-7670K Radeon R7 aka Kaveri
> > > > > 
> > > > > extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> > > > > bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> > > > > radeon_device_fini(800de000) at radeon_device_fini+0x43
> > > > > radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
> > > > > config_detach(800dd600,800de000) at 
> > > > > config_detach+0x14e
> > > > > radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> > > > > config_process_deferred_mountroot() at 
> > > > > config_process_deferred_mountroot+0x56
> > > > > main(6dd84e08) at main+0x80f
> > > > 
> > > > See the other thread on bugs.  Not sure when a snapshot with the fix
> > > > will go out.
> > > 
> > > I'm tracking bluhm's thread as well.
> > > 
> > > With snap #209 (which has that patch), we get further along from a clean
> > > install:
> > > 
> > > initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
> > > cik_cp: Failed to load firmware "radeon/KAVERI_pfp.bin"
> > > error: [drm:pid0:cik_init] *ERROR* Failed to load Firmware!
> > > drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
> > > ttm_pool_mm_shrink_fini: stub
> > > drm0 detached
> > > radeondrm0 detached
> > > vendor "ATI", unknown product 0x1313 (class display subclass VGA, rev 
> > > 0xd4) at
> > > pci0 dev 1 function 0 not configured
> > > init: can't open /dev/console: Device not configured
> > > init: can't open /dev/console: Device not configured
> > > init: can't open /dev/console: Device not configured
> > > [repeats]
> > 
> > So I'm quite sure you are booting via uefi with efifb here.
> > There was previously no code that reprobed efifb as efifb isn't probed
> > via pci devices.
> > 
> > The following on top of radeon.diff.2 works here when removing the
> > firmware and booting via efiboot on a mullins system.
> > 
> 
> That was itattached are two dmesg's:
> * one after a clean install with no firmware loaded
> * one after first boot with firmware loaded
> 
> With the firmware loaded, there's an artifact of a vertical purple line
> along the left side of the screen (x=0) but everything seems to be ok (X
> looks nice).

Are you setting a different gop mode via efiboot/boot.conf ?

If you compile a kernel with efifb commented out (not just disabled via ukc)
do the ring tests pass?

Proper acceleration on kaveri requires building Mesa 17.3 against ports
libLLVM.  But the ring tests should still pass without that.

> 
> Thanks for the hard work getting radeon updated.
> 
> +--+
> Carlos

> OpenBSD 6.3-current (GENERIC.MP) #0: Thu Apr 19 08:52:15 PDT 2018
> los@rollo.castle:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 16046288896 (15302MB)
> avail mem = 15552057344 (14831MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xecc20 (55 entries)
> bios0: vendor American Megatrends Inc. version "V1.3" date 04/13/2016
> bios0: MSI MS-7969
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP APIC FPDT FIDT MCFG HPET UEFI IVRS SSDT SSDT CRAT 
> SSDT SSDT
> acpi0: wakeup devices SBAZ(S4) P0PC(S4) OHC1(S4) EHC1(S4) OHC2(S4) EHC2(S4) 
> OHC3(S4) EHC3(S4) OHC4(S4) XHC0(S4) XHC1(S4) PE20(S4) PE21(S4) PE23(S4) 
> PB21(S4) PB22(S4) [...]
> acpitimer0 at acpi0: 3579545 Hz, 32 bits
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 16 (boot processor)
> cpu0: AMD A8-7670K Radeon R7, 10 Compute Cores 4C+6G, 3595.97 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,DBKP,PERFTSC,ITSC,FSGSBASE,BMI1
> cpu0: 96KB 64b/line 3-way I-cache, 16KB 64b/line 4-way D-cache, 2MB 64b/line 
> 16-way L2 cache
> cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
> cpu0: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> 

Re: panic in radeondrm_attachhook

2018-04-19 Thread Carlos Cardenas
On Thu, Apr 19, 2018 at 03:03:51PM +1000, Jonathan Gray wrote:
> On Wed, Apr 18, 2018 at 06:59:42PM -0700, Carlos Cardenas wrote:
> > On Thu, Apr 19, 2018 at 09:35:19AM +1000, Jonathan Gray wrote:
> > > On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> > > > Howdy.
> > > > 
> > > > Please excuse this poor bug report, I'm not able to obtain more info as
> > > > the system locks hard (below is transcribed by hand).
> > > > 
> > > > On a clean install, with the latest snap (as of time of email):
> > > > OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> > > > 
> > > > CPU: AMD A8-7670K Radeon R7 aka Kaveri
> > > > 
> > > > extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> > > > bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> > > > radeon_device_fini(800de000) at radeon_device_fini+0x43
> > > > radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
> > > > config_detach(800dd600,800de000) at config_detach+0x14e
> > > > radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> > > > config_process_deferred_mountroot() at 
> > > > config_process_deferred_mountroot+0x56
> > > > main(6dd84e08) at main+0x80f
> > > 
> > > See the other thread on bugs.  Not sure when a snapshot with the fix
> > > will go out.
> > 
> > I'm tracking bluhm's thread as well.
> > 
> > With snap #209 (which has that patch), we get further along from a clean
> > install:
> > 
> > initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
> > cik_cp: Failed to load firmware "radeon/KAVERI_pfp.bin"
> > error: [drm:pid0:cik_init] *ERROR* Failed to load Firmware!
> > drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
> > ttm_pool_mm_shrink_fini: stub
> > drm0 detached
> > radeondrm0 detached
> > vendor "ATI", unknown product 0x1313 (class display subclass VGA, rev 0xd4) 
> > at
> > pci0 dev 1 function 0 not configured
> > init: can't open /dev/console: Device not configured
> > init: can't open /dev/console: Device not configured
> > init: can't open /dev/console: Device not configured
> > [repeats]
> 
> So I'm quite sure you are booting via uefi with efifb here.
> There was previously no code that reprobed efifb as efifb isn't probed
> via pci devices.
> 
> The following on top of radeon.diff.2 works here when removing the
> firmware and booting via efiboot on a mullins system.
> 

That was itattached are two dmesg's:
* one after a clean install with no firmware loaded
* one after first boot with firmware loaded

With the firmware loaded, there's an artifact of a vertical purple line
along the left side of the screen (x=0) but everything seems to be ok (X
looks nice).

Thanks for the hard work getting radeon updated.

+--+
Carlos
OpenBSD 6.3-current (GENERIC.MP) #0: Thu Apr 19 08:52:15 PDT 2018
los@rollo.castle:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 16046288896 (15302MB)
avail mem = 15552057344 (14831MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xecc20 (55 entries)
bios0: vendor American Megatrends Inc. version "V1.3" date 04/13/2016
bios0: MSI MS-7969
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT FIDT MCFG HPET UEFI IVRS SSDT SSDT CRAT SSDT 
SSDT
acpi0: wakeup devices SBAZ(S4) P0PC(S4) OHC1(S4) EHC1(S4) OHC2(S4) EHC2(S4) 
OHC3(S4) EHC3(S4) OHC4(S4) XHC0(S4) XHC1(S4) PE20(S4) PE21(S4) PE23(S4) 
PB21(S4) PB22(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 16 (boot processor)
cpu0: AMD A8-7670K Radeon R7, 10 Compute Cores 4C+6G, 3595.97 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,DBKP,PERFTSC,ITSC,FSGSBASE,BMI1
cpu0: 96KB 64b/line 3-way I-cache, 16KB 64b/line 4-way D-cache, 2MB 64b/line 
16-way L2 cache
cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu0: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, IBE
cpu1 at mainbus0: apid 17 (application processor)
cpu1: AMD A8-7670K Radeon R7, 10 Compute Cores 4C+6G, 3593.30 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,DBKP,PERFTSC,ITSC,FSGSBASE,BMI1
cpu1: 96KB 64b/line 3-way I-cache, 16KB 

Re: panic in radeondrm_attachhook

2018-04-19 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 08:30:16PM +1000, Jonathan Gray wrote:
> On Wed, Apr 18, 2018 at 11:40:06AM +0200, Alexander Bluhm wrote:
> > Hi,
> > 
> > my i386 regression test machine crashed with the Tue Apr 17 snapshot
> > in radeondrm_attachhook().
> 
> So the machine doesn't have /etc/firmware/radeon/R100_cp.bin ?
> 
> I have an i386 laptop that loads r100 microcode which works.

If I force radeon_agp_init() to fail early and remove the firmware
I see it:

initializing kernel modesetting (RV200 0x1002:0x4C57 0x1014:0x0530).
radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
drm:pid0:r100_init *ERROR* Disabling GPU acceleration
ttm_tt_clear_mapping: flags 0x80 num_pages 1
ttm_tt_clear_mapping page 0 addr 0xd113742c
uvm_fault(0xd0ca89d8, 0xd1137000, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at  pmap_page_remove_86+0x18:   cmpl$0,0x48(%ebx)
ddb{0}> tr
pmap_page_remove_86(d113742c) at pmap_page_remove_86+0x18
ttm_tt_destroy(d3cd2b00) at ttm_tt_destroy+0x95
ttm_bo_cleanup_refs_or_queue(d3c87b28,d3c87b28,d3c86000,d0eb7ee4,d057e567) at t
tm_bo_cleanup_refs_or_queue+0x2af
ttm_bo_unref(d0eb7ed8) at ttm_bo_unref+0x69
radeon_bo_unref(d3c87b28) at radeon_bo_unref+0x27
radeon_wb_fini(d3c86000) at radeon_wb_fini+0x49
r100_init(d3c86000) at r100_init+0x409
radeon_device_init(d3c86000,d3c89000,d3c8903c,90003) at radeon_device_init+0x797
radeondrm_attachhook(d3c86000) at radeondrm_attachhook+0x2b
config_process_deferred_mountroot(d3c25ccc,eb5000,ec4000,0,d02004d1) at config_
process_deferred_mountroot+0x2c
uvm_fault(0xd0ca89d8, 0xd020, 0, 1) -> e
kernel: page fault trap, code=0
Faulted in DDB; continuing...
ddb{0}> sh reg
ds  0x10
es  0x10
fs  0x20
gs 0
edi0
esi   0xd3cd2b00end+0x2f1db00
ebp   0xd0eb7e80end+0x102e80
ebx   0xd113742cend+0x38242c
edx   0xd0c8dff8cpu_info_full_primary+0x1ff8
ecx0x100
eax   0xa981c212
eip   0xd0364558pmap_page_remove_86+0x18
cs   0x8
eflags   0x10292__ALIGN_SIZE+0xf292
esp   0xd0eb7e58end+0x102e58
ss  0x10
pmap_page_remove_86+0x18:   cmpl$0,0x48(%ebx)

> 
> > 
> > uvm_fault(0xd0ccfb70, 0xd11e, 0, 1) -> e
> > kernel: page fault trap, code=0
> > Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> > 
> > pmap_page_remove_pae(d11e0800) at pmap_page_remove_pae+0x18
> > ttm_tt_destroy(d5763980) at ttm_tt_destroy+0x61
> > ttm_bo_cleanup_refs_or_queue(d572cb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
> > ttm_bo_unref(d0f61ed8) at ttm_bo_unref+0x69
> > radeon_bo_unref(d572cb28) at radeon_bo_unref+0x27
> > radeon_wb_fini(d572b000) at radeon_wb_fini+0x49
> > r100_init(d572b000) at r100_init+0x409
> > radeon_device_init(d572b000,d56ff400,d56ff43c,840001) at 
> > radeon_device_init+0x797
> > radeondrm_attachhook(d572b000) at radeondrm_attachhook+0x2b
> > config_process_deferred_mountroot() at 
> > config_process_deferred_mountroot+0x2c
> > main(0) at main+0x7bf
> > 
> > Full console output below.
> > 
> > bluhm
> > 
> > >> OpenBSD/i386 BOOT 3.31
> > boot> 
> > booting hd0a:/bsd: 8620607+2356228+188436+0+1101824 
> > [695508+98+513600+533177]=0xd5e848
> > entry point at 0x2000d4
> > 
> > [ using 1742920 bytes of bsd ELF symbol table ]
> > Copyright (c) 1982, 1986, 1989, 1991, 1993
> >   The Regents of the University of California.  All rights reserved.
> > Copyright (c) 1995-2018 OpenBSD. All rights reserved.  
> > https://www.OpenBSD.org
> > 
> > OpenBSD 6.3-current (GENERIC.MP) #559: Tue Apr 17 10:11:13 MDT 2018
> > dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> > real mem  = 2145783808 (2046MB)
> > avail mem = 2092011520 (1995MB)
> > mpath0 at root
> > scsibus0 at mpath0: 256 targets
> > mainbus0 at root
> > bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 
> > @ 0x7feea000 (35 entries)
> > bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
> > bios0: Supermicro PDSM4+
> > acpi0 at bios0: rev 0
> > acpi0: sleep states S0 S1 S4 S5
> > acpi0: tables DSDT FACP MCFG APIC BOOT SSDT
> > acpi0: wakeup devices PXHA(S5) PXHB(S5) DEV3(S5) EXP1(S5) EXP5(S5) EXP6(S5) 
> > PCIB(S5) KBC0(S1) MSE0(S1) COM1(S5) COM2(S5) USB1(S4) USB2(S4) USB3(S4) 
> > USB4(S4) EUSB(S4)
> > acpitimer0 at acpi0: 3579545 Hz, 24 bits
> > acpimcfg0 at acpi0 addr 0xf000, bus 0-14
> > acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> > cpu0 at mainbus0: apid 0 (boot processor)
> > cpu0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 
> > GHz
> > cpu0: 
> > 

Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 06:59:42PM -0700, Carlos Cardenas wrote:
> On Thu, Apr 19, 2018 at 09:35:19AM +1000, Jonathan Gray wrote:
> > On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> > > Howdy.
> > > 
> > > Please excuse this poor bug report, I'm not able to obtain more info as
> > > the system locks hard (below is transcribed by hand).
> > > 
> > > On a clean install, with the latest snap (as of time of email):
> > > OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> > > 
> > > CPU: AMD A8-7670K Radeon R7 aka Kaveri
> > > 
> > > extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> > > bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> > > radeon_device_fini(800de000) at radeon_device_fini+0x43
> > > radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
> > > config_detach(800dd600,800de000) at config_detach+0x14e
> > > radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> > > config_process_deferred_mountroot() at 
> > > config_process_deferred_mountroot+0x56
> > > main(6dd84e08) at main+0x80f
> > 
> > See the other thread on bugs.  Not sure when a snapshot with the fix
> > will go out.
> 
> I'm tracking bluhm's thread as well.
> 
> With snap #209 (which has that patch), we get further along from a clean
> install:
> 
> initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
> cik_cp: Failed to load firmware "radeon/KAVERI_pfp.bin"
> error: [drm:pid0:cik_init] *ERROR* Failed to load Firmware!
> drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
> ttm_pool_mm_shrink_fini: stub
> drm0 detached
> radeondrm0 detached
> vendor "ATI", unknown product 0x1313 (class display subclass VGA, rev 0xd4) at
> pci0 dev 1 function 0 not configured
> init: can't open /dev/console: Device not configured
> init: can't open /dev/console: Device not configured
> init: can't open /dev/console: Device not configured
> [repeats]

So I'm quite sure you are booting via uefi with efifb here.
There was previously no code that reprobed efifb as efifb isn't probed
via pci devices.

The following on top of radeon.diff.2 works here when removing the
firmware and booting via efiboot on a mullins system.

diff --git sys/arch/amd64/amd64/efifb.c sys/arch/amd64/amd64/efifb.c
index 609de484ae0..42ae666540a 100644
--- sys/arch/amd64/amd64/efifb.c
+++ sys/arch/amd64/amd64/efifb.c
@@ -484,6 +484,12 @@ efifb_cndetach(void)
efifb_console.detached = 1;
 }
 
+void
+efifb_cnreattach(void)
+{
+   efifb_console.detached = 0;
+}
+
 int
 efifb_cb_cnattach(void)
 {
diff --git sys/arch/amd64/amd64/mainbus.c sys/arch/amd64/amd64/mainbus.c
index ed6ab059329..835e798ef2b 100644
--- sys/arch/amd64/amd64/mainbus.c
+++ sys/arch/amd64/amd64/mainbus.c
@@ -261,6 +261,20 @@ mainbus_attach(struct device *parent, struct device *self, 
void *aux)
 #endif
 }
 
+void
+mainbus_efifb_reattach(void)
+{
+   union mainbus_attach_args mba;
+   struct device *self = device_mainbus();
+#if NEFIFB > 0
+   if (bios_efiinfo != NULL || efifb_cb_found()) {
+   efifb_cnreattach();
+   mba.mba_eaa.eaa_name = "efifb";
+   config_found(self, , mainbus_print);
+   }
+#endif
+}
+
 int
 mainbus_print(void *aux, const char *pnp)
 {
diff --git sys/arch/amd64/include/efifbvar.h sys/arch/amd64/include/efifbvar.h
index f5e2bb26cae..a213811cba6 100644
--- sys/arch/amd64/include/efifbvar.h
+++ sys/arch/amd64/include/efifbvar.h
@@ -28,6 +28,7 @@ struct pci_attach_args;
 int efifb_cnattach(void);
 int efifb_is_console(struct pci_attach_args *);
 void efifb_cndetach(void);
+void efifb_cnreattach(void);
 
 int efifb_cb_found(void);
 int efifb_cb_cnattach(void);
diff --git sys/dev/pci/drm/radeon/radeon_kms.c 
sys/dev/pci/drm/radeon/radeon_kms.c
index 6523819ba04..ce2ac47fb84 100644
--- sys/dev/pci/drm/radeon/radeon_kms.c
+++ sys/dev/pci/drm/radeon/radeon_kms.c
@@ -47,6 +47,7 @@ extern int vga_console_attached;
 
 #ifdef __amd64__
 #include "efifb.h"
+#include 
 #endif
 
 #if NEFIFB > 0
@@ -642,6 +643,8 @@ radeondrm_attach_kms(struct device *parent, struct device 
*self, void *aux)
config_mountroot(self, radeondrm_attachhook);
 }
 
+extern void mainbus_efifb_reattach(void);
+
 int
 radeondrm_forcedetach(struct radeon_device *rdev)
 {
@@ -653,8 +656,19 @@ radeondrm_forcedetach(struct radeon_device *rdev)
vga_console_attached = 0;
 #endif
 
-   config_detach(>self, 0);
-   return pci_probe_device(sc, tag, NULL, NULL);
+   /* reprobe pci device for non efi systems */
+#if NEFIFB > 0
+   if (bios_efiinfo == NULL && !efifb_cb_found()) {
+#endif
+   config_detach(>self, 0);
+   return pci_probe_device(sc, tag, NULL, NULL);
+#if NEFIFB > 0
+   } else if (rdev->console) {
+   mainbus_efifb_reattach();
+   }
+#endif
+
+   return 0;
 }
 
 void



Re: panic in radeondrm_attachhook

2018-04-18 Thread Carlos Cardenas
On Thu, Apr 19, 2018 at 09:35:19AM +1000, Jonathan Gray wrote:
> On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> > Howdy.
> > 
> > Please excuse this poor bug report, I'm not able to obtain more info as
> > the system locks hard (below is transcribed by hand).
> > 
> > On a clean install, with the latest snap (as of time of email):
> > OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> > 
> > CPU: AMD A8-7670K Radeon R7 aka Kaveri
> > 
> > extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> > bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> > radeon_device_fini(800de000) at radeon_device_fini+0x43
> > radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
> > config_detach(800dd600,800de000) at config_detach+0x14e
> > radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> > config_process_deferred_mountroot() at 
> > config_process_deferred_mountroot+0x56
> > main(6dd84e08) at main+0x80f
> 
> See the other thread on bugs.  Not sure when a snapshot with the fix
> will go out.

I'm tracking bluhm's thread as well.

With snap #209 (which has that patch), we get further along from a clean
install:

initializing kernel modesetting (KAVERI 0x1002:0x1313 0x1462:0x7969).
cik_cp: Failed to load firmware "radeon/KAVERI_pfp.bin"
error: [drm:pid0:cik_init] *ERROR* Failed to load Firmware!
drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
ttm_pool_mm_shrink_fini: stub
drm0 detached
radeondrm0 detached
vendor "ATI", unknown product 0x1313 (class display subclass VGA, rev 0xd4) at
pci0 dev 1 function 0 not configured
init: can't open /dev/console: Device not configured
init: can't open /dev/console: Device not configured
init: can't open /dev/console: Device not configured
[repeats]

+--+
Carlos

> 
> diff --git sys/dev/pci/drm/radeon/radeon_device.c 
> sys/dev/pci/drm/radeon/radeon_device.c
> index 9085bf845c4..ec631f66cd9 100644
> --- sys/dev/pci/drm/radeon/radeon_device.c
> +++ sys/dev/pci/drm/radeon/radeon_device.c
> @@ -1582,7 +1582,7 @@ void radeon_device_fini(struct radeon_device *rdev)
>   rdev->rmmio = NULL;
>  #else
>   if (rdev->rio_mem_size > 0)
> - bus_space_unmap(rdev->memt, rdev->rio_mem, rdev->rio_mem_size);
> + bus_space_unmap(rdev->iot, rdev->rio_mem, rdev->rio_mem_size);
>   rdev->rio_mem_size = 0;
>  
>   if (rdev->rmmio_size > 0)



Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 03:29:10PM -0700, Carlos Cardenas wrote:
> Howdy.
> 
> Please excuse this poor bug report, I'm not able to obtain more info as
> the system locks hard (below is transcribed by hand).
> 
> On a clean install, with the latest snap (as of time of email):
> OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018
> 
> CPU: AMD A8-7670K Radeon R7 aka Kaveri
> 
> extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
> bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
> radeon_device_fini(800de000) at radeon_device_fini+0x43
> radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
> config_detach(800dd600,800de000) at config_detach+0x14e
> radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
> config_process_deferred_mountroot() at config_process_deferred_mountroot+0x56
> main(6dd84e08) at main+0x80f

See the other thread on bugs.  Not sure when a snapshot with the fix
will go out.

diff --git sys/dev/pci/drm/radeon/radeon_device.c 
sys/dev/pci/drm/radeon/radeon_device.c
index 9085bf845c4..ec631f66cd9 100644
--- sys/dev/pci/drm/radeon/radeon_device.c
+++ sys/dev/pci/drm/radeon/radeon_device.c
@@ -1582,7 +1582,7 @@ void radeon_device_fini(struct radeon_device *rdev)
rdev->rmmio = NULL;
 #else
if (rdev->rio_mem_size > 0)
-   bus_space_unmap(rdev->memt, rdev->rio_mem, rdev->rio_mem_size);
+   bus_space_unmap(rdev->iot, rdev->rio_mem, rdev->rio_mem_size);
rdev->rio_mem_size = 0;
 
if (rdev->rmmio_size > 0)



panic in radeondrm_attachhook

2018-04-18 Thread Carlos Cardenas
Howdy.

Please excuse this poor bug report, I'm not able to obtain more info as
the system locks hard (below is transcribed by hand).

On a clean install, with the latest snap (as of time of email):
OpenBSD 6.3-current (GENERIC.MP) #207: Wed Apr 18 11:37:15 MDT 2018

CPU: AMD A8-7670K Radeon R7 aka Kaveri

extent_free(819489f8,100,1000,7e281000) at extent_free+0x110
bus_space_unmap(0,800de000,0) at bus_space_unmap+0x110
radeon_device_fini(800de000) at radeon_device_fini+0x43
radeondrm_detach_kms(0,800de000) at radeondrm_detach_kms+0x33
config_detach(800dd600,800de000) at config_detach+0x14e
radeondrm_attachhook(81bf9420) at radeondrm_attachhook+0x9d
config_process_deferred_mountroot() at config_process_deferred_mountroot+0x56
main(6dd84e08) at main+0x80f


+--+
Carlos



Re: panic in radeondrm_attachhook

2018-04-18 Thread Alexander Bluhm
On Thu, Apr 19, 2018 at 12:10:04AM +1000, Jonathan Gray wrote:
> That's with the big radeon update diff as well?

That was current.  Boots fine.

With ~jsg/radeon.diff.2 it still crashes.  I have checked, it is
the diff with

if (rdev->rio_mem_size > 0)
bus_space_unmap(rdev->iot, rdev->rio_mem, rdev->rio_mem_size);

initializing kernel modesetting (RV100 0x1002:0x515E 0x1002:0x515E).
radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
drm:pid0:r100_init *ERROR* Disabling GPU acceleration
uvm_fault(0xd0cae21c, 0xd11e2000, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
ddb{0}> trace
pmap_page_remove_pae(d11e2768) at pmap_page_remove_pae+0x18
ttm_tt_destroy(d5765a00) at ttm_tt_destroy+0x61
ttm_bo_cleanup_refs_or_queue(d572eb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
ttm_bo_unref(d0f63ed8) at ttm_bo_unref+0x69
radeon_bo_unref(d572eb28) at radeon_bo_unref+0x27
radeon_wb_fini(d572d000) at radeon_wb_fini+0x49
r100_init(d572d000) at r100_init+0x409
radeon_device_init(d572d000,d5701400,d570143c,840001) at radeon_device_init+0x7
97
radeondrm_attachhook(d572d000) at radeondrm_attachhook+0x2b
config_process_deferred_mountroot() at config_process_deferred_mountroot+0x2c
main(0) at main+0x7bf
ddb{0}> ps
   PID TID   PPIDUID  S   FLAGS  WAIT  COMMAND
 98514  483759  0  0  3 0x14200  bored ttm_swap
 41756   28108  0  0  7 0x14200zerothread
 90719  431258  0  0  3 0x14200  aiodoned  aiodoned
 68352  153722  0  0  3 0x14200  syncerupdate
 85418  451918  0  0  3 0x14200  cleaner   cleaner
  4795  347010  0  0  3 0x14200  reaperreaper
 30048  518222  0  0  3 0x14200  pgdaemon  pagedaemon
 47204  191118  0  0  3 0x14200  bored crynlk
 83334   91194  0  0  3 0x14200  bored crypto
  3083  395954  0  0  3 0x14200  fdprobe   fdcattach
 97990   65954  0  0  3 0x14200  usbtskusbtask
 68511  269657  0  0  3 0x14200  usbatsk   usbatsk
 57129  443897  0  0  3 0x14200  bored sensors
 65926  248462  0  0  3  0x40014200  acpi0 acpi0
 47484  503599  0  0  1 0x14200idle1
 19037   44004  0  0  3 0x14200  bored softnet
 66658  454516  0  0  3 0x14200  bored systqmp
 20646  331826  0  0  3 0x14200  bored systq
 19240  211688  0  0  3  0x40014200  bored softclock
  4480   56978  0  0  3  0x40014200idle0
 40745  265092  0  0  3 0x14200  kmalloc   kmthread
 1  437426  0  0  3   0  initexec  swapper
*0   0 -1  0  7 0x10200swapper



Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 03:09:08PM +0200, Alexander Bluhm wrote:
> On Wed, Apr 18, 2018 at 10:29:30PM +1000, Jonathan Gray wrote:
> > sys/dev/pci/drm/drm_linux.h rev 1.85 should help
> 
> I have compiled and successfully booted a kernel with that commit.
> 
> bluhm
> 

That's with the big radeon update diff as well?  Those functions are not
called for radeon otherwise.



Re: panic in radeondrm_attachhook

2018-04-18 Thread Alexander Bluhm
On Wed, Apr 18, 2018 at 10:29:30PM +1000, Jonathan Gray wrote:
> sys/dev/pci/drm/drm_linux.h rev 1.85 should help

I have compiled and successfully booted a kernel with that commit.

bluhm



Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 02:15:50PM +0200, Alexander Bluhm wrote:
> On Wed, Apr 18, 2018 at 08:30:16PM +1000, Jonathan Gray wrote:
> > On Wed, Apr 18, 2018 at 11:40:06AM +0200, Alexander Bluhm wrote:
> > > my i386 regression test machine crashed with the Tue Apr 17 snapshot
> > > in radeondrm_attachhook().
> > 
> > So the machine doesn't have /etc/firmware/radeon/R100_cp.bin ?
> 
> No firmware installed.  And I don't use vga, console is serial.
> 
> bluhm
> 

sys/dev/pci/drm/drm_linux.h rev 1.85 should help

Though there is another problem I noticed.  When the firmware is not present
radeondrm is detached.  With the diff in snapshots a bus_space_unmap() call
is made with the wrong bus space tag in that path.

diff --git sys/dev/pci/drm/radeon/radeon_device.c 
sys/dev/pci/drm/radeon/radeon_device.c
index 9085bf845c4..ec631f66cd9 100644
--- sys/dev/pci/drm/radeon/radeon_device.c
+++ sys/dev/pci/drm/radeon/radeon_device.c
@@ -1582,7 +1582,7 @@ void radeon_device_fini(struct radeon_device *rdev)
rdev->rmmio = NULL;
 #else
if (rdev->rio_mem_size > 0)
-   bus_space_unmap(rdev->memt, rdev->rio_mem, rdev->rio_mem_size);
+   bus_space_unmap(rdev->iot, rdev->rio_mem, rdev->rio_mem_size);
rdev->rio_mem_size = 0;
 
if (rdev->rmmio_size > 0)



Re: panic in radeondrm_attachhook

2018-04-18 Thread Alexander Bluhm
On Wed, Apr 18, 2018 at 08:30:16PM +1000, Jonathan Gray wrote:
> On Wed, Apr 18, 2018 at 11:40:06AM +0200, Alexander Bluhm wrote:
> > my i386 regression test machine crashed with the Tue Apr 17 snapshot
> > in radeondrm_attachhook().
> 
> So the machine doesn't have /etc/firmware/radeon/R100_cp.bin ?

No firmware installed.  And I don't use vga, console is serial.

bluhm



Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 08:30:16PM +1000, Jonathan Gray wrote:
> On Wed, Apr 18, 2018 at 11:40:06AM +0200, Alexander Bluhm wrote:
> > Hi,
> > 
> > my i386 regression test machine crashed with the Tue Apr 17 snapshot
> > in radeondrm_attachhook().
> 
> So the machine doesn't have /etc/firmware/radeon/R100_cp.bin ?
> 
> I have an i386 laptop that loads r100 microcode which works.

Even after removing the firmware I don't hit this.  Machine doesn't have
PAE though.

OpenBSD 6.3-current (GENERIC) #552: Tue Apr 17 22:07:30 MDT 2018
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
real mem  = 1341014016 (1278MB)
avail mem = 1301983232 (1241MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 06/02/06, BIOS32 rev. 0 @ 0xfd750, SMBIOS rev. 2.33 @ 
0xe0010 (61 entries)
bios0: vendor IBM version "1RETDPWW (3.21 )" date 06/02/2006
bios0: IBM 2378JZM
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA BOOT
acpi0: wakeup devices LID_(S3) SLPB(S3) UART(S3) PCI0(S3) PCI1(S4) USB0(S3) 
USB1(S3) AC9M(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (PCI1)
acpipwrres0 at acpi0: PUBS, resource for USB0, USB1, USB7
acpitz0 at acpi0: critical temperature is 93 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpicmos0 at acpi0
"IBM0057" at acpi0 not configured
"IBM0071" at acpi0 not configured
acpibat0 at acpi0: BAT0 model "IBM-92P1011" serial  3457 type LION oem "SONY"
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: DOCK not docked (0)
acpivideo0 at acpi0: VID_
bios0: ROM list: 0xc/0x1 0xd/0x1000 0xd1000/0x1000 0xdc000/0x4000! 
0xe/0x1
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel(R) Pentium(R) M processor 1.60GHz ("GenuineIntel" 686-class) 1.60 
GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE,EST,TM2,PERF
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: Enhanced SpeedStep 1595 MHz: speeds: 1600, 1400, 1200, 1000, 800, 600 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82855PM Host" rev 0x03
intelagp0 at pchb0
agp0 at intelagp0: aperture at 0xd000, size 0x1000
ppb0 at pci0 dev 1 function 0 "Intel 82855PM AGP" rev 0x03
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon Mobility M7" rev 0x00
drm0 at radeondrm0
radeondrm0: irq 11
...
root on wd0a (a84015999566fd16.a) swap on wd0b dump on wd0b
initializing kernel modesetting (RV200 0x1002:0x4C57 0x1014:0x0530).
radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
drm:pid0:r100_startup *ERROR* failed initializing CP (-2).
drm:pid0:r100_init *ERROR* Disabling GPU acceleration
ttm_pool_mm_shrink_fini: stub
radeondrm0: 1024x768, 8bpp
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)


> 
> > 
> > uvm_fault(0xd0ccfb70, 0xd11e, 0, 1) -> e
> > kernel: page fault trap, code=0
> > Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> > 
> > pmap_page_remove_pae(d11e0800) at pmap_page_remove_pae+0x18
> > ttm_tt_destroy(d5763980) at ttm_tt_destroy+0x61
> > ttm_bo_cleanup_refs_or_queue(d572cb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
> > ttm_bo_unref(d0f61ed8) at ttm_bo_unref+0x69
> > radeon_bo_unref(d572cb28) at radeon_bo_unref+0x27
> > radeon_wb_fini(d572b000) at radeon_wb_fini+0x49
> > r100_init(d572b000) at r100_init+0x409
> > radeon_device_init(d572b000,d56ff400,d56ff43c,840001) at 
> > radeon_device_init+0x797
> > radeondrm_attachhook(d572b000) at radeondrm_attachhook+0x2b
> > config_process_deferred_mountroot() at 
> > config_process_deferred_mountroot+0x2c
> > main(0) at main+0x7bf
> > 
> > Full console output below.
> > 
> > bluhm
> > 
> > >> OpenBSD/i386 BOOT 3.31
> > boot> 
> > booting hd0a:/bsd: 8620607+2356228+188436+0+1101824 
> > [695508+98+513600+533177]=0xd5e848
> > entry point at 0x2000d4
> > 
> > [ using 1742920 bytes of bsd ELF symbol table ]
> > Copyright (c) 1982, 1986, 1989, 1991, 1993
> >   The Regents of the University of California.  All rights reserved.
> > Copyright (c) 1995-2018 OpenBSD. All rights reserved.  
> > https://www.OpenBSD.org
> > 
> > OpenBSD 6.3-current (GENERIC.MP) #559: Tue Apr 17 10:11:13 MDT 2018
> > dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> > real mem  = 2145783808 (2046MB)
> > avail mem = 2092011520 (1995MB)
> > mpath0 at root
> > scsibus0 at mpath0: 256 targets
> > mainbus0 at root
> > bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 
> > @ 0x7feea000 (35 entries)
> > bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
> > bios0: Supermicro PDSM4+
> > acpi0 at bios0: rev 0
> > acpi0: sleep states S0 S1 S4 

Re: panic in radeondrm_attachhook

2018-04-18 Thread Jonathan Gray
On Wed, Apr 18, 2018 at 11:40:06AM +0200, Alexander Bluhm wrote:
> Hi,
> 
> my i386 regression test machine crashed with the Tue Apr 17 snapshot
> in radeondrm_attachhook().

So the machine doesn't have /etc/firmware/radeon/R100_cp.bin ?

I have an i386 laptop that loads r100 microcode which works.

> 
> uvm_fault(0xd0ccfb70, 0xd11e, 0, 1) -> e
> kernel: page fault trap, code=0
> Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)
> 
> pmap_page_remove_pae(d11e0800) at pmap_page_remove_pae+0x18
> ttm_tt_destroy(d5763980) at ttm_tt_destroy+0x61
> ttm_bo_cleanup_refs_or_queue(d572cb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
> ttm_bo_unref(d0f61ed8) at ttm_bo_unref+0x69
> radeon_bo_unref(d572cb28) at radeon_bo_unref+0x27
> radeon_wb_fini(d572b000) at radeon_wb_fini+0x49
> r100_init(d572b000) at r100_init+0x409
> radeon_device_init(d572b000,d56ff400,d56ff43c,840001) at 
> radeon_device_init+0x797
> radeondrm_attachhook(d572b000) at radeondrm_attachhook+0x2b
> config_process_deferred_mountroot() at config_process_deferred_mountroot+0x2c
> main(0) at main+0x7bf
> 
> Full console output below.
> 
> bluhm
> 
> >> OpenBSD/i386 BOOT 3.31
> boot> 
> booting hd0a:/bsd: 8620607+2356228+188436+0+1101824 
> [695508+98+513600+533177]=0xd5e848
> entry point at 0x2000d4
> 
> [ using 1742920 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>   The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2018 OpenBSD. All rights reserved.  https://www.OpenBSD.org
> 
> OpenBSD 6.3-current (GENERIC.MP) #559: Tue Apr 17 10:11:13 MDT 2018
> dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> real mem  = 2145783808 (2046MB)
> avail mem = 2092011520 (1995MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 @ 
> 0x7feea000 (35 entries)
> bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
> bios0: Supermicro PDSM4+
> acpi0 at bios0: rev 0
> acpi0: sleep states S0 S1 S4 S5
> acpi0: tables DSDT FACP MCFG APIC BOOT SSDT
> acpi0: wakeup devices PXHA(S5) PXHB(S5) DEV3(S5) EXP1(S5) EXP5(S5) EXP6(S5) 
> PCIB(S5) KBC0(S1) MSE0(S1) COM1(S5) COM2(S5) USB1(S4) USB2(S4) USB3(S4) 
> USB4(S4) EUSB(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimcfg0 at acpi0 addr 0xf000, bus 0-14
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 
> GHz
> cpu0: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 266MHz
> cpu0: mwait min=64, max=64, C-substates=0.2, IBE
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 
> GHz
> cpu1: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
> ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
> ioapic1 at mainbus0: apid 3 pa 0xfecc, version 20, 24 pins
> ioapic2 at mainbus0: apid 4 pa 0xfecc0400, version 20, 24 pins
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 2 (PXHA)
> acpiprt2 at acpi0: bus 3 (PXHB)
> acpiprt3 at acpi0: bus -1 (DEV3)
> acpiprt4 at acpi0: bus 9 (EXP1)
> acpiprt5 at acpi0: bus 13 (EXP5)
> acpiprt6 at acpi0: bus 14 (EXP6)
> acpiprt7 at acpi0: bus 15 (PCIB)
> acpicpu0 at acpi0: C1(@1 halt!)
> acpicpu1 at acpi0: C1(@1 halt!)
> acpicmos0 at acpi0
> "PNP0A05" at acpi0 not configured
> acpibtn0 at acpi0: PWRB
> bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x2600
> ipmi at mainbus0 not configured
> cpu0: Enhanced SpeedStep disabled by BIOS
> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> pchb0 at pci0 dev 0 function 0 "Intel E7230 Host" rev 0xc0
> ppb0 at pci0 dev 1 function 0 "Intel E7230 PCIE" rev 0xc0: apic 2 int 16
> pci1 at ppb0 bus 1
> ppb1 at pci1 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
> pci2 at ppb1 bus 2
> em0 at pci2 dev 2 function 0 "Intel 82545GM" rev 0x04: apic 3 int 4, address 
> 00:04:23:cd:41:fb
> "Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 1 not configured
> ppb2 at pci1 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
> pci3 at ppb2 bus 3
> em1 at pci3 dev 1 function 0 "Intel 82545GM" rev 0x04: apic 4 int 0, address 
> 00:1b:21:0e:6e:8e
> ami0 at pci3 dev 3 function 0 "Symbios Logic MegaRAID" rev 0x01: apic 4 int 4
> ami0: LSI 520, 64b/lhc, FW 1L47, BIOS vG121, 128MB RAM
> ami0: 1 channels, 0 FC loops, 2 logical drives
> scsibus1 at ami0: 40 targets
> sd0 at scsibus1 targ 0 lun 0: 

panic in radeondrm_attachhook

2018-04-18 Thread Alexander Bluhm
Hi,

my i386 regression test machine crashed with the Tue Apr 17 snapshot
in radeondrm_attachhook().

uvm_fault(0xd0ccfb70, 0xd11e, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at  pmap_page_remove_pae+0x18:  cmpl$0,0x48(%edi)

pmap_page_remove_pae(d11e0800) at pmap_page_remove_pae+0x18
ttm_tt_destroy(d5763980) at ttm_tt_destroy+0x61
ttm_bo_cleanup_refs_or_queue(d572cb28) at ttm_bo_cleanup_refs_or_queue+0x2b3
ttm_bo_unref(d0f61ed8) at ttm_bo_unref+0x69
radeon_bo_unref(d572cb28) at radeon_bo_unref+0x27
radeon_wb_fini(d572b000) at radeon_wb_fini+0x49
r100_init(d572b000) at r100_init+0x409
radeon_device_init(d572b000,d56ff400,d56ff43c,840001) at 
radeon_device_init+0x797
radeondrm_attachhook(d572b000) at radeondrm_attachhook+0x2b
config_process_deferred_mountroot() at config_process_deferred_mountroot+0x2c
main(0) at main+0x7bf

Full console output below.

bluhm

>> OpenBSD/i386 BOOT 3.31
boot> 
booting hd0a:/bsd: 8620607+2356228+188436+0+1101824 
[695508+98+513600+533177]=0xd5e848
entry point at 0x2000d4

[ using 1742920 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
  The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2018 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.3-current (GENERIC.MP) #559: Tue Apr 17 10:11:13 MDT 2018
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
real mem  = 2145783808 (2046MB)
avail mem = 2092011520 (1995MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 07/12/06, BIOS32 rev. 0 @ 0xfd450, SMBIOS rev. 2.51 @ 
0x7feea000 (35 entries)
bios0: vendor Phoenix Technologies LTD version "6.00" date 07/12/2006
bios0: Supermicro PDSM4+
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP MCFG APIC BOOT SSDT
acpi0: wakeup devices PXHA(S5) PXHB(S5) DEV3(S5) EXP1(S5) EXP5(S5) EXP6(S5) 
PCIB(S5) KBC0(S1) MSE0(S1) COM1(S5) COM2(S5) USB1(S4) USB2(S4) USB3(S4) 
USB4(S4) EUSB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf000, bus 0-14
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz ("GenuineIntel" 686-class) 1.87 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,LAHF,PERF,SENSOR
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfecc, version 20, 24 pins
ioapic2 at mainbus0: apid 4 pa 0xfecc0400, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PXHA)
acpiprt2 at acpi0: bus 3 (PXHB)
acpiprt3 at acpi0: bus -1 (DEV3)
acpiprt4 at acpi0: bus 9 (EXP1)
acpiprt5 at acpi0: bus 13 (EXP5)
acpiprt6 at acpi0: bus 14 (EXP6)
acpiprt7 at acpi0: bus 15 (PCIB)
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
acpicmos0 at acpi0
"PNP0A05" at acpi0 not configured
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x2600
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep disabled by BIOS
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel E7230 Host" rev 0xc0
ppb0 at pci0 dev 1 function 0 "Intel E7230 PCIE" rev 0xc0: apic 2 int 16
pci1 at ppb0 bus 1
ppb1 at pci1 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci2 at ppb1 bus 2
em0 at pci2 dev 2 function 0 "Intel 82545GM" rev 0x04: apic 3 int 4, address 
00:04:23:cd:41:fb
"Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 1 not configured
ppb2 at pci1 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci3 at ppb2 bus 3
em1 at pci3 dev 1 function 0 "Intel 82545GM" rev 0x04: apic 4 int 0, address 
00:1b:21:0e:6e:8e
ami0 at pci3 dev 3 function 0 "Symbios Logic MegaRAID" rev 0x01: apic 4 int 4
ami0: LSI 520, 64b/lhc, FW 1L47, BIOS vG121, 128MB RAM
ami0: 1 channels, 0 FC loops, 2 logical drives
scsibus1 at ami0: 40 targets
sd0 at scsibus1 targ 0 lun 0:  SCSI2 0/direct fixed
sd0: 35045MB, 512 bytes/sector, 71772160 sectors
sd1 at scsibus1 targ 1 lun 0:  SCSI2 0/direct fixed
sd1: 140271MB, 512 bytes/sector, 287275008 sectors
scsibus2 at ami0: 16 targets
"Intel IOxAPIC" rev 0x09 at pci1 dev 0 function 3 not configured
ppb3 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: apic 2 int 17
pci4 at ppb3 bus 9
ppb4 at pci0