brcmfmac: p2p: Fix recently introduced deadlock issue
cover brcmfmac: p2p: Fix recently introduced deadlock issue
Hi,
Here is a resend of a regression/deadlock fix for 5.12 which I send out around rc1 but which still is not in Linus' tree.
This is quite a bad bug, breaking things for most broadcom wifi users.
Can we get this regression fix on its way to Linus for 5.12-rc7 ASAP please ?
Regards,
Hans
Hans de Goede (1):
brcmfmac: p2p: Fix recently introduced deadlock issue
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.30.2
PATCH RESEND 1/1 brcmfmac: p2p: Fix recently introduced deadlock issue
Commit a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") replaced the rtnl_lock parameter passed to various brcmf functions with just lock, because since that commit it is not just about the rtnl_lock but also about the wiphy_lock .
During this search/replace the "if (!rtnl_locked)" check in brcmfmac/p2p.c was accidentally replaced with "if (locked)", dropping the inversion of the check. This causes the code to now call rtnl_lock() while already holding the lock, causing a deadlock.
Add back the "!" to the if-condition to fix this.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +1 -1
@@ -2439,7 +2439,7 @@ void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool locked) vif = ifp->vif; cfg =wdev_to_cfg (&vif->wdev); cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE ].vif =NULL ; -if (locked) { +if (!locked) {rtnl_lock ();wiphy_lock (cfg->wiphy);cfg80211_unregister_wdev (&vif->wdev);
Signature · 1 line
2.30.2
Quoted 10 lines · Hans de Goede
Commit
a05829a7222e("cfg80211: avoid holding the RTNL when calling the driver") replaced thertnl_lockparameter passed to various brcmf functions with just lock, because since that commit it is not just about thertnl_lockbut also about thewiphy_lock.During this search/replace the "if (!rtnl_locked)" check in
brcmfmac/p2p.cwas accidentally replaced with "if (locked)", dropping the inversion of the check. This causes the code to now callrtnl_lock()while already holding the lock, causing a deadlock.
Quoted 5 lines
Add back the "!" to the if-condition to fix this.
Cc Johannes Berg <[email protected]>Fixes a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver")Signed-off-by Hans de Goede <[email protected]>
This is already applied:
Patch set to Superseded.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Hans de Goede
Commit
a05829a7222e("cfg80211: avoid holding the RTNL when calling the driver") replaced thertnl_lockparameter passed to various brcmf functions with just lock, because since that commit it is not just about thertnl_lockbut also about thewiphy_lock.During this search/replace the "if (!rtnl_locked)" check in
brcmfmac/p2p.cwas accidentally replaced with "if (locked)", dropping the inversion of the check. This causes the code to now callrtnl_lock()while already holding the lock, causing a deadlock.Add back the "!" to the if-condition to fix this.
Quoted 7 lines
Quoted 3 lines
Cc Johannes Berg <[email protected]>Fixes a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver")Signed-off-by Hans de Goede <[email protected]>This is already applied:
But it is not yet in 5.12-rc6, even though this is a regression fix for a regression introduced in 5.12. What is the plan to get this into 5.12 ?
Regards,
Hans
Quoted 9 lines · Hans de Goede
Hi,
Here is a resend of a regression/deadlock fix for 5.12 which I send out around rc1 but which still is not in Linus' tree.
This is quite a bad bug, breaking things for most broadcom wifi users.
Can we get this regression fix on its way to Linus for 5.12-rc7 ASAP please ?
The patch has been already applied but I have not yet sent a pull request, the plan is to send it later this week.
Please don't resend patches which have been already applied, that creates more work for me.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches