On Wed, 2024-03-27 at 16:07 +0200, Bitterblue Smith wrote: > > I couldn't think of a sufficiently short name, like > "lock_mac0_2g_mac1_5g", so I used mutex_is_locked(). That's probably > a bad idea. It should be like this: > > /* Let the first starting mac load RF parameters and do LCK */ > if (rtlhal->macphymode == DUALMAC_DUALPHY && > ((rtlhal->interfaceindex == 0 && rtlhal->bandset == BAND_ON_2_4G) || > (rtlhal->interfaceindex == 1 && rtlhal->bandset == BAND_ON_5G))) { After tracing the code, I feel here can only check rtlhal->macphymode. > mutex_lock(&globalmutex_for_mac0_2g_mac1_5g); > lock_mac0_2g_mac1_5g = true; > } > > .... > > if (lock_mac0_2g_mac1_5g) > mutex_unlock(&globalmutex_for_mac0_2g_mac1_5g); >