Search Linux Wireless

[PATCH 2/2] ath9k_htc: Fix unnecessary warnings on card removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rajkumar Manoharan wrote:
> diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
> index fdf9d5f..d90838a 100644
> --- a/drivers/net/wireless/ath/ath9k/htc.h
> +++ b/drivers/net/wireless/ath/ath9k/htc.h
> @@ -339,7 +339,6 @@ void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv);
>  #define OP_ASSOCIATED		   BIT(7)
>  #define OP_ENABLE_BEACON	   BIT(8)
>  #define OP_LED_DEINIT		   BIT(9)
> -#define OP_UNPLUGGED		   BIT(10)
>  #define OP_BT_PRIORITY_DETECTED	   BIT(11)
>  #define OP_BT_SCAN		   BIT(12)

You are leaving a hole here.

> @@ -1231,6 +1236,12 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
>  	cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
>  	ath9k_led_stop_brightness(priv);
>  
> +	if (ah->ah_flags & AH_UNPLUGGED) {
> +		ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
> +		mutex_unlock(&priv->mutex);
> +		return;
> +	}
> +

This doesn't take of purging the TX queues in both the driver layer and HIF.
Also, in case of BT combo devices, the workqueue instances aren't canceled.

Instead of adding such checks throughout the driver and increasing code size,
we can just fix the warning to handle the unplugged case. It doesn't matter
if a few extra hardware calls are made, the device is no longer present anyway. :)

Sujith
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux