From nobody Wed Feb 16 03:27:19 2022 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 4468D19DD6C5; Wed, 16 Feb 2022 03:27:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jz3L01Qgmz3DcS; Wed, 16 Feb 2022 03:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644982040; 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=+nkaVKCC4G/Wz0Lg5sOqalcqssXYhgerMn0fWU88zBQ=; b=aiFkzDEF/lopzi+GuLycx586CDZrCtIY+cT3SKZYLyBnY3XjNF4OeaPb/4tqfSBydbG6lR IVMcc71w8QtS/5ted03zR6Kv9yWMonBEIZXUfTXjyMucBQRZRMPowcDZbUl5TEKfn5yT6d N7nFXnijU11KlH5OKJQYZmr/xgHNEZosp7lV8tFTn/HAfJDLsOMzwmjCqHkSACyc6vDT52 jackO8HkRKLSbKizN01Nb5Ul+Ap1vcjtQCeYyqBFjtzERc3GiB0dbq4ohcgjbvDJFbb3PF IOF2iX9HVhh5LOuzdjGZbFvCd81e05c+nsudnH+Qd7sBvzf8boKHRtVI5iPavQ== 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 117806C31; Wed, 16 Feb 2022 03:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21G3RJ6Q085940; Wed, 16 Feb 2022 03:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21G3RJJ9085939; Wed, 16 Feb 2022 03:27:19 GMT (envelope-from git) Date: Wed, 16 Feb 2022 03:27:19 GMT Message-Id: <202202160327.21G3RJJ9085939@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: 652e22d39562 - main - LinuxKPI: 802.11: defer workq allocation until we have a name 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 652e22d39562ec396d12860313677599becbc749 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644982040; 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=+nkaVKCC4G/Wz0Lg5sOqalcqssXYhgerMn0fWU88zBQ=; b=IflBmJStiaoyNyi8eenrD4hRBa67I0JYSREjRmx3gMrOEWExa6tqawjMubkSpcSTgPfMyD fICPQg5e8MfWC8YcvQaqR1ksH0Hhvut2bZxiVTAmPMKset/45GZTftdI7crQQ5GdWb60Vf fuAemfO9bmwjqhb0/9Ogy3UYjH4GXGsmklqxNoVhj14MK69XNC3f5epBrU0oQODyXxpQ54 cp5MtuzT7K1i3NJmT1W2T8HSSPCasQk3Wj9SbzE9/Whcv5geC+bAFdyr+RKluY5FRkcNHf tikrww5hhWCWCyIegFsrfKSwHuGh3Z/2vSwqc7r5QTXe6BO087hYuH9xc78PEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644982040; a=rsa-sha256; cv=none; b=J8BoyLNUMNLxC3A4bWsHTKZNns4akBGmGf70yXws8dl7567iDOKWe6hWI+H+rniKLTODcA ZulvlQk4fC/W4U0OoaEpEG+orCw4ADNw0liZLIE0Ok1qTwe7ayYBnbzWZXgfsTL+SrOxJQ X9rYh7jfn0mqmyTxr5rk6UGW9qTOsbt46W/yRZdLFUnmDr4hBmj+dI9wUCyRq9vlf1bfYh RvSze/Ysv/ZrA2iLhzetXgS22r8c8jc8TxRicjnrWPQwZh1EExTke19Ckh4F3h6omN8vHb 4QDVJ//7V0XEbhXxDdUApxEWuwe42Nelxi3sZU9S9OajDzbHkBYfK7zKMxfBXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=652e22d39562ec396d12860313677599becbc749 commit 652e22d39562ec396d12860313677599becbc749 Author: Bjoern A. Zeeb AuthorDate: 2022-02-16 03:20:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-16 03:26:30 +0000 LinuxKPI: 802.11: defer workq allocation until we have a name Turned out all the workq's taskqueues were named "wlanNA" if you had more then one card in a machine as by the time we called wiphy_name() the device name was not set yet and we returned the fallback. Move the alloc_ordered_workqueue() from linuxkpi_ieee80211_alloc_hw() to linuxkpi_ieee80211_ifattach() at which time the device name has to be set to give us a unique name. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5cbbf269172f..1bed7de0c454 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2748,11 +2748,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) lhw = wiphy_priv(wiphy); lhw->ops = ops; - lhw->workq = alloc_ordered_workqueue(wiphy_name(wiphy), 0); - if (lhw->workq == NULL) { - wiphy_free(wiphy); - return (NULL); - } + mtx_init(&lhw->mtx, "lhw", NULL, MTX_DEF | MTX_RECURSE); TAILQ_INIT(&lhw->lvif_head); @@ -2841,6 +2837,11 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw = HW_TO_LHW(hw); ic = lhw->ic; + /* We do it this late as wiphy->dev should be set for the name. */ + lhw->workq = alloc_ordered_workqueue(wiphy_name(hw->wiphy), 0); + if (lhw->workq == NULL) + return (-EAGAIN); + /* XXX-BZ figure this out how they count his... */ if (!is_zero_ether_addr(hw->wiphy->perm_addr)) { IEEE80211_ADDR_COPY(ic->ic_macaddr,