File tree 6 files changed +41
-12
lines changed
drivers/net/wireless/ath/ath10k
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)
626
626
{
627
627
ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot ahb hif start\n" );
628
628
629
- napi_enable ( & ar -> napi );
629
+ ath10k_core_napi_enable ( ar );
630
630
ath10k_ce_enable_interrupts (ar );
631
631
ath10k_pci_enable_legacy_irq (ar );
632
632
@@ -644,8 +644,7 @@ static void ath10k_ahb_hif_stop(struct ath10k *ar)
644
644
ath10k_ahb_irq_disable (ar );
645
645
synchronize_irq (ar_ahb -> irq );
646
646
647
- napi_synchronize (& ar -> napi );
648
- napi_disable (& ar -> napi );
647
+ ath10k_core_napi_sync_disable (ar );
649
648
650
649
ath10k_pci_flush (ar );
651
650
}
Original file line number Diff line number Diff line change @@ -2305,6 +2305,31 @@ void ath10k_core_start_recovery(struct ath10k *ar)
2305
2305
}
2306
2306
EXPORT_SYMBOL (ath10k_core_start_recovery );
2307
2307
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
+
2308
2333
static void ath10k_core_restart (struct work_struct * work )
2309
2334
{
2310
2335
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 {
868
868
869
869
/* Indicates that ath10k device is during recovery process and not complete */
870
870
ATH10K_FLAG_RESTARTING ,
871
+
872
+ /* protected by conf_mutex */
873
+ ATH10K_FLAG_NAPI_ENABLED ,
871
874
};
872
875
873
876
enum ath10k_cal_mode {
@@ -1308,6 +1311,8 @@ static inline bool ath10k_peer_stats_enabled(struct ath10k *ar)
1308
1311
1309
1312
extern unsigned long ath10k_coredump_mask ;
1310
1313
1314
+ void ath10k_core_napi_sync_disable (struct ath10k * ar );
1315
+ void ath10k_core_napi_enable (struct ath10k * ar );
1311
1316
struct ath10k * ath10k_core_create (size_t priv_size , struct device * dev ,
1312
1317
enum ath10k_bus bus ,
1313
1318
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)
1958
1958
1959
1959
ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot hif start\n" );
1960
1960
1961
- napi_enable ( & ar -> napi );
1961
+ ath10k_core_napi_enable ( ar );
1962
1962
1963
1963
ath10k_pci_irq_enable (ar );
1964
1964
ath10k_pci_rx_post (ar );
@@ -2075,8 +2075,9 @@ static void ath10k_pci_hif_stop(struct ath10k *ar)
2075
2075
2076
2076
ath10k_pci_irq_disable (ar );
2077
2077
ath10k_pci_irq_sync (ar );
2078
- napi_synchronize (& ar -> napi );
2079
- napi_disable (& ar -> napi );
2078
+
2079
+ ath10k_core_napi_sync_disable (ar );
2080
+
2080
2081
cancel_work_sync (& ar_pci -> dump_work );
2081
2082
2082
2083
/* 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)
1859
1859
struct ath10k_sdio * ar_sdio = ath10k_sdio_priv (ar );
1860
1860
int ret ;
1861
1861
1862
- napi_enable ( & ar -> napi );
1862
+ ath10k_core_napi_enable ( ar );
1863
1863
1864
1864
/* Sleep 20 ms before HIF interrupts are disabled.
1865
1865
* 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)
1992
1992
1993
1993
spin_unlock_bh (& ar_sdio -> wr_async_lock );
1994
1994
1995
- napi_synchronize (& ar -> napi );
1996
- napi_disable (& ar -> napi );
1995
+ ath10k_core_napi_sync_disable (ar );
1997
1996
}
1998
1997
1999
1998
#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)
915
915
if (!test_bit (ATH10K_FLAG_CRASH_FLUSH , & ar -> dev_flags ))
916
916
ath10k_snoc_irq_disable (ar );
917
917
918
- napi_synchronize (& ar -> napi );
919
- napi_disable (& ar -> napi );
918
+ ath10k_core_napi_sync_disable (ar );
920
919
ath10k_snoc_buffer_cleanup (ar );
921
920
ath10k_dbg (ar , ATH10K_DBG_BOOT , "boot hif stop\n" );
922
921
}
@@ -926,7 +925,8 @@ static int ath10k_snoc_hif_start(struct ath10k *ar)
926
925
struct ath10k_snoc * ar_snoc = ath10k_snoc_priv (ar );
927
926
928
927
bitmap_clear (ar_snoc -> pending_ce_irqs , 0 , CE_COUNT_MAX );
929
- napi_enable (& ar -> napi );
928
+
929
+ ath10k_core_napi_enable (ar );
930
930
ath10k_snoc_irq_enable (ar );
931
931
ath10k_snoc_rx_post (ar );
932
932
You can’t perform that action at this time.
0 commit comments