[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6d6c6bf-b787-aac9-4767-4bf54c5437ac@redhat.com>
Date: Mon, 13 Sep 2021 15:24:44 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: Fabio Aiuto <fabioaiuto83@...il.com>, gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: protect sleepq_len access by
sleep_q.lock
Hi Fabio,
On 9/13/21 3:03 PM, Fabio Aiuto wrote:
> protect sleepq_len access by sleep_q.lock and move
> pxmitpriv->lock after sleep_q.lock release.
>
> This fixes and completes a lockdep warning silencing
> done in a prevoius commit where accesses to sleep_q
> related fields were protected by sleep_q.lock instead
> of pxmitpriv->lock.
>
> Note that sleep_q.lock is already taken inside
> rtw_free_xmitframe_queue so we just wrap sleepq_len
> access.
>
> Moved pxmitpriv->lock after sleep_q.lock release to
> avoid locks nesting.
>
> Fixes: 78a1614a81f0 ("staging: rtl8723bs: remove possible deadlock when disconnect")
> Reported-by: Hans de Goede <hdegoede@...hat.com>
> Tested-by: Fabio Aiuto <fabioaiuto83@...il.com>
> Signed-off-by: Fabio Aiuto <fabioaiuto83@...il.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> index bf090f3b1db6..c98918e02afe 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> @@ -294,10 +294,12 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
>
> /* list_del_init(&psta->wakeup_list); */
>
> - spin_lock_bh(&pxmitpriv->lock);
> -
> rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
> + spin_lock_bh(&psta->sleep_q.lock);
AFAICT this needs to be above the rtw_free_xmitframe_queue() ?
Regards,
Hans
> psta->sleepq_len = 0;
> + spin_unlock_bh(&psta->sleep_q.lock);
> +
> + spin_lock_bh(&pxmitpriv->lock);
>
> /* vo */
> /* spin_lock_bh(&(pxmitpriv->vo_pending.lock)); */
>
Powered by blists - more mailing lists