File tree Expand file tree Collapse file tree 6 files changed +41
-12
lines changed
drivers/net/wireless/ath/ath10k Expand file tree Collapse file tree 6 files changed +41
-12
lines changed Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ static int ath10k_ahb_hif_start(struct ath10k *ar)
626626{
627627 ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot ahb hif start\n" );
628628
629- napi_enable ( & ar -> napi );
629+ ath10k_core_napi_enable ( ar );
630630 ath10k_ce_enable_interrupts (ar );
631631 ath10k_pci_enable_legacy_irq (ar );
632632
@@ -644,8 +644,7 @@ static void ath10k_ahb_hif_stop(struct ath10k *ar)
644644 ath10k_ahb_irq_disable (ar );
645645 synchronize_irq (ar_ahb -> irq );
646646
647- napi_synchronize (& ar -> napi );
648- napi_disable (& ar -> napi );
647+ ath10k_core_napi_sync_disable (ar );
649648
650649 ath10k_pci_flush (ar );
651650}
Original file line number Diff line number Diff line change @@ -2305,6 +2305,31 @@ void ath10k_core_start_recovery(struct ath10k *ar)
23052305}
23062306EXPORT_SYMBOL (ath10k_core_start_recovery );
23072307
2308+ void ath10k_core_napi_enable (struct ath10k * ar )
2309+ {
2310+ lockdep_assert_held (& ar -> conf_mutex );
2311+
2312+ if (test_bit (ATH10K_FLAG_NAPI_ENABLED , & ar -> dev_flags ))
2313+ return ;
2314+
2315+ napi_enable (& ar -> napi );
2316+ set_bit (ATH10K_FLAG_NAPI_ENABLED , & ar -> dev_flags );
2317+ }
2318+ EXPORT_SYMBOL (ath10k_core_napi_enable );
2319+
2320+ void ath10k_core_napi_sync_disable (struct ath10k * ar )
2321+ {
2322+ lockdep_assert_held (& ar -> conf_mutex );
2323+
2324+ if (!test_bit (ATH10K_FLAG_NAPI_ENABLED , & ar -> dev_flags ))
2325+ return ;
2326+
2327+ napi_synchronize (& ar -> napi );
2328+ napi_disable (& ar -> napi );
2329+ clear_bit (ATH10K_FLAG_NAPI_ENABLED , & ar -> dev_flags );
2330+ }
2331+ EXPORT_SYMBOL (ath10k_core_napi_sync_disable );
2332+
23082333static void ath10k_core_restart (struct work_struct * work )
23092334{
23102335 struct ath10k * ar = container_of (work , struct ath10k , restart_work );
Original file line number Diff line number Diff line change @@ -868,6 +868,9 @@ enum ath10k_dev_flags {
868868
869869 /* Indicates that ath10k device is during recovery process and not complete */
870870 ATH10K_FLAG_RESTARTING ,
871+
872+ /* protected by conf_mutex */
873+ ATH10K_FLAG_NAPI_ENABLED ,
871874};
872875
873876enum ath10k_cal_mode {
@@ -1308,6 +1311,8 @@ static inline bool ath10k_peer_stats_enabled(struct ath10k *ar)
13081311
13091312extern unsigned long ath10k_coredump_mask ;
13101313
1314+ void ath10k_core_napi_sync_disable (struct ath10k * ar );
1315+ void ath10k_core_napi_enable (struct ath10k * ar );
13111316struct ath10k * ath10k_core_create (size_t priv_size , struct device * dev ,
13121317 enum ath10k_bus bus ,
13131318 enum ath10k_hw_rev hw_rev ,
Original file line number Diff line number Diff line change @@ -1958,7 +1958,7 @@ static int ath10k_pci_hif_start(struct ath10k *ar)
19581958
19591959 ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot hif start\n" );
19601960
1961- napi_enable ( & ar -> napi );
1961+ ath10k_core_napi_enable ( ar );
19621962
19631963 ath10k_pci_irq_enable (ar );
19641964 ath10k_pci_rx_post (ar );
@@ -2075,8 +2075,9 @@ static void ath10k_pci_hif_stop(struct ath10k *ar)
20752075
20762076 ath10k_pci_irq_disable (ar );
20772077 ath10k_pci_irq_sync (ar );
2078- napi_synchronize (& ar -> napi );
2079- napi_disable (& ar -> napi );
2078+
2079+ ath10k_core_napi_sync_disable (ar );
2080+
20802081 cancel_work_sync (& ar_pci -> dump_work );
20812082
20822083 /* Most likely the device has HTT Rx ring configured. The only way to
Original file line number Diff line number Diff line change @@ -1859,7 +1859,7 @@ static int ath10k_sdio_hif_start(struct ath10k *ar)
18591859 struct ath10k_sdio * ar_sdio = ath10k_sdio_priv (ar );
18601860 int ret ;
18611861
1862- napi_enable ( & ar -> napi );
1862+ ath10k_core_napi_enable ( ar );
18631863
18641864 /* Sleep 20 ms before HIF interrupts are disabled.
18651865 * This will give target plenty of time to process the BMI done
@@ -1992,8 +1992,7 @@ static void ath10k_sdio_hif_stop(struct ath10k *ar)
19921992
19931993 spin_unlock_bh (& ar_sdio -> wr_async_lock );
19941994
1995- napi_synchronize (& ar -> napi );
1996- napi_disable (& ar -> napi );
1995+ ath10k_core_napi_sync_disable (ar );
19971996}
19981997
19991998#ifdef CONFIG_PM
Original file line number Diff line number Diff line change @@ -915,8 +915,7 @@ static void ath10k_snoc_hif_stop(struct ath10k *ar)
915915 if (!test_bit (ATH10K_FLAG_CRASH_FLUSH , & ar -> dev_flags ))
916916 ath10k_snoc_irq_disable (ar );
917917
918- napi_synchronize (& ar -> napi );
919- napi_disable (& ar -> napi );
918+ ath10k_core_napi_sync_disable (ar );
920919 ath10k_snoc_buffer_cleanup (ar );
921920 ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot hif stop\n" );
922921}
@@ -926,7 +925,8 @@ static int ath10k_snoc_hif_start(struct ath10k *ar)
926925 struct ath10k_snoc * ar_snoc = ath10k_snoc_priv (ar );
927926
928927 bitmap_clear (ar_snoc -> pending_ce_irqs , 0 , CE_COUNT_MAX );
929- napi_enable (& ar -> napi );
928+
929+ ath10k_core_napi_enable (ar );
930930 ath10k_snoc_irq_enable (ar );
931931 ath10k_snoc_rx_post (ar );
932932
You can’t perform that action at this time.
0 commit comments