From nobody Mon Oct 17 20:41:29 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 4Mrpn53ZjBz4fQkk; Mon, 17 Oct 2022 20:41:29 +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 4Mrpn52977z45Zn; Mon, 17 Oct 2022 20:41:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666039289; 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=egXAxD2TWTZISELFSG80WN0Y833moMmMtfUV9VfS3dg=; b=AA5o6uylVqB02qpU/FYBMyPdMfbd+ycrL01K02U4aAh22ZlJNHIJqAmSwlOw998m7ntRl7 JCNRseGvfLHP5IUnCVEYWbNT2lbvato6O7zqvfaIwluT6K6YjmAv1DfO1ARzwzNx2BxeCC stP4wzsFMVF48GkDWMJyxbmKCYU2J4xWTQf2E6/8FbHi2wn6EZQhoxJ8aT6MdvlfXnofJs 7IHqUzY/yN6G3pp6c0T35ALiWUzh5447rK6wm1S0+fhHCxngOWfGWVY77NqgnnCHJDQ3VR PUgdgO8ImDUMmlaf7XX0GVVcJlFOs7aTZVvlj5V3jQLV7FCbdxOAHlXdo2DmuA== 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 4Mrpn513WkzxMJ; Mon, 17 Oct 2022 20:41:29 +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 29HKfTbC096309; Mon, 17 Oct 2022 20:41:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HKfTLU096308; Mon, 17 Oct 2022 20:41:29 GMT (envelope-from git) Date: Mon, 17 Oct 2022 20:41:29 GMT Message-Id: <202210172041.29HKfTLU096308@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: a81da2c71ca6 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a81da2c71ca6538dbf1abfe3998c00a31ef4bee5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666039289; 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=egXAxD2TWTZISELFSG80WN0Y833moMmMtfUV9VfS3dg=; b=WXF2/w+rqnBoYK4ETKiCrT4BWbY6nCyKeXc+3+nJbPe9vaTitBI+IQ2XJPx5QzTETF+f4u hAMmgsZQa6buFZAvUIVKvoHffO+Suu2qvILpegi8WFGgroYwaBaHcp6pHb3wXGrxl53Lu8 y9zCiUaeLl988UFC8aXx8SQwCKv/Iw0DxWoZISBNgZvarqcHYqKTGLqUSibmC8ebIgcYB7 OejNgCuTWP2cJBjkkfUBCECnq45QNNVgyKOADfFTUoh3cMPjRIBhNfmqytwFysZ2AoHM+Y CHGjUTdE1YryEhJL1Ry/+IW7h8uI93X5x4rxZs1yU/xXO0/VVTkn3Otwa5AJLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666039289; a=rsa-sha256; cv=none; b=aLG6xHbGVRlgwOztQdUpC45f/UmuHIZ1wmvhgHL/ro7wAEqU9aq4Va3M2Ek59vXo22dO3k v9DLrM1hotWN5FJ1Q31x7tM2RAmwjcQk8Cm+hS2rzI0MQCuo6FSFqmer3CAGe0ZpwLI0vs 649zKr/EvoRxu14UrsPq3QeOUG78GVkNukRsXn9jbBk3wSNk238UjUIMkkwyRXXUVowzxD Cfy29pqFSsi9+Msp1eL2Gw3pxcDLkB5cdm9aM3ir5sVIYC1zcDLOQr2b65tzPY7CZ2ldWS SumHza03GbOLMfyCrB869CL4m6sd9IdVrFZUKPUsSSoyzGzoJmjmRav5paqAjw== 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=a81da2c71ca6538dbf1abfe3998c00a31ef4bee5 commit a81da2c71ca6538dbf1abfe3998c00a31ef4bee5 Author: Bjoern A. Zeeb AuthorDate: 2022-09-25 21:23:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-10-17 20:37:03 +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 (cherry picked from commit f808c43ad9234670770601ba32a7426b00bbf528) --- 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: