From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A559C433DB for ; Sat, 13 Mar 2021 15:23:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4769164F16 for ; Sat, 13 Mar 2021 15:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbhCMPXJ (ORCPT ); Sat, 13 Mar 2021 10:23:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbhCMPW5 (ORCPT ); Sat, 13 Mar 2021 10:22:57 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5DAC061574 for ; Sat, 13 Mar 2021 07:22:56 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lL66N-00Fegy-Dg; Sat, 13 Mar 2021 16:22:51 +0100 Message-ID: <2d419a7d1d10067760fcc553582e87fb3ca4a34a.camel@sipsolutions.net> Subject: Re: [PATCH 5.12 regression fix] brcmfmac: p2p: Fix recently introduced deadlock issue From: Johannes Berg To: Hans de Goede , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Chi-Hsien Lin , Chung-hsien Hsu , Wright Feng Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com Date: Sat, 13 Mar 2021 16:22:50 +0100 In-Reply-To: <20210313143635.109154-1-hdegoede@redhat.com> (sfid-20210313_153800_338272_9A5AD47E) References: <20210313143635.109154-1-hdegoede@redhat.com> (sfid-20210313_153800_338272_9A5AD47E) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, 2021-03-13 at 15:36 +0100, Hans de Goede wrote: > 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. Ouch, sorry about that, and thanks for the fix! johannes