From nobody Wed Jan 15 23:36:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYMnt09krz5kpm9; Wed, 15 Jan 2025 23:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYMns6lCGz3sps; Wed, 15 Jan 2025 23:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rR58JaFIDRGPKgSKByJYZusWLymn1YQeIcawew+yu8k=; b=deVWpv+4U5UXa184CU+8R+wl87lC+ahI6YgAbzIbiRIloBOCkeDdvyjjvOXMVX/VMdgxeN pZwfZBRSXMI3X1sYLVUJBtuxjoUDf5LaBWO0JEkeMsCp58aYSkujx7fiSRQ7Q98KrwpHa1 Bek8KTTFPka2fJ2PYRh5vMQK1fVZtWgWr0vszkZjaOGME4MXdIhKFmnREFftU8OSqtYkvW jNN2ikR+3gnWZbcMCI69T/ODse020K5E0rKutI8HTlFmU9WwUCRNSEwIMY5hfuw02+odq/ dQpFxUSsoTLGH3P0GBMFqXiROgp6FvVRtdiKux6K7+ZsjMhygccJnxqW5MBdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rR58JaFIDRGPKgSKByJYZusWLymn1YQeIcawew+yu8k=; b=YIQ6vknnFYfG5k+Eg6AXrK01Boz8kp3nHIC3ahnGhd/EU3zDwkbA1J6rNxSDy8gPfdqVQH UorSPpm7KioXrhTWb0owpF1J0UQjNzLyYOIjfFpk/0LGzHlAtWQ787ajUqG+n1bgO8QKxP xiZsMz29wsvyQprcpZ+8tZa3EXhBz23ZM/dV8RGxahtOPqzrioAjK6pgp4DYY6iXT/R6lz in22wkL+AMnrm5Yy8iDvSwfGdyAwdNmk9Rl93eFdcoKTS0AYUaypXrCZ3mSDB/sBidffJT fRzdIIBlS80F8bP5LVDO+Ei20Wyl6BBHZy9ShhpxkKYZAG2hN6OsfVbodWO4ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736984177; a=rsa-sha256; cv=none; b=lFfyYB6nnZNvRUL2eM3Lg/wmAZDRmxNG/gOt7kVtgVnwqFriD2MoOFYqr0sUMeGpCRiBrw 0XgS+ZmGPEMU3Xujg3HP/I4FAW0I5LMd+7ZQsoL162FHJwobmUoVH6oZsbzcSxjhZ8ac7y E9MNNLME3bVY63o1lRGP04nBkQNuFa/cnSU4JoXmGe+XLkkgZzSMRK7Mx/LXSzx46kPUYz WzkpM+BzbwGgAWw9a27SLHmIYvjNEM7yAM9efn3dK08r4PZRC9agPBZ8nIzVJI7w+R3dlS 4CqlJeWrQCkpxUlAEz4aig5qpPt5vMxheDiFdHgTRyLVuhfx2K6tdgnKaFj7Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYMns6LqJz16m6; Wed, 15 Jan 2025 23:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50FNaHRJ009658; Wed, 15 Jan 2025 23:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FNaHH2009655; Wed, 15 Jan 2025 23:36:17 GMT (envelope-from git) Date: Wed, 15 Jan 2025 23:36:17 GMT Message-Id: <202501152336.50FNaHH2009655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 054c5ddf587a - main - net80211: add IEEE80211_IS_LOCKED() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 054c5ddf587a7a0c430cf64dbf100b718eafdcc5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=054c5ddf587a7a0c430cf64dbf100b718eafdcc5 commit 054c5ddf587a7a0c430cf64dbf100b718eafdcc5 Author: Bjoern A. Zeeb AuthorDate: 2025-01-15 22:50:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-15 23:36:00 +0000 net80211: add IEEE80211_IS_LOCKED() When trying to sort out a teardown locking problem (downcall in the driver can sleep) I found that the fan-out tree was getting too big to fix net80211 locking per-se for this while working on entirely different problems. Add IEEE80211_IS_LOCKED() so the driver can check and un-/re-lock as necessary (as we do in other cases already) to avoid panics on debug kernels left and right. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48475 --- sys/net80211/ieee80211_freebsd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index b58c55cc7652..ed913f7b3661 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -73,6 +73,8 @@ typedef struct { mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_OWNED) #define IEEE80211_UNLOCK_ASSERT(_ic) \ mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED) +#define IEEE80211_IS_LOCKED(_ic) \ + mtx_owned(IEEE80211_LOCK_OBJ(_ic)) /* * Transmit lock.