Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2063750pxf; Sat, 13 Mar 2021 06:38:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuF61eCI++DS+0m83Kd2yuMuDQ1bIujSnYh5qmX2KFj84jVhTvwFHwTd9gFf9n3ogeBwTC X-Received: by 2002:a17:907:2062:: with SMTP id qp2mr14277081ejb.397.1615646328840; Sat, 13 Mar 2021 06:38:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615646328; cv=none; d=google.com; s=arc-20160816; b=xJl+Sq59+/OZtANBbp1Hkf4eKmqeY7zNg+STVODn84C2gPBcDooxggTZSrrQdaDZvm F4LzZlAQW4FER5z66zU/mC0CAwQdetvYljloDGKQ+zQ0A8k8cX9iJvvinprH+nmNsQl3 x0I6fP87Uc9uh9hEnLzqnfNStcj1S6BReAw4COyw3uww6WNlCEt6ODD/ck0t/16frXU3 RIvPSgRbFG8JroYALZNxYOgqKfEqDLlL8HQ0l5YgusT3INw/2fUoScVoOqjO1mLcYfms Wo+ojaoVEM7P9/niIWDHkbkqhHDWZr7STiORPsxEchTSIDv3MOt5FF6Ocd5t1wtz1Xfv l+jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=l/W4np6g+F962qJ8QBJJR7xvTtsSuG8F4rC22BpYS78=; b=ZJOV41iqqEbm8OWpTrZ4N8Ir1oeLd3NEgJE+Dg3ucFDwlXouhQQnqcsZZkGqZ8y32d Y51+Qr8w2Re/GPRmR/XpmBxNdIcOO7/Olg5AAB4fyQCCT3AegFAI9ryyptz7CTaVbleO doEXx3abWKg2mYBUu+DHSB/mMnSDGMJh6FA21LmMb/TO4BDyPVxg2idhFWuuyCBEktC5 0RP+MJ4L9R7njTYhDzNoDkArOqiasXJ0O1k1mnXJ7APOckvfPvROGCUkXAAQn/5g3UxP NTsvbN1Xqtgq4ez1kRmD0THYavH84Z6CY4OqDTkMtKpc5Faf2V8FfGnJKVrT56L6attR WM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QsCoV2ai; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si6562055ejf.189.2021.03.13.06.38.03; Sat, 13 Mar 2021 06:38:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QsCoV2ai; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233248AbhCMOhN (ORCPT + 99 others); Sat, 13 Mar 2021 09:37:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42839 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbhCMOgn (ORCPT ); Sat, 13 Mar 2021 09:36:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615646202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l/W4np6g+F962qJ8QBJJR7xvTtsSuG8F4rC22BpYS78=; b=QsCoV2ai3/gQ0ZLaNToMzlymRJBXAsh5qJnkUFkR+t+w28GeYe9mrkQXfGntZRYe4MdU5g bBliASp64IB+TzQSDOVGLeW/zm6E4OFb9dUHidFrO7s1z0cf9tKh7rXAZTYie47GCNkw7T q9Wpmwwy9RtqLdBD8X+fya7Hpa4HXWo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-qC71K_RlMWKadlO6FY_Iig-1; Sat, 13 Mar 2021 09:36:40 -0500 X-MC-Unique: qC71K_RlMWKadlO6FY_Iig-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 862AA107ACCD; Sat, 13 Mar 2021 14:36:38 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BFFD60C05; Sat, 13 Mar 2021 14:36:36 +0000 (UTC) From: Hans de Goede To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Chi-Hsien Lin , Chung-hsien Hsu , Wright Feng Cc: Hans de Goede , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, Johannes Berg Subject: [PATCH 5.12 regression fix] brcmfmac: p2p: Fix recently introduced deadlock issue Date: Sat, 13 Mar 2021 15:36:35 +0100 Message-Id: <20210313143635.109154-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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. Cc: Johannes Berg Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Signed-off-by: Hans de Goede --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index 6d30a0fcecea..34cd8a7401fe 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -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); -- 2.30.2