From nobody Mon Feb 10 14:52:30 2025 X-Original-To: dev-commits-src-branches@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 4Ys6xW6Lplz5mH3m; Mon, 10 Feb 2025 14:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ys6xW11kLz4LRX; Mon, 10 Feb 2025 14:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739199151; 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=k/Nc/vgdgncHc+2oPIo0E5cRdC9Ou5gn8Z8T1m4uVOQ=; b=Fu6Tu1b/Zyl0v77gjCbRmWdkr26L84T2mKNG/FRe3sHJBjg5MJh01qh73AH5qYjzgZQBwN HrW8r6C0livTizh9wtp2xzeWN7BIK2EQKFv5fIu1tpvihYg2JSzbkRy9ylIP1RQud4NNPv 7m/4m3yMkH0SFK1UmdsE4+SlXpQk18gRLIyR+CToPoPK1qHNm0h+tsry/tIO8AKqeLZ8ph rthATJb6VS0NfNm8+JSgfFK9yjND7ZkK9UZjYC0xrpZ/IjqJcCQDjr3P8bxXXbd90PU20u S9WOcIpotjRJUJmkUMd9C6NBunm8K1K2EjZDEoOe+ig09LpJvKF7YTRAd9Ie/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739199151; 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=k/Nc/vgdgncHc+2oPIo0E5cRdC9Ou5gn8Z8T1m4uVOQ=; b=g5xGJ29iUl5eugXQudWOZQkKiDWaYqD3nXxDSQLGSTB56lKltv/OXAg9QPy3OMptDmlmMa +vlpc+xjnQNIV61CTpNcSTDSIvl+BH8jzqENZ9VlxSsDi88ofFa1BhIXgxL0awQDBbyTl8 tkjXCVoYSKdg4YosobK4SagXVaDfQl3476mfZW+HVnSKsqvl1yXk1uFIhHar/dRasiIzzq T6aGBi7nqNKZcIvAy48uN1g+liooqAJY7BttPKjM7EWUzujZLp0ET8UdAxki3w8Ds4LrTX ZLfxlMuEqkBo/BQ8JNCSZ/hfYnt88DGdjETZayLIZfyr10hb6SEc5U46Y+NJ8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739199151; a=rsa-sha256; cv=none; b=X+JG/wbIcChXNUC1GO7nSmiaFfvLR/9q7Ec/eXTQeF+Or7UdRaamfzLDbyT8OvegL3b3yU Zfq7lXu6+DJFIzHfsQBlatUkkT6gqLx/7YnRylEWhL2/OLBrTbe3JAm0tE2vqTElNda6Ng qkywHXR8jooRzp+uAHBIOLF/SWm4UV/GmbCkSMEC6GIlqDUoaXwffCmyCR5901Q9uvhh7G 7KVCRuAE5sBk5N6SDfNobYb3hQbAx3xlFhS4VFDaY8DtXS3jMVDsuueVKYWBI7qVCKdChH PGjE8My/oydJ0W90iUziG6uCCMmL31pLMxwd+MSXT4sM4T1Ww2wWmxhZ9qf08Q== 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 4Ys6xW0bmdzX75; Mon, 10 Feb 2025 14:52:31 +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 51AEqUST027578; Mon, 10 Feb 2025 14:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51AEqUAQ027575; Mon, 10 Feb 2025 14:52:30 GMT (envelope-from git) Date: Mon, 10 Feb 2025 14:52:30 GMT Message-Id: <202502101452.51AEqUAQ027575@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: 1ff77e61c64e - stable/14 - iwlwifi: avoid (hard) hang on loading module List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 1ff77e61c64e80d4532f8433ccdad656e969d62f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff77e61c64e80d4532f8433ccdad656e969d62f commit 1ff77e61c64e80d4532f8433ccdad656e969d62f Author: Bjoern A. Zeeb AuthorDate: 2024-12-08 20:24:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-10 14:52:07 +0000 iwlwifi: avoid (hard) hang on loading module For certain users or chipsets (reports were for CNVi devices but we are not sure if this is limited or specific to them) loading if_iwlwifi hangs. The reason for this is that a SYSINIT (module_load_order()) has not yet run in this case and the Linux driver tries to load the chipsets-specific module. On FreeBSD all supported sub-modules are part of if_iwlwifi so we do not have to load them separately but calling into kern_kldload via LinuxKPI request_module while loading the module gives us a hard hang. iwlwifi calls request_module_nowait() so we can simply skip over this and continue and the SYSINIT will do the job later if no other dependencies fail. Sponsored by: The FreeBSD Foundation PR: 282789 Tested by: Ruslan Makhmatkhanov, Pete Wright Differential Revision: https://reviews.freebsd.org/D47994 (cherry picked from commit 87e140a5c6f89eea7ea6320d1ae34566492abfc0) (cherry picked from commit 5d09d1070737c43738e433b547af1a90c0f10bf1) --- sys/contrib/dev/iwlwifi/iwl-drv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/iwl-drv.c b/sys/contrib/dev/iwlwifi/iwl-drv.c index 7f4746e5591e..b99204d87283 100644 --- a/sys/contrib/dev/iwlwifi/iwl-drv.c +++ b/sys/contrib/dev/iwlwifi/iwl-drv.c @@ -1749,7 +1749,20 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) goto out_unbind; } } else { +#if defined(__linux__) request_module_nowait("%s", op->name); +#elif defined(__FreeBSD__) + /* + * In FreeBSD if_iwlwifi contains all drv modules in a single + * module. SYSINIT will do the job later. We cannot call + * into kern_kldload() while being called from kern_kldload(): + * LinuxKPI request_module[_nowait] will hang hard. + * Given this is request_module_nowait() we can simply skip it. + */ + if (bootverbose) + printf("%s: module '%s' not yet available; will be initialized in a moment\n", + __func__, op->name); +#endif } mutex_unlock(&iwlwifi_opmode_table_mtx);