[Bug 257386] MMCCAM : aw_mmc : Panic on unload

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 24 Jul 2021 17:38:42 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257386

            Bug ID: 257386
           Summary: MMCCAM : aw_mmc : Panic on unload
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: manu@freebsd.org

With an MMCCAM-enabled kernel we panic when we try to kldunload aw_mmc.
This works with non-MMCCAM kernel

Logs :
(noperiph:aw_mmc0:0:-1:ffffffff): xpt_async(AC_LOST_DEVICE)                     
(sdda1:aw_mmc0:0:0:0): Periph invalidated                                       
sdda1 at aw_mmc0 bus 0 scbus0 target 0 lun 0                                    
sdda1: Relative addr: 0000aaaa                                                  
Card features: <Memory High-Capacity SD2.0-Conditions 1.8-Signaling>            
Card memory OCR: 40ff8000                                                       
 s/n BD9724E2 detached                                                          
(pass1:aw_mmc0:0:0:0): Periph invalidated                                       
pass1 at aw_mmc0 bus 0 scbus0 target 0 lun 0                                    
pass1: Relative addr: 0000aaaa                                                  
Card features: <Memory High-Capacity SD2.0-Conditions 1.8-Signaling>            
Card memory OCR: 40ff8000                                                       
 s/n BD9724E2 detached                                                          
(noperiph:aw_mmc0:0:-1:ffffffff): (sdda1:aw_mmc0:0:0:0): Periph destroyed       
xpt_async(AC_PATH_DEREGISTERED)                                                 
(pass1:aw_mmc0:0:0:0): Periph destroyed                                         
aw_mmc0: detached                                                               
simplebus0: <mmc@1c0f000> mem 0x1c0f000-0x1c0ffff irq 12 compat
allwinner,sun50i-a64-mmc (no driver attached)                  
(noperiph:aw_mmc1:0:-1:ffffffff): xpt_async(AC_LOST_DEVICE)                     
(sdda0:aw_mmc1:0:0:0): Periph invalidated                                       
sdda0 at aw_mmc1 bus 0 scbus1 target 0 lun 0                                    
sdda0: Relative addr: 00000002                                                  
Card features: <MMC Memory High-Capacity>                                       
Card memory OCR: 40ff8080                                                       
 s/n 0503343F detached                                                          
Kernel page fault with the following non-sleepable locks held:                  
exclusive sleep mutex sleep mtxpool (sleep mtxpool) r = 0 (0xffff00004043c100)
locked @ /usr/home/manu/Work/freebsd/src/wipbsd/
sys/geom/geom_disk.c:925                                                        
exclusive sleep mutex CAM device lock (CAM device lock) r = 0
(0xffffa0000f4fdcd0) locked @ /usr/home/manu/Work/freebsd/src/wip
bsd/sys/cam/cam_xpt.c:2345                                                      
stack backtrace:
#0 0xffff000000427098 at witness_debugger+0x64                                  
#1 0xffff00000042822c at witness_warn+0x400                                     
#2 0xffff0000006b7a94 at data_abort+0xa4                                        
#3 0xffff000000697074 at handle_el1h_sync+0x74                                  
  x0: ffff00004043c100                                                          
  x1:                8                                                          
  x2: ffff0000006eeadd                                                          
  x3:              39d                                                          
  x4: ffffa00070b8f500                                                          
  x5:               6a                                                          
  x6: ffff00000040ad8c                                                          
  x7: ffff00008e1f5e90                                                          
  x8: ffffa00000560000                                                          
  x9:                2                                                          
 x10:          1030000                                                          
 x11:            10000                                                          
 x12: ffffa0000f4fdcd0                                                          
 x13:                1                                                          
 x14:            10000                                                          
 x15:                1                                                          
 x16:            10000                                                          
 x17:         ffffffff                                                          
 x18: ffff00008e1f5fc0                                                          
 x19:                0                                                          
 x20: ffff00000097e000                                                          
 x21: ffff00000097e000                                                          
 x22: ffffa0000d6e4c00                                                          
 x23: ffffa0000d06c080                                                          
 x24: ffff00000097e000                                                          
 x25:                1                                                          
 x26: ffffa0000d7ecf40                                                          
 x27: ffffa0000d7ecf00                                                          
 x28:                0                                                          
 x29: ffff00008e1f5fc0                                                          
  sp: ffff00008e1f5fc0                                                          
  lr: ffff0000002fc4f8                                                          
 elr: ffff0000002fc4f8                                                          
spsr:         80000145                                                          
 far:               10                                                          
 esr:         96000004                                                          
panic: data abort in critical section or under mutex                            
cpuid = 0                                                                       
time = 1262310946                                                               
KDB: stack backtrace:
KDB: stack backtrace:
db_trace_self() at db_trace_self
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
vpanic() at vpanic+0x184
panic() at panic+0x44
data_abort() at data_abort+0x27c
handle_el1h_sync() at handle_el1h_sync+0x74
--- exception, esr 0x96000004
disk_gone() at disk_gone+0x40
sddaoninvalidate() at sddaoninvalidate+0x160
cam_periph_invalidate() at cam_periph_invalidate+0x108
sddaasync() at sddaasync+0x3b0
xpt_async_process_dev() at xpt_async_process_dev+0x194
xptdevicetraverse() at xptdevicetraverse+0x9c
xpttargettraverse() at xpttargettraverse+0x78
xpt_async_process() at xpt_async_process+0x35c
xpt_done_process() at xpt_done_process+0x31c
xpt_async_td() at xpt_async_td+0xc4
fork_exit() at fork_exit+0x74
fork_trampoline() at fork_trampoline+0x14
KDB: enter: panic
[ thread pid 7 tid 100046 ]
Stopped at      kdb_enter+0x44: undefined       f904c11f

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