@@ -1082,7 +1082,7 @@ bool iwl_pcie_check_hw_rf_kill(struct iwl_trans *trans)
10821082 report = test_bit (STATUS_RFKILL_OPMODE , & trans -> status );
10831083
10841084 if (prev != report )
1085- iwl_trans_pcie_rf_kill (trans , report );
1085+ iwl_trans_pcie_rf_kill (trans , report , false );
10861086
10871087 return hw_rfkill ;
10881088}
@@ -1237,7 +1237,7 @@ static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
12371237 trans_pcie -> hw_mask = trans_pcie -> hw_init_mask ;
12381238}
12391239
1240- static void _iwl_trans_pcie_stop_device (struct iwl_trans * trans )
1240+ static void _iwl_trans_pcie_stop_device (struct iwl_trans * trans , bool from_irq )
12411241{
12421242 struct iwl_trans_pcie * trans_pcie = IWL_TRANS_GET_PCIE_TRANS (trans );
12431243
@@ -1264,7 +1264,8 @@ static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)
12641264 if (test_and_clear_bit (STATUS_DEVICE_ENABLED , & trans -> status )) {
12651265 IWL_DEBUG_INFO (trans ,
12661266 "DEVICE_ENABLED bit was set and is now cleared\n" );
1267- iwl_pcie_synchronize_irqs (trans );
1267+ if (!from_irq )
1268+ iwl_pcie_synchronize_irqs (trans );
12681269 iwl_pcie_rx_napi_sync (trans );
12691270 iwl_pcie_tx_stop (trans );
12701271 iwl_pcie_rx_stop (trans );
@@ -1454,7 +1455,7 @@ void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans,
14541455 clear_bit (STATUS_RFKILL_OPMODE , & trans -> status );
14551456 }
14561457 if (hw_rfkill != was_in_rfkill )
1457- iwl_trans_pcie_rf_kill (trans , hw_rfkill );
1458+ iwl_trans_pcie_rf_kill (trans , hw_rfkill , false );
14581459}
14591460
14601461static void iwl_trans_pcie_stop_device (struct iwl_trans * trans )
@@ -1469,12 +1470,12 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
14691470 mutex_lock (& trans_pcie -> mutex );
14701471 trans_pcie -> opmode_down = true;
14711472 was_in_rfkill = test_bit (STATUS_RFKILL_OPMODE , & trans -> status );
1472- _iwl_trans_pcie_stop_device (trans );
1473+ _iwl_trans_pcie_stop_device (trans , false );
14731474 iwl_trans_pcie_handle_stop_rfkill (trans , was_in_rfkill );
14741475 mutex_unlock (& trans_pcie -> mutex );
14751476}
14761477
1477- void iwl_trans_pcie_rf_kill (struct iwl_trans * trans , bool state )
1478+ void iwl_trans_pcie_rf_kill (struct iwl_trans * trans , bool state , bool from_irq )
14781479{
14791480 struct iwl_trans_pcie __maybe_unused * trans_pcie =
14801481 IWL_TRANS_GET_PCIE_TRANS (trans );
@@ -1487,7 +1488,7 @@ void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)
14871488 if (trans -> trans_cfg -> gen2 )
14881489 _iwl_trans_pcie_gen2_stop_device (trans );
14891490 else
1490- _iwl_trans_pcie_stop_device (trans );
1491+ _iwl_trans_pcie_stop_device (trans , from_irq );
14911492 }
14921493}
14931494
@@ -2887,7 +2888,7 @@ static ssize_t iwl_dbgfs_rfkill_write(struct file *file,
28872888 IWL_WARN (trans , "changing debug rfkill %d->%d\n" ,
28882889 trans_pcie -> debug_rfkill , new_value );
28892890 trans_pcie -> debug_rfkill = new_value ;
2890- iwl_pcie_handle_rfkill_irq (trans );
2891+ iwl_pcie_handle_rfkill_irq (trans , false );
28912892
28922893 return count ;
28932894}
0 commit comments