Bug 257387 - MMCCAM : LOR when setting freq
Summary: MMCCAM : LOR when setting freq
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Blocks: 257385
  Show dependency treegraph
Reported: 2021-07-24 17:43 UTC by Emmanuel Vadot
Modified: 2021-07-24 17:44 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Vadot freebsd_committer 2021-07-24 17:43:59 UTC
There is a Lock Out of Order when we set the frequency on the mmc controller.

Logs :
(sdda0:aw_mmc1:0:0:0): Set SD freq to 52 MHz (min out of host f=150 MHz and card f=52 MHz)                                     
h: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/llock order reversal: (sleepable after non-sleep
 1st 0xffffa0000d6f8588  (aw_mmc_sim, sleep mutex) @ /usr/home/manu/Work/freebsd/src/wipbsd/sys/cam/cam_xpt.c:2804             
 2nd 0xffff000000a44bd8 Clock topology lock (Clock topology lock, sx) @ /usr/home/manu/Work/freebsd/src/wipbsd/sys/dev/extres/c
ocal/lib/compat/lock order aw_mmc_sim -> Clock topology lock attempted at:                                                     
#0 0pkg /usr/local/lxffff000000426d98 at witness_checkorder+0xc0c                                                              
#1 0xffff0000003cib/gcc10 /usr/lo5144 at _sx_slock_int+0x7c                                                                    
#2 0xffff00000014cfe4 at clk_disablecal/lib/perl5/5.32/mach/CORE /us+0x44                                                      
#3 0xffff0000d2a13018 at aw_mmc_set_tran_settings+0x584                                                                        
#r/local/lib/qt5 4 0xffff000000038a98 at mmc_cam_sim_default_action+0x154                                                      
#5 0xf/usr/local/llvm1fff000000009bb0 at xpt_action_default+0xcac                                                              
#6 0xffff000000008e0/lib /usr/locald4 at xpt_action+0x270                                                                      
#7 0xffff00000003b160 at sdda_start_init/llvm80/lib                                                                            
#8 0xffff000000419f64 at taskqueue_run_locked+0x188                                                                            
#9 0xffff00000041ae78 at taskqueue_thread_loop+0xc8                                                                            
#10 0xffff0000003730a0 at fork_exit+0x74                                                                                       
#11 0xffff0000006b6b9c at fork_trampoline+0x14

We need to do that in a taskqueue (or anything async).