Baochen Qiang <quic_bqiang@xxxxxxxxxxx> writes: >>>> + arsta->arvif = arvif; >>>> + arsta->ahsta = ahsta; >>>> + arsta->state = IEEE80211_STA_NONE; >>>> + wiphy_work_init(&arsta->update_wk, ath12k_sta_rc_update_wk); >>>> + >>>> + rcu_assign_pointer(ahsta->link[link_id], arsta); >>>> + >>>> + synchronize_rcu(); >>> >>> what are we waiting for here? >> >> That's a good question. I didn't analyse that thoroughly but I'm just >> making sure here that all readers have access to the new arsta before we >> return to mac80211. > > why would readers have to access arsta BEFORE returning to mac80211? > any potential race conditions? > > and even if it is necessary, how could synchronize_rcu() guarantee > that? synchronize_rcu() is used to make sure all readers have exited > from RCU read critical section, I don;t see how it could make sure a > newly assigned entry get accessed. Yeah, I'm not making any sense. I'll remove synchronize_rcu() in v2. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches