From nobody Mon Dec 09 19:22:57 2024 X-Original-To: dev-commits-src-main@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 4Y6Wwv0Nd5z5gh5S for ; Mon, 09 Dec 2024 19:23:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y6Wwt4W2Tz42Rp for ; Mon, 9 Dec 2024 19:23:10 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-37ed3bd6114so2030595f8f.2 for ; Mon, 09 Dec 2024 11:23:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772189; x=1734376989; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/trqQltnxaFmieXyrCpU3ggCuBHAzyvWY0HquB88V/E=; b=I6xWL0/bhsN0yM9kJojrlxjn9jucZjavKsWsn4N/RjtXX2Ffn3ESOquQTwUO4ooeyj Dn+tqebvVcXz6EUQXs5yaJBNDubHfSjeql+DM0GazftRAxasHULsxOdtJCtw/xKNf1TR T4UgEqqs7rFCuW3JdM/afnnYeBBj8YtWFh0SIKCUK4Bp2SWs/dMaTzduf4xR7SlbBGFN A1aPk9Jx057KUBEskGu7ZPF7Jzdo/XsbroPMY8+SqTjnI1UNJwrHKLj1FApwktBWXlMs 4fd32sUNj+Uh8cPhSso95Izx9/8su2F3uARcnMSDqV+lmTam44aOF7Sz7crxKXcasIOK dwzQ== X-Forwarded-Encrypted: i=1; AJvYcCXhdPpyYx7ilzykshVD75KqNM9jldB3N47BfED4yNfJbCQiZ44HlwdldgdCLNYvMWHpalWQ2wXjxHxygxkNOjnNHY0NAw==@freebsd.org X-Gm-Message-State: AOJu0Yyycrr+6F+lp60S5GtiIiks9jhGuGgyY/XR4bC8M2DF1qa2N0J1 RVxDihNp4BAZw49Q0NuplFRsNsTrrUAkkMYtc2mtvSgMtqpJrLWdSAcVPAA5fDs= X-Gm-Gg: ASbGncuKkugMJ6b5ONjvSxeLkj92mRJU5qC9rF/TIgbf/Rn6s3glwL/vK5JkW8TtKw8 CkUcnUT7LW4eF7A5jCrfOK7ftKtC+hDXNLKHxj8d68lgwdmy5IxyZGeyGyW1k2QIZ4C49RH8QWG +jEYFS/NcdQ+P0XHlYCLBN+OMyfOnLHjZ3wI3sa8IV1gZ5aw7Q17R9vzRrf0W78gmsQtsLHyUVR vq+qqxnRP1wplCCXoJN+IW//8rhGD3SGOlwqMDcXSwR8DO+3YRIkxU/RvlGGPgD X-Google-Smtp-Source: AGHT+IEuMTWONBjsYG1bzTWhye4LeQv1ijKw3Ke6mUJj6s1oEU8hoqO3Xdt+Kwnyx2wJJfnEdx4pyQ== X-Received: by 2002:a05:6000:1fa5:b0:385:e38f:8cc with SMTP id ffacd0b85a97d-386453f691emr1345679f8f.38.1733772188611; Mon, 09 Dec 2024 11:23:08 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38621fbbdd8sm13882239f8f.95.2024.12.09.11.23.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2024 11:23:08 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: git: 87e140a5c6f8 - main - iwlwifi: avoid (hard) hang on loading module From: Jessica Clarke In-Reply-To: <202412091447.4B9ElFBH050286@gitrepo.freebsd.org> Date: Mon, 9 Dec 2024 19:22:57 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6F9C2C43-A3DD-4CF5-AC27-899FE139E9A6@freebsd.org> References: <202412091447.4B9ElFBH050286@gitrepo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3826.200.121) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Y6Wwt4W2Tz42Rp X-Spamd-Bar: ---- On 9 Dec 2024, at 14:47, Bjoern A. Zeeb wrote: >=20 > The branch main has been updated by bz: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D87e140a5c6f89eea7ea6320d1ae34566= 492abfc0 >=20 > 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 >=20 > iwlwifi: avoid (hard) hang on loading module >=20 > 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. >=20 > 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. >=20 > 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. >=20 > 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(+) >=20 > 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); Missing a space in the string. Also, why not just have request_module_nowait itself defer the load until it can be done, at which point it can notice that there=E2=80=99s = nothing to do? Jess > +#endif > } > mutex_unlock(&iwlwifi_opmode_table_mtx); >=20