From nobody Sun Sep 25 21:43:31 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 4MbKBq3SyDz4d2Hc; Sun, 25 Sep 2022 21:43:31 +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 4MbKBq2vM6z3khK; Sun, 25 Sep 2022 21:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664142211; 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=jS2sh0lZ86J7KZVboUmJZy1viHyyQTJ11QnBphsYkyc=; b=q8GsihsWjGX5nCNQJohI2mf4wIiBBKIg8m/qcJB4BLe9ypQMNtid7NhcIqKjDbYGTm8c2/ HS+2HVNQaGxZhbePev34Ixeeubs2vBeO2CPcAhxUJ33uX0ayzGhDkvWpRfuiCCxyQwOkBu OdlC6jIc10wrbNHM6i0e7KdPP124VIHahtwQZ6/mYrln91CcaJVf1pWtlWm7GZRURNUjL9 LKWBwTP86fyDrDFEV9tpscK7Sxo06q1V6Vrt3dq3DfjcafV4zFDDcHk8Tbg+wt5mF4NztU SdPV24X76TykAmdSg6pr+0IRXs5+KBubfkhieOPlWJBgozHSLry2I5hE6b1k2w== 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 4MbKBq1vw6zYvq; Sun, 25 Sep 2022 21:43:31 +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 28PLhVs5016143; Sun, 25 Sep 2022 21:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28PLhVvC016142; Sun, 25 Sep 2022 21:43:31 GMT (envelope-from git) Date: Sun, 25 Sep 2022 21:43:31 GMT Message-Id: <202209252143.28PLhVvC016142@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: f808c43ad923 - main - iwlwifi: enforce FreeBSD specific (expected) behaviour 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: f808c43ad9234670770601ba32a7426b00bbf528 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664142211; 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=jS2sh0lZ86J7KZVboUmJZy1viHyyQTJ11QnBphsYkyc=; b=Y0J5Ewwjzd5ToRmBQvMPx7AC5q8jpzcHDG9MiWdGs0oSvLYr+xKBPkBRTXLGUv9OMKK4Q1 qrQfd4hyTHWaVIswlmWz/HdKIKuPVnF8MxqzkuLWZ1ZyhOOl75M1S2OUR5QAnqmKkyf3mM LtnKBdkO8O5ivtvJ+yeVHl//qKV8kQmQA0cEU6UXzT1zr+maEX+CE4O6JgC2vCxH6xQuSB Bfti51/yoEhDoKa6P9q89wkXRxM1PoTyOxLR7cRZBeyjm9IvjbWNGdXywNx+KMBI7Zwn9n wPMXCAmugitCKrCVxu0OxNWDKWav/QeSKtrvzrME509Cpa9Z4p7VHlKkhYcrsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664142211; a=rsa-sha256; cv=none; b=O4Sa9/yiRqeDZMwpV8nCeOKZMYjvk/CPdxWR4pfr0ecLcBJShQXyh61pmHAsOS3MGLAy+H D+JLlGA1h4hiM8O7ReU9EcoMfZkqYmMArY2awGh5nNDvxHlREw99ZGjmU00yv65vw9CdF6 P/X4DbMZb08O01IUP6Pd5a/gWc7ICayA4h9reVxDcXCFfDyR18Q8yicA0cBqA+Pntg8tiV H2/MVrlx+cor8v+/sh9o2ldUPBvm03qMBWqHFPHU/1Ij30HnqC3htmMncLOTxUb48v74ma KXFnOud3n45EyKgyHxFQPJb+e+tHL2fdyNVaMxD3wJoMRsETqUzJGWgM4lb60Q== 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=f808c43ad9234670770601ba32a7426b00bbf528 commit f808c43ad9234670770601ba32a7426b00bbf528 Author: Bjoern A. Zeeb AuthorDate: 2022-09-25 21:23:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-25 21:41:06 +0000 iwlwifi: enforce FreeBSD specific (expected) behaviour iwlwifi can return early from probe (in FreeBSD attach) while a separate thread is still grinding loading the firmware and setting things up. For us this means that kldload succeeded but we may not have a physical wireless interface (com) yet but the rc framework might already try to configure a vap on one. Wait until we get a firmware completion event from the other thread (on success or error) and block returning. That way we can ensure that the "hw" (or com in net80211 terms) is there when we return from attach matching the expected FreeBSD driver behaviour. Reported by: J.R. Oldroyd (jr opal.com) Reported by: probably inderectly showing as other problem Tested by: J.R. Oldroyd (jr opal.com) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/contrib/dev/iwlwifi/iwl-drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/iwl-drv.c b/sys/contrib/dev/iwlwifi/iwl-drv.c index 263126a739b5..f531ce13aff4 100644 --- a/sys/contrib/dev/iwlwifi/iwl-drv.c +++ b/sys/contrib/dev/iwlwifi/iwl-drv.c @@ -1752,6 +1752,16 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) goto err_fw; } +#if defined(__FreeBSD__) + /* + * Wait until initilization is done before returning in order to + * replicate FreeBSD's synchronous behaviour -- we cannot create + * a vap before the com is fully created but if LinuxKPI "probe" + * returned before it was all done that is what could happen. + */ + wait_for_completion(&drv->request_firmware_complete); +#endif + return drv; err_fw: