From nobody Sun Feb 8 14:22:32 2026 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98A7B39900A; Wed, 21 Jan 2026 11:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768995594; cv=pass; b=PnLe70QDWVxuN8Y+EY3O9V6tNaIZKfAyNZUv9rWNPpfwYyaN+RGoooXhQtknWloW52zhXoPl8B2UG8KN21/DkV5BWvdg0qGlevHX8U9GM38eYIfz1Q24ALAH1wCn0odE+geS8VBtTxB3EPJLZ6pVi0uqxqNmabwgyGCo/b7oxo0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768995594; c=relaxed/simple; bh=xSMHRexFKeGh+mCT8QAgPgvwg0bxy4Ohw1W3+YU7KX4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WrdLzq0Oexp44pxL5OBadToSnwhDGmvycBY409HwQ5GfCSATjHnNOxOg7r1rTwCAkK8UItK7DkxN0b426nPqf5d9XLIQrsjTvNsd0m7JHiBzCReFAMaSFS0YE+1t43l/4ml58pX9Rwy/5/6XJ2LKLiwHPvPJMAI8bQcFPwNJalA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=e/Y1DREZ; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="e/Y1DREZ" ARC-Seal: i=1; a=rsa-sha256; t=1768995589; cv=none; d=zohomail.com; s=zohoarc; b=H7H6Ah3/zE4TNztXQzljOnw86J0RbsaNXZv6a7PARHkXtbyrcWw+PuGY6zGkB5dpic8qPA33HG4iwwLBMlcoHYCiTjBd00RmGOcyMVNRlnKu7URLaLTDatS+oNEM1c/wVJO6t80VptuaW8MVxrB2USij9eE0307zRIlX0y7IJR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768995589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=8ke4xCVLQr8AOgPjzVSn9L6BhtzqTx5uuv9e/xsHD7k=; b=lxkZxJFWPBeAnNOLmMaSjXNvT5j0Z8JHStwVRRsMSHnHAFig8yyPh/peDeLD2yNbH2GuqoFG6d3Wl7uNkMajb6JW/iggwTCdcG1SApbSbhNeuM83n5SMpGUachvWdlvz2ZKpyKalANEgBiq0d7yag+6pH99PahynmglC0ATKB2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768995589; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=8ke4xCVLQr8AOgPjzVSn9L6BhtzqTx5uuv9e/xsHD7k=; b=e/Y1DREZyFZR3KRaTk5B3njCpIka8c3ykuRD+a5ANg1mOaQY8yd4AGUloSoloCrL 1e9Wk5PYQxyFP3mWbaVWgqffOsf5cycS7fKMAUHJIiovvjWjfJmQ+zjzye8wfU/KysV xGQo1jirA0kIHQ2O9wP6BpCf4nApjrVHKjpjhJoA= Received: by mx.zohomail.com with SMTPS id 176899558724093.76415336325874; Wed, 21 Jan 2026 03:39:47 -0800 (PST) From: Li Chen To: Miri Korenblit , Johannes Berg , Emmanuel Grumbach , Yedidya Benshimol , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Li Chen Subject: [PATCH v2] iwlwifi: pcie: support shutdown operation Date: Wed, 21 Jan 2026 19:39:38 +0800 Message-ID: <20260121113940.113145-1-me@linux.beauty> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Kexec reboot does not reset PCI devices. If iwlwifi is left running, the next kernel can time out during probe, breaking networking after kexec: kernel: iwlwifi 0000:06:00.0: Host monitor block 0x22 vector 0x0 kernel: iwlwifi 0000:06:00.0: value [iter 0]: 0x00000000 kernel: iwlwifi 0000:06:00.0: probe with driver iwlwifi failed with error -= 110 Register a dedicated PCI shutdown callback: run the normal teardown path and then disable the PCI function and transition it to D3hot so the next kernel can re-initialize it reliably. Signed-off-by: Li Chen --- Changes in v2: - Don't reuse the ->remove callback for shutdown. - Disable the PCI function and set D3hot after teardown. drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wi= reless/intel/iwlwifi/pcie/drv.c index dc99e7ac4726..e950aab5a39d 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -1192,6 +1192,21 @@ static void iwl_pci_remove(struct pci_dev *pdev) iwl_pcie_gen1_2_remove(trans); } =20 +static void iwl_pci_shutdown(struct pci_dev *pdev) +{ + struct iwl_trans *trans =3D pci_get_drvdata(pdev); + + if (trans) { + iwl_pcie_gen1_2_remove(trans); + pci_set_drvdata(pdev, NULL); + } + + pci_save_state(pdev); + pci_clear_master(pdev); + pci_disable_device(pdev); + pci_set_power_state(pdev, PCI_D3hot); +} + #ifdef CONFIG_PM_SLEEP =20 static int iwl_pci_suspend(struct device *device) @@ -1325,6 +1340,7 @@ static struct pci_driver iwl_pci_driver =3D { .id_table =3D iwl_hw_card_ids, .probe =3D iwl_pci_probe, .remove =3D iwl_pci_remove, + .shutdown =3D iwl_pci_shutdown, .driver.pm =3D IWL_PM_OPS, .driver.coredump =3D iwl_pci_dump, }; --=20 2.52.0