Search Linux Wireless

Re: [PATCH 08/13] iwlwifi: avoid dropping muttex in iwl_scan_cancel_timeout

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

 



Hi Gruszka,

On Fri, 2010-09-03 at 04:57 -0700, Stanislaw Gruszka wrote:
> Don't drop mutex when waiting for scan complete. Use STATUS_HW_SCAN bit
> to check if scanning is currency pending, because STATUS_SCANNING will
> be cleared only with priv->mutex taken.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
> ---
>  drivers/net/wireless/iwlwifi/iwl-scan.c |   17 ++++++++---------
>  1 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
> index 6ab7bb3..7e4faaf 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-scan.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
> @@ -138,22 +138,21 @@ EXPORT_SYMBOL(iwl_scan_cancel);
>   */
>  int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
>  {
> -	unsigned long now = jiffies;
> +	unsigned long timeout = jiffies + msecs_to_jiffies(ms);
>  
>  	lockdep_assert_held(&priv->mutex);
>  
> -	iwl_do_scan_abort(priv);
> +	IWL_DEBUG_SCAN(priv, "Scan cancel timeout\n");
>  
> -	if (ms) {
> -		mutex_unlock(&priv->mutex);
> -		while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
> -				test_bit(STATUS_SCANNING, &priv->status))
> -			msleep(20);
> -		mutex_lock(&priv->mutex);
> +	iwl_do_scan_abort(priv);
>  
> +	while (time_before_eq(jiffies, timeout)) {
> +		if (!test_bit(STATUS_SCAN_HW, &priv->status))
> +			break;
> +		msleep(20);
>  	}
>  
> -	return test_bit(STATUS_SCANNING, &priv->status);
> +	return test_bit(STATUS_SCAN_HW, &priv->status);
>  }
>  EXPORT_SYMBOL(iwl_scan_cancel_timeout);
>  
Should patch 7 and 8 merge into single patch?

Wey

--
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