From nobody Mon Dec 09 14:47:15 2024 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 4Y6PpW2ZMYz5gNnK; Mon, 09 Dec 2024 14:47:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y6PpW1l41z4JK7; Mon, 9 Dec 2024 14:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733755635; 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=ysPORChBMjmvd1jbg0hgDpmtqYXkHG+rL2Dw4uflRP4=; b=aA2JVBnNAuLMFMiigsFKuoCg6L+Oc4TunyrZ3gd9wYlkvdMKYjgfTRfyn1Xgx00+GFWJwH 4ttnqwDfF7/OI6SOO75SD9+1K8CUbg4/uHzocOCrEbfenkIdwQPcZsx2E37Rvz5lpf70yr bnZBicHnTNqSZ3cjBsHZLduF9hKIiX6WfS+qg1YF/wfVRqBVPQBwR45UB1OEuxWRRaSYUb 7tq99xfqyUXucWBWE6dkFy5H+7skfxBMzqfL7vM5FgvGWZAKfrMg0OLELG7Ratsl2dShPG CunqocGj+PH+RmZHHjpXQ8G2WbsBQpnvRtoQnAqUBrPUMzpsfhtPWder6u4nvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733755635; 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=ysPORChBMjmvd1jbg0hgDpmtqYXkHG+rL2Dw4uflRP4=; b=g5ZVJW9MkAHkPMhSbikAErvQ81Az2TS8K5DKQ2jucPfd0DDaLPbAIxXAci1dLP37bVuSsL 9+2ll0U3pAXp69kqsuXQ8vnwdE3HCWWsp0hHgoklOv6F8z79v80OjkeYvwHs2imbTSSj4H wyXh4btiS3b3O639XW0FTESI+xnHVMIg9MCdpJD0fgx3neId9W+cA4BZQGuLPdQ7quSGme QKYK+/dxpPhFYg7clBmJhULylJUisM2IVNkGgSEe1MCPlTaUMvwLIt6XWDzSITtRZ6oaVd EGCTVA6yQRl27G0lpnz6uvO786urOePDuVQo6K9CSyHTJZPuBXyiDqn5pxUpeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733755635; a=rsa-sha256; cv=none; b=WIR+r7pfKitm7qASElSeWTbY59H7sHEyOuNL4JFgBeLq/f38gskPq6I+E/p8huIA9tmhwB iy+o4FITnQJ0btqkZHH040Cc2ZGp7BP0Y/xoNDnBlh3V5S8Zqgag8RxC7YvktZqobpNKPB WCQFzPoRL1qtKyGtc1Edzi5M9bbJWkrGKGHTu/Tn8nFu9LFLf7dhmrvwLTgtUMFvAN7swl KeOeeSUyQ/3i69Kq6mkwsInWGjCaOJDGq0P9iPsML31vVsXFZdKXHJyZqUWhpTLivnWGbJ xPrtS83ot4sHuIpZshFgndHG5ONo58TW4WzfewSMAxZMA2W/miGzUC/V4F6uWg== 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 4Y6PpW1C43zj0n; Mon, 9 Dec 2024 14:47:15 +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 4B9ElFgA050289; Mon, 9 Dec 2024 14:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B9ElFBH050286; Mon, 9 Dec 2024 14:47:15 GMT (envelope-from git) Date: Mon, 9 Dec 2024 14:47:15 GMT Message-Id: <202412091447.4B9ElFBH050286@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: 87e140a5c6f8 - main - iwlwifi: avoid (hard) hang on loading module 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 87e140a5c6f89eea7ea6320d1ae34566492abfc0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87e140a5c6f89eea7ea6320d1ae34566492abfc0 commit 87e140a5c6f89eea7ea6320d1ae34566492abfc0 Author: Bjoern A. Zeeb AuthorDate: 2024-12-08 20:24:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-12-09 14:45:24 +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 MFC after: 3 days PR: 282789 Tested by: Ruslan Makhmatkhanov, Pete Wright Differential Revision: https://reviews.freebsd.org/D47994 --- 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..61e5c064de80 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);