[Bug 268393] system always reboots once from a powered off state

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 07 Mar 2023 19:36:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268393

--- Comment #16 from John Grafton <john.grafton@runbox.com> ---
(In reply to Jonathan Vasquez from comment #14)
Hi Jonathan,

All of the crash dump reports you posted appear to have panicked in the
hdac_rirb_flush function.  Specifically dereferencing the `rirb` pointer on
line 968 from `sys/dev/sound/pci/hda/hdac.c` 

I'm thinking there *may* be a bug in calculating the `rirb` read pointer in the
code just above the dereference.

Would patch your kernel hda driver (should work with stable 13) with the
attached patch and output the results?  It just adds a few debug prints to the
hda driver.

You'll also need to update a sysctl variable to ensure the debugs actually
print.

So the procedure is:
1) sysctl debug.bootverbose=1
2) patch hda driver and recompile
3) unload snd_hda and reload

Here's an example of what it looks like on a bhyve VM:

root@fbsd-current:~ # sysctl debug.bootverbose=1
root@fbsd-current:~ # kldload snd_hda
pci0: driver added                                                              
found-> vendor=0x8086, dev=0x27d8, revid=0x00                                   
       domain=0, bus=0, slot=6, func=0                                          
       class=04-03-00, hdrtype=0x00, mfdev=0                                    
       cmdreg=0x0406, statreg=0x0000, cachelnsz=0 (dwords)                      
       lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)             
       intpin=a, irq=18                                                         
pci0:0:6:0: reprobing on driver added                                           
hdac0: <Intel 82801G HDA Controller> mem 0xc0004000-0xc0007fff irq 18 at device
6.0 on pci0  
hdac0: PCI card vendor: 0x0000, device: 0x0000                                  
hdac0: HDA Driver Revision: 20120126_0002                                       
hdac0: Config options: on=0x00000000 off=0x00000000                             
ioapic0: routing intpin 18 (PCI IRQ 18) to lapic 2 vector 51                    
hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256  
hdac0: rirb_base 0xfffffe01205ff000    
hdac0: rirb_size 256    
hdac0: sc->rirb_rp 1    
hdac0: rirb address 0xfffffe01205ff008 hdac0:  response 00008086  
hdac0: rirb_base 0xfffffe01205ff000    
hdac0: rirb_size 256    
hdac0: sc->rirb_rp 2    
hdac0: rirb address 0xfffffe01205ff010 hdac0:  response 0000ffff  
hdacc0: <Generic (0x8086) HDA CODEC> at cad 0 on hdac0  
hdac0: rirb_base 0xfffffe01205ff000    
hdac0: rirb_size 256    
hdac0: sc->rirb_rp 3    
hdac0: rirb address 0xfffffe01205ff018 hdac0:  response 00010001  
hdac0: rirb_base 0xfffffe01205ff000    
hdac0: rirb_size 256    
hdac0: sc->rirb_rp 4
...

-- 
You are receiving this mail because:
You are the assignee for the bug.