>Synopsis:      inteldrm stop working after {hibernate,suspend}/resume
>Category:      kernel
>Environment:
        System      : OpenBSD 7.7
        Details     : OpenBSD 7.7-current (GENERIC.MP) #117: Thu May 29 
21:18:15 JST 2025
                         
yasuoka@xxx:/home/yasuoka/src/sys/arch/amd64/compile/GENERIC.MP

        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:
        After hibernate and resume, X11 stops working.  Keyboard and
        mouse don't work, but Ctrl-Alt-F1 or Ctrl-Alt-Backspace works.

        errors in dmesg:
        ****
        drm:pid97650:__uc_init_hw *ERROR* [drm] *ERROR* GT0: GuC initialization 
failed 0xfffffffffffffffae
        drm:pid97650:intel_gt_init_hw *ERROR* [drm] *ERROR* GT0: Enabling uc 
failed (-5)
        drm:pid97650:intel_gt_resume *ERROR* [drm] *ERROR* GT0: Failed to 
initialize GPU, declaring it wedged!
        ****

        This happens because guc_wait_ucode() in i915/gt/uc/intel_guc_fw.c
        fails.

        The function is to wait for the GuC to start up by calling the inline
        function guc_load_done() and the function checks two regisiters.

             97 static inline bool guc_load_done(struct intel_uncore *uncore, 
u32 *status, bool *success)
             98 {
             99         u32 val = intel_uncore_read(uncore, GUC_STATUS);
            100         u32 uk_val = REG_FIELD_GET(GS_UKERNEL_MASK, val);
            101         u32 br_val = REG_FIELD_GET(GS_BOOTROM_MASK, val);
            102 
            103         *status = val;
            104         switch (uk_val) {
            105         case INTEL_GUC_LOAD_STATUS_READY:
            106                 *success = true;
            107                 return true;
            108 
            109         case INTEL_GUC_LOAD_STATUS_ERROR_DEVID_BUILD_MISMATCH:
            110         case INTEL_GUC_LOAD_STATUS_GUC_PREPROD_BUILD_MISMATCH:
            111         case INTEL_GUC_LOAD_STATUS_ERROR_DEVID_INVALID_GUCTYPE:

        In my test, the functions fails with the resgisters:

          ukernel = INTEL_GUC_LOAD_STATUS_INIT_DATA_INVALID(0x71)
          bootrom = INTEL_BOOTROM_STATUS_JUMP_PASSED(0x76)

        When I was using 7.6, I didn't see this problem.

>How-To-Repeat:
        1. hibernate or suspend
        2. resume

        the problem happens always (~10 times)

        After the workaround diff, not happen always (~3 times)
        
>Fix:
        Also the diff attached at last, workaround the problem.

        The diff partially backouts the change on Feb 7 and add a printf().

        I don't understand it logically, but if the printf() is removed, the
        problem start happening.

dmesg:
OpenBSD 7.7-current (GENERIC.MP) #117: Thu May 29 21:18:15 JST 2025
    
yasu...@yasuoka-ob1.tokyo.iiji.jp:/home/yasuoka/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 16843354112 (16063MB)
avail mem = 16306782208 (15551MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.4 @ 0x2ee40000 (38 entries)
bios0: vendor Phoenix Technologies Ltd. version "R0160ZR" date 09/06/2023
bios0: VAIO Corporation VJPK23
efi0 at bios0: UEFI 2.7
efi0: Phoenix Technologies rev 0x12345678
acpi0 at bios0: ACPI 6.3
acpi0: sleep states S0ix S3 S4 S5
acpi0: tables DSDT FACP SSDT SSDT SSDT SSDT TPM2 HPET APIC MCFG SSDT SSDT SSDT 
SSDT LPIT WSMT SSDT SSDT DBGP DBG2 NHLT MSDM SSDT BATB DMAR FPDT SSDT SSDT SSDT 
SSDT PHAT UEFI SSDT BGRT
acpi0: wakeup devices PEG0(S4) PEGP(S4) PEGP(S4) PEG2(S4) PEGP(S4) XHCI(S3) 
XDCI(S4) HDAS(S4) CNVW(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) 
PXSX(S4) RP04(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 19200000 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: 13th Gen Intel(R) Core(TM) i5-1340P, 4590.08 MHz, 06-ba-02, patch 00004128
cpu0: cpuid 1 
edx=bfebfbff<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>
 
ecx=77fafbff<SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND>
cpu0: cpuid 6 eax=df8ff7<SENSOR,ARAT> ecx=409<EFFFREQ>
cpu0: cpuid 7.0 
ebx=239c27eb<FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,PT,SHA>
 ecx=984007ac<UMIP,PKU,WAITPKG,PKS> 
edx=fc18c410<MD_CLEAR,IBT,IBRS,IBPB,STIBP,L1DF,SSBD>
cpu0: cpuid a vers=5, gp=6, gpwidth=48, ff=3, ffwidth=48
cpu0: cpuid d.1 eax=f<XSAVEOPT,XSAVEC,XGETBV1,XSAVES>
cpu0: cpuid 80000001 edx=2c100800<NXE,PAGE1GB,RDTSCP,LONG> 
ecx=121<LAHF,ABM,3DNOWP>
cpu0: cpuid 80000007 edx=100<ITSC>
cpu0: msr 
10a=14c8fd6b<IBRS_ALL,SKIP_L1DFL,MDS_NO,IF_PSCHANGE,TAA_NO,MISC_PKG_CT,ENERGY_FILT,DOITM,SBDR_SSDP_N,FBSDP_NO,PSDP_NO,RRSBA,OVERCLOCK,GDS_NO,RFDS_CLEAR>
cpu0: 48KB 64b/line 12-way D-cache, 32KB 64b/line 8-way I-cache, 1MB 64b/line 
10-way L2 cache, 12MB 64b/line 8-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 38MHz
cpu0: mwait min=64, max=64, C-substates=0.2.0.2.0.1.0.1, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: 13th Gen Intel(R) Core(TM) i5-1340P, 4590.08 MHz, 06-ba-02, patch 00004128
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 8 (application processor)
cpu2: 13th Gen Intel(R) Core(TM) i5-1340P, 4590.05 MHz, 06-ba-02, patch 00004128
cpu2: smt 0, core 4, package 0
cpu3 at mainbus0: apid 9 (application processor)
cpu3: 13th Gen Intel(R) Core(TM) i5-1340P, 4590.04 MHz, 06-ba-02, patch 00004128
cpu3: smt 1, core 4, package 0
cpu4 at mainbus0: apid 16 (application processor)
cpu4: 13th Gen Intel(R) Core(TM) i5-1340P, 4286.24 MHz, 06-ba-02, patch 00004128
cpu4: smt 0, core 8, package 0
cpu5 at mainbus0: apid 17 (application processor)
cpu5: 13th Gen Intel(R) Core(TM) i5-1340P, 4086.29 MHz, 06-ba-02, patch 00004128
cpu5: smt 1, core 8, package 0
cpu6 at mainbus0: apid 24 (application processor)
cpu6: 13th Gen Intel(R) Core(TM) i5-1340P, 3781.56 MHz, 06-ba-02, patch 00004128
cpu6: smt 0, core 12, package 0
cpu7 at mainbus0: apid 25 (application processor)
cpu7: 13th Gen Intel(R) Core(TM) i5-1340P, 3676.02 MHz, 06-ba-02, patch 00004128
cpu7: smt 1, core 12, package 0
cpu8 at mainbus0: apid 32 (application processor)
cpu8: 13th Gen Intel(R) Core(TM) i5-1340P, 2793.56 MHz, 06-ba-02, patch 00004128
cpu8: 32KB 64b/line 8-way D-cache, 64KB 64b/line 8-way I-cache, 2MB 64b/line 
16-way L2 cache, 12MB 64b/line 8-way L3 cache
cpu8: smt 0, core 16, package 0
cpu9 at mainbus0: apid 34 (application processor)
cpu9: 13th Gen Intel(R) Core(TM) i5-1340P, 2663.50 MHz, 06-ba-02, patch 00004128
cpu9: smt 0, core 17, package 0
cpu10 at mainbus0: apid 36 (application processor)
cpu10: 13th Gen Intel(R) Core(TM) i5-1340P, 2594.02 MHz, 06-ba-02, patch 
00004128
cpu10: smt 0, core 18, package 0
cpu11 at mainbus0: apid 38 (application processor)
cpu11: 13th Gen Intel(R) Core(TM) i5-1340P, 2533.56 MHz, 06-ba-02, patch 
00004128
cpu11: smt 0, core 19, package 0
cpu12 at mainbus0: apid 40 (application processor)
cpu12: 13th Gen Intel(R) Core(TM) i5-1340P, 2433.64 MHz, 06-ba-02, patch 
00004128
cpu12: smt 0, core 20, package 0
cpu13 at mainbus0: apid 42 (application processor)
cpu13: 13th Gen Intel(R) Core(TM) i5-1340P, 2367.49 MHz, 06-ba-02, patch 
00004128
cpu13: smt 0, core 21, package 0
cpu14 at mainbus0: apid 44 (application processor)
cpu14: 13th Gen Intel(R) Core(TM) i5-1340P, 2294.71 MHz, 06-ba-02, patch 
00004128
cpu14: smt 0, core 22, package 0
cpu15 at mainbus0: apid 46 (application processor)
cpu15: 13th Gen Intel(R) Core(TM) i5-1340P, 2273.64 MHz, 06-ba-02, patch 
00004128
cpu15: smt 0, core 23, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xc0000000, bus 0-255
acpiprt0 at acpi0: bus 0 (PC00)
acpiprt1 at acpi0: bus 1 (PEG0)
acpiprt2 at acpi0: bus -1 (PEG2)
acpiprt3 at acpi0: bus -1 (RP01)
acpiprt4 at acpi0: bus -1 (RP02)
acpiprt5 at acpi0: bus -1 (RP03)
acpiprt6 at acpi0: bus -1 (RP04)
acpiprt7 at acpi0: bus -1 (RP05)
acpiprt8 at acpi0: bus -1 (RP06)
acpiprt9 at acpi0: bus 86 (RP07)
acpiprt10 at acpi0: bus -1 (RP08)
acpiprt11 at acpi0: bus -1 (RP09)
acpiprt12 at acpi0: bus -1 (RP10)
acpiprt13 at acpi0: bus -1 (RP11)
acpiprt14 at acpi0: bus -1 (RP12)
acpiprt15 at acpi0: bus -1 (RP13)
acpiprt16 at acpi0: bus -1 (RP14)
acpiprt17 at acpi0: bus -1 (RP15)
acpiprt18 at acpi0: bus -1 (RP16)
acpiprt19 at acpi0: bus -1 (RP17)
acpiprt20 at acpi0: bus -1 (RP18)
acpiprt21 at acpi0: bus -1 (RP19)
acpiprt22 at acpi0: bus -1 (RP20)
acpiprt23 at acpi0: bus -1 (RP21)
acpiprt24 at acpi0: bus -1 (RP22)
acpiprt25 at acpi0: bus -1 (RP23)
acpiprt26 at acpi0: bus -1 (RP24)
acpiprt27 at acpi0: bus 2 (TRP0)
acpiprt28 at acpi0: bus 44 (TRP2)
acpiec0 at acpi0
### AML PARSE ERROR (0x223c7): Undefined name: SHIM
error evaluating: \\_SB_.PC00.LPCB.EC0_._REG
acpiec _REG failed, broken BIOS
acpipci0 at acpi0 PC00: 0x00000000 0x00000011 0x00000001
"INTC10A2" at acpi0 not configured
"INTC10A1" at acpi0 not configured
"INTC10A1" at acpi0 not configured
"INTC10A1" at acpi0 not configured
"INTC10A1" at acpi0 not configured
"INTC10A1" at acpi0 not configured
"VAI0002" at acpi0 not configured
"ELAN0907" at acpi0 not configured
"ACPI000E" at acpi0 not configured
pchgpio0 at acpi0 GPI0 addr 0xfd6e0000/0x10000 0xfd6d0000/0x10000 
0xfd6a0000/0x10000 0xfd690000/0x10000 irq 14, 360 pins
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: LID0
acpiac0 at acpi0: AC unit offline
acpibat0 at acpi0: BAT1 model "BAT1" serial   type LIon oem "VAIO Corp. "
acpibtn2 at acpi0: SLPB
acpicpu0 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu4 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu5 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu6 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu7 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu8 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu9 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu10 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu11 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu12 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu13 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu14 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
acpicpu15 at acpi0: C3(200@1048 mwait.1@0x60), C2(350@127 mwait.1@0x21), 
C1(1000@1 mwait.1), PSS
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
intelpmc0 at acpi0: PEPD
state 0: 0x7f:1:2:0x00:0x0000000000000060
counter: 0x7f:64:0:0x00:0x0000000000000632
frequency: 0
state 1: 0x7f:1:2:0x00:0x0000000000000060
counter: 0x00:32:0:0x03:0x00000000fe00193c
frequency: 8197
"INTC1078" at acpi0 not configured
"INTC10A0" at acpi0 not configured
tpm0 at acpi0 TPM_ 2.0 (TIS) addr 0xfed40000/0x5000, device 0x001d15d1 rev 0x36
"USBC000" at acpi0 not configured
"VAI0001" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
acpipwrres0 at acpi0: WRST
acpipwrres1 at acpi0: PXP_, resource for RP05
acpipwrres2 at acpi0: TBT0, resource for TDM0, TRP0, TRP1
acpipwrres3 at acpi0: TBT1, resource for TDM1, TRP2, TRP3
acpipwrres4 at acpi0: D3C_, resource for TXHC, TDM0, TDM1, TRP0, TRP1, TRP2, 
TRP3
acpitz0 at acpi0
acpitz0: critical temperature is 120 degC
acpipwrres5 at acpi0: PIN_
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
acpivout1 at acpivideo0: DD2F
cpu0: using VERW MDS workaround
cpu0: Enhanced SpeedStep 4590 MHz: speeds: 2201, 2200, 2100, 1900, 1800, 1700, 
1600, 1400, 1300, 1200, 1000, 900, 800, 700, 500, 400 MHz
pci0 at mainbus0 bus 0
0:31:5: mem address conflict 0xfe010000/0x1000
pchb0 at pci0 dev 0 function 0 "Intel Core 13G Host" rev 0x00
inteldrm0 at pci0 dev 2 function 0 "Intel Graphics" rev 0x04
drm0 at inteldrm0
inteldrm0: msi, ALDERLAKE_P, gen 12
"Intel Core 13G DTT" rev 0x00 at pci0 dev 4 function 0 not configured
ppb0 at pci0 dev 6 function 0 "Intel Core 13G PCIE" rev 0x00: msi
pci1 at ppb0 bus 1
nvme0 at pci1 dev 0 function 0 vendor "Micron Technology", unknown product 
0x5416 rev 0x01: msix, NVMe 1.4
nvme0: CT1000P3PSSD8, firmware P9CR411, serial 2349457C2AD0
scsibus1 at nvme0: 2 targets, initiator 0
sd0 at scsibus1 targ 1 lun 0: <NVMe, CT1000P3PSSD8, P9CR>
sd0: 953869MB, 512 bytes/sector, 1953525168 sectors
ppb1 at pci0 dev 7 function 0 "Intel Core 13G PCIE" rev 0x00: msi
pci2 at ppb1 bus 2
ppb2 at pci0 dev 7 function 2 "Intel Core 13G PCIE" rev 0x00: msi
pci3 at ppb2 bus 44
"Intel Core 13G GNA" rev 0x00 at pci0 dev 8 function 0 not configured
"Intel Core 13G CL" rev 0x01 at pci0 dev 10 function 0 not configured
xhci0 at pci0 dev 13 function 0 "Intel Core 13G xHCI" rev 0x00: msi, xHCI 1.20
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
calling config_pending_incr() explore_pending=0
"Intel Core 13G TBT" rev 0x00 at pci0 dev 13 function 2 not configured
"Intel Core 13G TBT" rev 0x00 at pci0 dev 13 function 3 not configured
xhci1 at pci0 dev 20 function 0 "Intel 600 Series xHCI" rev 0x01: msi, xHCI 1.20
usb1 at xhci1: USB revision 3.0
uhub1 at usb1 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 
addr 1
calling config_pending_incr() explore_pending=0
"Intel 600 Series SRAM" rev 0x01 at pci0 dev 20 function 2 not configured
iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX211" rev 0x01, msix
dwiic0 at pci0 dev 21 function 0 "Intel 600 Series I2C" rev 0x01: apic 2 int 27
iic0 at dwiic0
dwiic1 at pci0 dev 21 function 1 "Intel 600 Series I2C" rev 0x01: apic 2 int 40
iic1 at dwiic1
ihidev0 at iic1 addr 0x15 gpio 178, vendor 0x4f3 product 0x3183, ELAN0907
ihidev0: 92 report ids
imt0 at ihidev0: touchpad, 5 contacts
wsmouse0 at imt0 mux 0
hid at ihidev0 reportid 1 not configured
hid at ihidev0 reportid 5 not configured
hid at ihidev0 reportid 6 not configured
hid at ihidev0 reportid 7 not configured
hid at ihidev0 reportid 11 not configured
hid at ihidev0 reportid 12 not configured
hid at ihidev0 reportid 13 not configured
hid at ihidev0 reportid 14 not configured
hid at ihidev0 reportid 92 not configured
"Intel 600 Series HECI" rev 0x01 at pci0 dev 22 function 0 not configured
ppb3 at pci0 dev 28 function 0 "Intel 600 Series PCIE" rev 0x01: msi
pci4 at ppb3 bus 86
re0 at pci4 dev 0 function 0 "Realtek 8168" rev 0x15: RTL8168H/8111H (0x5400), 
msi, address cc:30:80:41:10:3f
rgephy0 at re0 phy 7: RTL8251, rev. 0
pcib0 at pci0 dev 31 function 0 "Intel 700 Series eSPI" rev 0x01
azalia0 at pci0 dev 31 function 3 "Intel 700 Series HD Audio" rev 0x01: msi
azalia0: codecs: Realtek ALC269
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 600 Series SMBus" rev 0x01: apic 2 int 
16
iic2 at ichiic0
"Intel 600 Series SPI" rev 0x01 at pci0 dev 31 function 5 not configured
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
xhci1: port=1 xhci_event_port_change
xhci1: port=8 xhci_event_port_change
xhci1: port=10 xhci_event_port_change
calling config_pending_decr() explore_pending=0
xhci1: port=1 xhci_event_port_change
uhidev0 at uhub1 port 1 configuration 1 interface 0 "ELECOM OSMOD Six" rev 
2.00/6.94 addr 2
uhidev0: iclass 3/1, 6 report ids
ums0 at uhidev0 reportid 1: 8 buttons, Z and W dir
wsmouse1 at ums0 mux 0
uhid0 at uhidev0 reportid 2: input=7, output=0, feature=0
uhid1 at uhidev0 reportid 3: input=1, output=0, feature=0
uhid2 at uhidev0 reportid 4: input=1, output=0, feature=0
ucc0 at uhidev0 reportid 5: 1301 usages, 20 keys, array
wskbd1 at ucc0 mux 1
uhid3 at uhidev0 reportid 6: input=0, output=0, feature=7
xhci1: port=8 xhci_event_port_change
uvideo0 at uhub1 port 8 configuration 1 interface 0 "Quanta Front Camera" rev 
2.01/0.05 addr 3
video0 at uvideo0
ugen0 at uhub1 port 8 configuration 1 "Quanta Front Camera" rev 2.01/0.05 addr 3
xhci1: port=10 xhci_event_port_change
ugen1 at uhub1 port 10 "Intel Bluetooth" rev 2.01/0.00 addr 4
calling config_pending_decr() explore_pending=0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (6a6e14f85d56a54a.a) swap on sd0b dump on sd0b
XXX version=[OpenBSD 7.7-current (GENERIC.MP) #117: Thu May 29 21:18:15 JST 2025
    
yasu...@yasuoka-ob1.tokyo.iiji.jp:/home/yasuoka/src/sys/arch/amd64/compile/GENERIC.MP
] pointer 0xffffffff81314300 0xffffffff812d3010 0xffffffff814cc4f0 
0xffffffff81526400
guc_wait_ucode: count = 0, ret = 0
drm:pid0:intel_guc_send_mmio *ERROR* [drm] *ERROR* GT0: GUC: mmio request 
0x508: failure 30f/0
drm:pid0:__guc_self_cfg *ERROR* [drm] *ERROR* GT0: GUC: Unsuccessful 
self-config (0xfffffffffffffffae) key 0x903 value 0xa9a000
drm:pid0:ct_register_buffer *ERROR* [drm] *ERROR* GT0: GUC: CT: Failed to 
register SEND buffer (0xfffffffffffffffae)
drm:pid0:intel_guc_ct_enable *ERROR* [drm] *ERROR* GT0: GUC: CT: Failed to 
enable CTB (0xfffffffffffffffae)
drm:pid0:__uc_init_hw *ERROR* [drm] *ERROR* GT0: GuC initialization failed 
0xfffffffffffffffae
drm:pid0:intel_gt_init_hw *ERROR* [drm] *ERROR* GT0: Enabling uc failed (-5)
drm:pid0:intel_gt_resume *ERROR* [drm] *ERROR* GT0: Failed to initialize GPU, 
declaring it wedged!
drm:pid0:add_taint_for_CI *NOTICE* [drm] CI tainted: 0x1 by 0xffffffff81ac0d9bS
inteldrm0: 3840x2160, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
iwx0: hw rev 0x370, fw 77.f92b5fed.0, pnvm ce1a5094, address a4:f9:33:96:1f:31

usbdevs:
Controller /dev/usb0:
addr 01: 8086:0000 Intel, xHCI root hub
         super speed, self powered, config 1, rev 1.00
         driver: uhub0
Controller /dev/usb1:
addr 01: 8086:0000 Intel, xHCI root hub
         super speed, self powered, config 1, rev 1.00
         driver: uhub1
addr 02: 056e:01b9 ELECOM, OSMOD Six
         full speed, power 100 mA, config 1, rev 6.94
         driver: uhidev0
addr 03: 0408:3032 Quanta, Front Camera
         high speed, power 500 mA, config 1, rev 0.05, iSerial 200901010001
         driver: uvideo0
         driver: ugen0
addr 04: 8087:0033 Intel, Bluetooth
         full speed, self powered, config 1, rev 0.00
         driver: ugen1

diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_guc_ads.c 
b/sys/dev/pci/drm/i915/gt/uc/intel_guc_ads.c
index 0e31a53b613..d5f65de116f 100644
--- a/sys/dev/pci/drm/i915/gt/uc/intel_guc_ads.c
+++ b/sys/dev/pci/drm/i915/gt/uc/intel_guc_ads.c
@@ -46,10 +46,6 @@
  *      +---------------------------------------+
  *      | padding                               |
  *      +---------------------------------------+ <== 4K aligned
- *      | w/a KLVs                              |
- *      +---------------------------------------+
- *      | padding                               |
- *      +---------------------------------------+ <== 4K aligned
  *      | capture lists                         |
  *      +---------------------------------------+
  *      | padding                               |
@@ -92,11 +88,6 @@ static u32 guc_ads_golden_ctxt_size(struct intel_guc *guc)
        return PAGE_ALIGN(guc->ads_golden_ctxt_size);
 }
 
-static u32 guc_ads_waklv_size(struct intel_guc *guc)
-{
-       return PAGE_ALIGN(guc->ads_waklv_size);
-}
-
 static u32 guc_ads_capture_size(struct intel_guc *guc)
 {
        return PAGE_ALIGN(guc->ads_capture_size);
@@ -122,7 +113,7 @@ static u32 guc_ads_golden_ctxt_offset(struct intel_guc *guc)
        return PAGE_ALIGN(offset);
 }
 
-static u32 guc_ads_waklv_offset(struct intel_guc *guc)
+static u32 guc_ads_capture_offset(struct intel_guc *guc)
 {
        u32 offset;
 
@@ -132,16 +123,6 @@ static u32 guc_ads_waklv_offset(struct intel_guc *guc)
        return PAGE_ALIGN(offset);
 }
 
-static u32 guc_ads_capture_offset(struct intel_guc *guc)
-{
-       u32 offset;
-
-       offset = guc_ads_waklv_offset(guc) +
-                guc_ads_waklv_size(guc);
-
-       return PAGE_ALIGN(offset);
-}
-
 static u32 guc_ads_private_data_offset(struct intel_guc *guc)
 {
        u32 offset;
@@ -408,13 +389,8 @@ static int guc_mmio_regset_init(struct temp_regset *regset,
            CCS_MASK(engine->gt))
                ret |= GUC_MMIO_REG_ADD(gt, regset, GEN12_RCU_MODE, true);
 
-       /*
-        * some of the WA registers are MCR registers. As it is safe to
-        * use MCR form for non-MCR registers, for code simplicity, all
-        * WA registers are added with MCR form.
-        */
        for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
-               ret |= GUC_MCR_REG_ADD(gt, regset, wa->mcr_reg, wa->masked_reg);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, wa->reg, wa->masked_reg);
 
        /* Be extra paranoid and include all whitelist registers. */
        for (i = 0; i < RING_MAX_NONPRIV_SLOTS; i++)
@@ -424,19 +400,19 @@ static int guc_mmio_regset_init(struct temp_regset 
*regset,
 
        /* add in local MOCS registers */
        for (i = 0; i < LNCFCMOCS_REG_COUNT; i++)
-               if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 55))
+               if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 50))
                        ret |= GUC_MCR_REG_ADD(gt, regset, XEHP_LNCFCMOCS(i), 
false);
                else
                        ret |= GUC_MMIO_REG_ADD(gt, regset, GEN9_LNCFCMOCS(i), 
false);
 
        if (GRAPHICS_VER(engine->i915) >= 12) {
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL0)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL1)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL2)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL3)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL4)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL5)), false);
-               ret |= GUC_MCR_REG_ADD(gt, regset, 
MCR_REG(i915_mmio_reg_offset(EU_PERF_CNTL6)), false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL0, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL1, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL2, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL3, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL4, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL5, false);
+               ret |= GUC_MMIO_REG_ADD(gt, regset, EU_PERF_CNTL6, false);
        }
 
        return ret ? -1 : 0;
@@ -534,7 +510,7 @@ static void fill_engine_enable_masks(struct intel_gt *gt,
 
 #define LR_HW_CONTEXT_SIZE (80 * sizeof(u32))
 #define XEHP_LR_HW_CONTEXT_SIZE (96 * sizeof(u32))
-#define LR_HW_CONTEXT_SZ(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 55) ? \
+#define LR_HW_CONTEXT_SZ(i915) (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50) ? \
                                    XEHP_LR_HW_CONTEXT_SIZE : \
                                    LR_HW_CONTEXT_SIZE)
 #define LRC_SKIP_SIZE(i915) (LRC_PPHWSP_SZ * PAGE_SIZE + 
LR_HW_CONTEXT_SZ(i915))
@@ -827,73 +803,6 @@ engine_instance_list:
        return PAGE_ALIGN(total_size);
 }
 
-static void guc_waklv_enable_simple(struct intel_guc *guc, u32 *offset, u32 
*remain, u32 klv_id)
-{
-       u32 size;
-       u32 klv_entry[] = {
-               /* 16:16 key/length */
-               FIELD_PREP(GUC_KLV_0_KEY, klv_id) |
-               FIELD_PREP(GUC_KLV_0_LEN, 0),
-               /* 0 dwords data */
-       };
-
-       size = sizeof(klv_entry);
-       GEM_BUG_ON(*remain < size);
-
-       iosys_map_memcpy_to(&guc->ads_map, *offset, klv_entry, size);
-       *offset += size;
-       *remain -= size;
-}
-
-static void guc_waklv_init(struct intel_guc *guc)
-{
-       struct intel_gt *gt = guc_to_gt(guc);
-       u32 offset, addr_ggtt, remain, size;
-
-       if (!intel_uc_uses_guc_submission(&gt->uc))
-               return;
-
-       if (GUC_FIRMWARE_VER(guc) < MAKE_GUC_VER(70, 10, 0))
-               return;
-
-       GEM_BUG_ON(iosys_map_is_null(&guc->ads_map));
-       offset = guc_ads_waklv_offset(guc);
-       remain = guc_ads_waklv_size(guc);
-
-       /* Wa_14019159160 */
-       if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74))) {
-               guc_waklv_enable_simple(guc, &offset, &remain,
-                                       GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE);
-               guc_waklv_enable_simple(guc, &offset, &remain,
-                                       
GUC_WORKAROUND_KLV_AVOID_GFX_CLEAR_WHILE_ACTIVE);
-       }
-
-       /* Wa_16021333562 */
-       if ((GUC_FIRMWARE_VER(guc) >= MAKE_GUC_VER(70, 21, 1)) &&
-           (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74)) ||
-            IS_MEDIA_GT_IP_RANGE(gt, IP_VER(13, 0), IP_VER(13, 0)) ||
-            IS_DG2(gt->i915)))
-               guc_waklv_enable_simple(guc, &offset, &remain,
-                                       
GUC_WORKAROUND_KLV_BLOCK_INTERRUPTS_WHEN_MGSR_BLOCKED);
-
-       size = guc_ads_waklv_size(guc) - remain;
-       if (!size)
-               return;
-
-       offset = guc_ads_waklv_offset(guc);
-       addr_ggtt = intel_guc_ggtt_offset(guc, guc->ads_vma) + offset;
-
-       ads_blob_write(guc, ads.wa_klv_addr_lo, addr_ggtt);
-       ads_blob_write(guc, ads.wa_klv_addr_hi, 0);
-       ads_blob_write(guc, ads.wa_klv_size, size);
-}
-
-static int guc_prep_waklv(struct intel_guc *guc)
-{
-       /* Fudge something chunky for now: */
-       return PAGE_SIZE;
-}
-
 static void __guc_ads_init(struct intel_guc *guc)
 {
        struct intel_gt *gt = guc_to_gt(guc);
@@ -941,9 +850,6 @@ static void __guc_ads_init(struct intel_guc *guc)
        /* MMIO save/restore list */
        guc_mmio_reg_state_init(guc);
 
-       /* Workaround KLV list */
-       guc_waklv_init(guc);
-
        /* Private Data */
        ads_blob_write(guc, ads.private_data, base +
                       guc_ads_private_data_offset(guc));
@@ -987,12 +893,6 @@ int intel_guc_ads_create(struct intel_guc *guc)
                return ret;
        guc->ads_capture_size = ret;
 
-       /* And don't forget the workaround KLVs: */
-       ret = guc_prep_waklv(guc);
-       if (ret < 0)
-               return ret;
-       guc->ads_waklv_size = ret;
-
        /* Now the total size can be determined: */
        size = guc_ads_blob_size(guc);
 
@@ -1068,7 +968,7 @@ u32 intel_guc_engine_usage_offset(struct intel_guc *guc)
 
 struct iosys_map intel_guc_engine_usage_record_map(struct intel_engine_cs 
*engine)
 {
-       struct intel_guc *guc = gt_to_guc(engine->gt);
+       struct intel_guc *guc = &engine->gt->uc.guc;
        u8 guc_class = engine_class_to_guc_class(engine->class);
        size_t offset = offsetof(struct __guc_ads_blob,
                                 
engine_usage.engines[guc_class][ilog2(engine->logical_mask)]);
diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_guc_fw.c 
b/sys/dev/pci/drm/i915/gt/uc/intel_guc_fw.c
index 23f54c84cba..937f367b755 100644
--- a/sys/dev/pci/drm/i915/gt/uc/intel_guc_fw.c
+++ b/sys/dev/pci/drm/i915/gt/uc/intel_guc_fw.c
@@ -197,6 +197,7 @@ static int guc_wait_ucode(struct intel_guc *guc)
                        REG_FIELD_GET(GS_BOOTROM_MASK, status),
                        REG_FIELD_GET(GS_UKERNEL_MASK, status));
        }
+       printf("%s: count = %d, ret = %d\n", __func__, count, ret);
        after = ktime_get();
        delta = ktime_sub(after, before);
        delta_ms = ktime_to_ms(delta);

Reply via email to