>Synopsis: inteldrm crashes on braswell under heavy usage
>Category: ???
>Environment:
System : OpenBSD 6.2
Details : OpenBSD 6.2-current (GENERIC.MP) #4: Fri Nov 24 12:24:51
CET 2017
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
As seen on many braswell systems my system crashed after heavy
usage in firefox and such. It was stable with only cli
applications in xterm)
This Problem was seen by some people, as per this thread:
https://marc.info/?l=openbsd-misc&m=150916174632762&w=2
The patch, which fixed it for me and at least two other people was
found in DragonflyBSD (one answer was send to me instead of the
list):
https://www.mail-archive.com/[email protected]/msg157533.html
>How-To-Repeat:
Use firefox on youtube for a while on Braswell based Systems.
>Fix:
Apply this patch to inteldrm (tested on cvs-Checkout from 2017-11-15
and 2017-11-24)
Index: i915_gem_gtt.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_gem_gtt.c,v
retrieving revision 1.15
diff -u -p -r1.15 i915_gem_gtt.c
--- i915_gem_gtt.c 1 Jul 2017 16:14:10 -0000 1.15
+++ i915_gem_gtt.c 16 Nov 2017 15:51:02 -0000
@@ -778,7 +778,10 @@ static void gen8_ppgtt_clear_pte_range(s
num_entries--;
}
- kunmap_px(ppgtt, pt);
+ kunmap_px(ppgtt, pt_vaddr); /* XXX dillon, out of order
+ * patch from linux
+ * 44a71024 12-Apr-2016
+ */
pte = 0;
if (++pde == I915_PDES) {
@@ -1317,6 +1320,8 @@ static int gen8_alloc_va_range_3lvl(stru
gen8_for_each_pde(pt, pd, pd_start, pd_len, temp, pde) {
/* Same reasoning as pd */
WARN_ON(!pt);
+ if (pt == NULL) /* XXX dillon hack */
+ continue; /* XXX dillon hack */
WARN_ON(!pd_len);
WARN_ON(!gen8_pte_count(pd_start, pd_len));
dmesg:
OpenBSD 6.2-current (GENERIC.MP) #4: Fri Nov 24 12:24:51 CET 2017
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4188274688 (3994MB)
avail mem = 4054446080 (3866MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0x79f44000 (22 entries)
bios0: vendor Insyde Corp. version "V1.11" date 09/08/2016
bios0: Acer TravelMate B117-M
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP UEFI UEFI SSDT TCPA APIC MCFG SSDT SSDT SSDT SSDT SSDT
SSDT TPM2 FPDT BGRT
acpi0: wakeup devices XHCA(S4) PXSX(S5) RP01(S4) PXSX(S5) RP02(S4) PXSX(S5)
RP03(S4) PXSX(S5) RP04(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Celeron(R) CPU N3160 @ 1.60GHz, 1680.33 MHz
cpu0:
FPU,VME,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,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
cpu0: 1MB 64b/line 16-way L2 cache
acpitimer0: recalibrated TSC frequency 1599945813 Hz
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 79MHz
cpu0: mwait min=64, max=64, C-substates=0.2.0.0.0.0.3.3, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Celeron(R) CPU N3160 @ 1.60GHz, 1680.00 MHz
cpu1:
FPU,VME,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,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
cpu1: 1MB 64b/line 16-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Celeron(R) CPU N3160 @ 1.60GHz, 1600.00 MHz
cpu2:
FPU,VME,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,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
cpu2: 1MB 64b/line 16-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Celeron(R) CPU N3160 @ 1.60GHz, 1600.00 MHz
cpu3:
FPU,VME,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,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,RDRAND,NXE,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,SMEP,ERMS,SENSOR,ARAT
cpu3: 1MB 64b/line 16-way L2 cache
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 115 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (RP01)
acpiprt2 at acpi0: bus -1 (RP02)
acpiprt3 at acpi0: bus 2 (RP03)
acpiprt4 at acpi0: bus -1 (RP04)
acpiec0 at acpi0
acpicpu0 at acpi0
C2: state 6: substate 8 >= num 3
C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0
C2: state 6: substate 8 >= num 3
C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0
C2: state 6: substate 8 >= num 3
C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0
C2: state 6: substate 8 >= num 3
C3: state 7: substate 4 >= num 3: C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: USBC, resource for XHC1, XHCA
acpitz0 at acpi0: critical temperature is 105 degC
"1025087F" at acpi0 not configured
"ETD050A" at acpi0 not configured
sdhc0 at acpi0: SDHA addr 0x9131f000/0x1000 irq 45
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc0 at sdhc0: 8-bit, sd high-speed, mmc high-speed, dma
"INTL9C60" at acpi0 not configured
dwiic0 at acpi0: I2C1 addr 0x9131b000/0x1000 irq 32
iic0 at dwiic0
"PNP0C14" at acpi0 not configured
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: SLPB
chvgpio0 at acpi0: GPO2 uid 3 addr 0xfed90000/0x8000 irq 50, 24 pins
chvgpio1 at acpi0: GPO3 uid 4 addr 0xfed98000/0x8000 irq 91, 55 pins
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT1 model "AC14B3K" serial 6940 type LION oem "PANASONIC"
acpibtn2 at acpi0: LID0
"INT3400" at acpi0 not configured
"INT3403" at acpi0 not configured
"MSFT0101" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 1680 MHz: speeds: 1601, 1600, 1520, 1440, 1360, 1280,
1200, 1120, 1040, 960, 880, 800, 720, 640, 560, 480 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Braswell Host" rev 0x35
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics" rev 0x35
drm0 at inteldrm0
inteldrm0: msi
inteldrm0: 1366x768, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel Braswell Power" rev 0x35 at pci0 dev 11 function 0 not configured
ahci0 at pci0 dev 19 function 0 "Intel Braswell AHCI" rev 0x35: msi, AHCI 1.3.1
ahci0: port 0: 6.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, HFS128G39TND-N21, 3000> SCSI3 0/direct
fixed t10.ATA_HFS128G39TND-N210A_FI69N006811909834_
sd0: 122104MB, 512 bytes/sector, 250069680 sectors, thin
xhci0 at pci0 dev 20 function 0 "Intel Braswell xHCI" rev 0x35: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00
addr 1
"Intel Braswell TXE" rev 0x35 at pci0 dev 26 function 0 not configured
azalia0 at pci0 dev 27 function 0 "Intel Braswell HD Audio" rev 0x35: msi
azalia0: codecs: Realtek/0x0255, Intel/0x2883, using Realtek/0x0255
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel Braswell PCIE" rev 0x35: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 2 "Intel Braswell PCIE" rev 0x35: msi
pci2 at ppb1 bus 2
iwm0 at pci2 dev 0 function 0 "Intel Dual Band Wireless AC 7265" rev 0x59, msi
pcib0 at pci0 dev 31 function 0 "Intel Braswell PCU LPC" rev 0x35
ichiic0 at pci0 dev 31 function 3 "Intel Braswell SMBus" rev 0x35: apic 1 int 18
iic1 at ichiic0
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
sdmmc0: can't enable card
ugen0 at uhub0 port 3 "Generic USB2.0-CRW" rev 2.00/39.60 addr 2
uvideo0 at uhub0 port 4 configuration 1 interface 0 "Chicony Electronics
Co.,Ltd. HD WebCam" rev 2.00/89.05 addr 3
video0 at uvideo0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
sd1 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006> SCSI2 0/direct fixed
sd1: 122103MB, 512 bytes/sector, 250068065 sectors
root on sd1a (c11250ba9e641baa.a) swap on sd1b dump on sd1b
iwm0: hw rev 0x210, fw ver 16.242414.0, address 7c:b0:c2:c5:7a:d8
usbdevs:
Controller /dev/usb0:
addr 1: super speed, self powered, config 1, xHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 disabled
port 2 disabled
port 3 addr 2: high speed, power 500 mA, config 1, USB2.0-CRW(0x0129),
Generic(0x0bda), rev 39.60, iSerialNumber 20100201396000000
port 4 addr 3: high speed, power 500 mA, config 1, HD WebCam(0xb577), Chicony
Electronics Co.,Ltd.(0x04f2), rev 89.05
port 5 disabled
port 6 disabled
port 7 disabled
port 8 disabled
port 9 disabled
port 10 disabled
port 11 disabled
port 12 disabled
port 13 disabled
Index: i915_gem_gtt.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_gem_gtt.c,v
retrieving revision 1.15
diff -u -p -r1.15 i915_gem_gtt.c
--- i915_gem_gtt.c 1 Jul 2017 16:14:10 -0000 1.15
+++ i915_gem_gtt.c 16 Nov 2017 15:51:02 -0000
@@ -778,7 +778,10 @@ static void gen8_ppgtt_clear_pte_range(s
num_entries--;
}
- kunmap_px(ppgtt, pt);
+ kunmap_px(ppgtt, pt_vaddr); /* XXX dillon, out of order
+ * patch from linux
+ * 44a71024 12-Apr-2016
+ */
pte = 0;
if (++pde == I915_PDES) {
@@ -1317,6 +1320,8 @@ static int gen8_alloc_va_range_3lvl(stru
gen8_for_each_pde(pt, pd, pd_start, pd_len, temp, pde) {
/* Same reasoning as pd */
WARN_ON(!pt);
+ if (pt == NULL) /* XXX dillon hack */
+ continue; /* XXX dillon hack */
WARN_ON(!pd_len);
WARN_ON(!gen8_pte_count(pd_start, pd_len));