From nobody Sun Feb 20 18:15:48 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 F0AF019CF8AE; Sun, 20 Feb 2022 18:15:49 +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 4K1tsK4J93z4XbZ; Sun, 20 Feb 2022 18:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380949; 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=W9idZdnf5whFzVpZ8vLlM/sn60NlLv5FOiThkiFU6SI=; b=IwVvRr69FutpwlrLY59AVfbAJ2rsef/Z2tpjQHWX2PX/6mR9nPNHxYhJ5AkJX+fzJAF7G+ RxTnVcsPRFfcWv7A5ejbFWLyRrL1HLDGxwK3VhNh+H2GGIPJ1EGy6EYQxd15M76XbLBxgM 0+ZhA9ayS106j7ikmXs1gWZR7JzEYFQuwjLh/aUrvNgRi9PoDMFkT3M4eaJvlKj0FYIRZv 68J6jp8wyPOc0UE2HMBkP7t+g/RrGj+C+0anr15fyapBa4H9pewGUOa3/PX1PlbGnXKjzS r5coKUJa9UZa0NFI51PHYzIbPk7WWN4+EJ5+bO+o4U63rMngxBTeLt+NNjTAnw== 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 F368A20C58; Sun, 20 Feb 2022 18:15:48 +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 21KIFmLm023184; Sun, 20 Feb 2022 18:15:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KIFmqG023183; Sun, 20 Feb 2022 18:15:48 GMT (envelope-from git) Date: Sun, 20 Feb 2022 18:15:48 GMT Message-Id: <202202201815.21KIFmqG023183@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1656816506fa - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1656816506fa27428dd9b2750d11bb37a5e2c3d8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380949; 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=W9idZdnf5whFzVpZ8vLlM/sn60NlLv5FOiThkiFU6SI=; b=NB1FICwlnAn7LmWJM1pqZYFy+1GVI9NXYkEInRQg4CH530m5+tzjCdUxP22mH/xrXBE0TP oWsg8bln706mwK+PItpScOrC5FsO5bL6+J2kPICTV+h/qHdZ8gK9HLeTgG1WpUbrEZ8c5G y57HLtJScRWQUnaf6Pm/+WduwSKp4gt4MrOY4rpHI7fM2QuDVRt/ECktLcgblR5QgOGJDt al5Kn/hjswg1O694hDn/MOPrSY++1i1D1FU/VhsGcrG2bzEAxAYOW++2E+Dqb41N9572cw fJ1Dw7KonPNdZQkAgYfM0bMkRQ3xupXcRpHXmIHaytX31m2Di4vjEIhOTK9d4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645380949; a=rsa-sha256; cv=none; b=T06mxFTmtqAXnmiSPZsRT/HKSXo+iyyvM0Cs6FJLfXKgE9ojgzeKhw3ZQzs8zPgrCbCS78 APRVW9oRHm9lgbsDuQ8/a2A+bDiGboPpcJChqBwqtKfB0VTULFOF7O/UgAiXAly/89Siwd HC4b1Xwzd+ro9KAnigEbUyB/HSOnSgXoSPGjTa1EJhSqPY/l3KGCwbof8YnxBNdkr0cMkI 7ghCFZa3Q7Ofy8Vz/JsRmJvu39DORbbIeMweki/K0aZN2I2bgTwGic5pqzsyXgcGqIC34K J1Tg0N7lZC/mEgGDn137P/5rYLBj3n4kUjYC8jl5bDjPlWIHwYA2xx7UaVFqiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1656816506fa27428dd9b2750d11bb37a5e2c3d8 commit 1656816506fa27428dd9b2750d11bb37a5e2c3d8 Author: Bjoern A. Zeeb AuthorDate: 2022-02-16 03:20:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-20 16:25: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 (cherry picked from commit 652e22d39562ec396d12860313677599becbc749) --- 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 fb113d770678..9000c8e62b3b 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2732,11 +2732,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); @@ -2823,6 +2819,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,