diff mbox

[02/11] staging: r8188eu: Remove wrapper around spin_lock_bh

Message ID 52B471F9.9080400@lwfinger.net
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Larry Finger Dec. 20, 2013, 4:36 p.m. UTC
On 12/20/2013 01:14 AM, Dan Carpenter wrote:
> On Thu, Dec 19, 2013 at 10:38:34PM -0600, Larry Finger wrote:
>> Some comment lines that mentioned spin_lock_bh() are also removed.
>>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> @@ -1509,10 +1509,6 @@ _func_enter_;
>>
>>   	rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
>>
>> -	_enter_critical_bh(&pmlmepriv->lock, &irqL);
>> -	_exit_critical_bh(&pmlmepriv->lock, &irqL);
>> -
>> -
>>   _func_exit_;
>>   }
>
> This is a functionality change that slipped in.  This is like
> spin_unlock_wait() where you want to wait until the lock is released.
>
> In this code it's probably unintended?  But don't put these things into
> a patch without mentioning it.

Dan,

Yes, I should have mentioned that I was removing a pointless lock/unlock 
sequence. Upon further checking, I see that the original driver I received from 
Realtek did have a reason for locking there, but a line was dropped from the 
code. This section should contain the following:


Thanks for reading the patches.

@Greg: Is it OK if I leave the previous patch alone and submit the above as a 
separate change?

Larry

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

Comments

gregkh@linuxfoundation.org Dec. 20, 2013, 4:57 p.m. UTC | #1
On Fri, Dec 20, 2013 at 10:36:09AM -0600, Larry Finger wrote:
> On 12/20/2013 01:14 AM, Dan Carpenter wrote:
> > On Thu, Dec 19, 2013 at 10:38:34PM -0600, Larry Finger wrote:
> >> Some comment lines that mentioned spin_lock_bh() are also removed.
> >>
> >> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> >> @@ -1509,10 +1509,6 @@ _func_enter_;
> >>
> >>   	rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
> >>
> >> -	_enter_critical_bh(&pmlmepriv->lock, &irqL);
> >> -	_exit_critical_bh(&pmlmepriv->lock, &irqL);
> >> -
> >> -
> >>   _func_exit_;
> >>   }
> >
> > This is a functionality change that slipped in.  This is like
> > spin_unlock_wait() where you want to wait until the lock is released.
> >
> > In this code it's probably unintended?  But don't put these things into
> > a patch without mentioning it.
> 
> Dan,
> 
> Yes, I should have mentioned that I was removing a pointless lock/unlock 
> sequence. Upon further checking, I see that the original driver I received from 
> Realtek did have a reason for locking there, but a line was dropped from the 
> code. This section should contain the following:
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_p2p.c 
> b/drivers/staging/rtl8188eu/core/rtw_p2p.c
> index 402fd21..b376d09 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_p2p.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_p2p.c
> @@ -1505,6 +1505,9 @@ _func_enter_;
> 
>          rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
> 
> +        spin_lock_bh(&pmlmepriv->lock);
> +        rtw_sitesurvey_cmd(struct adapter padapter, &ssid, 1, NULL, 0);
> +        spin_unlock_bh(&pmlmepriv->lock);
>   _func_exit_;
>   }
> 
> 
> Thanks for reading the patches.
> 
> @Greg: Is it OK if I leave the previous patch alone and submit the above as a 
> separate change?

Yes, just send a follow-on change would be fine, I'll take this as-is.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/rtl8188eu/core/rtw_p2p.c 
b/drivers/staging/rtl8188eu/core/rtw_p2p.c
index 402fd21..b376d09 100644
--- a/drivers/staging/rtl8188eu/core/rtw_p2p.c
+++ b/drivers/staging/rtl8188eu/core/rtw_p2p.c
@@ -1505,6 +1505,9 @@  _func_enter_;

         rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);

+        spin_lock_bh(&pmlmepriv->lock);
+        rtw_sitesurvey_cmd(struct adapter padapter, &ssid, 1, NULL, 0);
+        spin_unlock_bh(&pmlmepriv->lock);
  _func_exit_;
  }