Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2425653rdb; Tue, 14 Nov 2023 23:35:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwd5qjUo/DsPZ3Alshtv1jXQ+gBiBdWCcT3UyhD8bKG8/r0YMKyDsoHWSqtNjw9DpMzMWA X-Received: by 2002:a05:6a20:8f22:b0:186:4109:a49d with SMTP id b34-20020a056a208f2200b001864109a49dmr9092607pzk.35.1700033714149; Tue, 14 Nov 2023 23:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700033714; cv=none; d=google.com; s=arc-20160816; b=IAeNevMSBtZQsUVnDVQl1qI0fevJl2bLqrNVXNIO9mfVPmbbUDGlpx06VN2fhLwzgr WdBwq0809FRrdYl6hGafqa2qSOOIwEvK/M67cJ8jvN8bKsb+mtyRbicc4GKsGP2iAv7U NJB5X2WsvEIc0UQp1MvcBavRGYY1AtK/KCtVpGMPhXEqCUIDsdzsjEI2bvzDoaovjcMd UuXk2ijCptB3MD5959iG0pAARpWsWFFlQVGG7ye5nAuf26mTyxhSRfwuRdKZ/sr3TaLO 5k1u1zpYEy0y4mWqd+UAQbnoNcuyrjCTjNdxNI8HPc4hwu2YFOk2VGJoznS83MElPdsZ GB1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RCJL9iz1prDsaBcLrOnrv15X/Kh1LP4SVCWH5cd1qVw=; fh=jRZBRiDn6JlYnI9pLVCeHZdu5qxoskwfAJYE5UuDfWQ=; b=aJfh9r29Jgu/bXXSwylFN5fqF/EFHw6k2tkTl1Wn0wtLO4gy57KGuO/c0tbpIc0sIR PwIbEDRrJ/Cybqj0Tp9MJF0qqzwjIW7upmzC6wABbWlwvjrtAunkggXs369vRK5IoWxb Qe9DJhW48DKIUEYNF+AOPNiS9Vo+5nrGvVZFifbWb3hdJMCRARqEGxndIcJ24mxaJyFG yMRwPE3hEidroZyPregdYehFJZm738FLtpEO03dXFejLw3nt0/YuWwsZTuRwgarnWPYH to1hhheOxQYVOm/UkxqZvNZu1x7O0N/1NIJ54oscH2VO2Q1L4xulKcw6dnuvoJVf4Lca Yfeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tUBxUm0p; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id lp15-20020a17090b4a8f00b002568a675b65si15556563pjb.141.2023.11.14.23.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 23:35:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tUBxUm0p; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5DE7980BB50D; Tue, 14 Nov 2023 23:35:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234648AbjKOHfH (ORCPT + 52 others); Wed, 15 Nov 2023 02:35:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjKOHfG (ORCPT ); Wed, 15 Nov 2023 02:35:06 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688C1E1 for ; Tue, 14 Nov 2023 23:35:02 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2865C433C9; Wed, 15 Nov 2023 07:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700033702; bh=GT0hEbHcdnhV9E8kQMfoo+S3PpKbshnIluX+ZHX2Jx0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tUBxUm0pK97Aj7nnaMJh/hTbtCEvoT8dVr5yM1ias4rduvE8PGNJREA+9Vrt+dgOW +kKH5gNLjTAAayCteZD/XkSSxTngPbxMOWEaEsipDJhJ2REOUjUVFKEGsOmyrIYF77 ri2qNbfMtoXZaQR2OmxcyS+agb4+kbSpfGK7uCCVNGBqUWN0Fe4R6zdrXFGg+h2gsA OCvZxvuUps9ZVLrZLhGxNEs6sXTyE9KkuueRl4Cyx2xYnFka2b2Tu26DEy1Me/y8dz Kvqt1wb6GBseqkan97QMwT4og26+hJ2qUMEAk+UL7+rBl9qPUbsDE3tCij+aP7rUIt F4nQxLZ8zEhhg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1r3AQN-0000H1-0L; Wed, 15 Nov 2023 08:34:59 +0100 Date: Wed, 15 Nov 2023 08:34:59 +0100 From: Johan Hovold To: Johannes Berg Cc: Emmanuel Grumbach , linux-wireless@vger.kernel.org Subject: Re: wifi: mac80211: lockdep splat with 6.7-rc1 Message-ID: References: <02159e92fd1d9a6fd993ae9f913c7ed756b6d3ac.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02159e92fd1d9a6fd993ae9f913c7ed756b6d3ac.camel@sipsolutions.net> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 14 Nov 2023 23:35:06 -0800 (PST) On Tue, Nov 14, 2023 at 06:02:33PM +0100, Johannes Berg wrote: > On Tue, 2023-11-14 at 16:50 +0100, Johan Hovold wrote: > > Naively adding locking around the call in ieee80211_get_tx_power() > > (e.g. similar to 6b348f6e34ce ("wifi: mac80211: ethtool: always hold > > wiphy mutex")) does not work as there are other paths that call this > > function with the lock held, specifically via ieee80211_register_hw(). > > The latter we can just take the lock I guess? ieee80211_register_hw() is specifically already taking the lock. > > [ 7.127780] ieee80211_get_tx_power+0x19c/0x1c0 [mac80211] > > [ 7.127859] nl80211_send_iface+0x208/0x6a4 [cfg80211] > > [ 7.127946] nl80211_dump_interface+0x120/0x254 [cfg80211] > > And here maybe we should just take the mutex at the nl80211 level. Yeah, it looks like you can possibly add it to nl80211_dump_interface(). nl80211_send_iface() is already called in paths like: ieee80211_get_tx_power+0x28/0x1c0 [mac80211] nl80211_send_iface+0x208/0x6a4 [cfg80211] nl80211_notify_iface+0x58/0xcc [cfg80211] cfg80211_register_wdev+0xa0/0x12c [cfg80211] cfg80211_register_netdevice+0x7c/0x108 [cfg80211] ieee80211_if_add+0x4b0/0x5cc [mac80211] ieee80211_register_hw+0xbec/0xc2c [mac80211] > That's the nice thing now, it's shared between the layers :) > > I can't do it right now, but I'll take a look tomorrow. Sounds good, thanks. Johan