From 2c8d25addbc99a9c72350671f39d86894d4c5637 Mon Sep 17 00:00:00 2001 From: Luca Coelho Date: Thu, 20 Sep 2018 14:28:32 +0300 Subject: backport: add patch to ignore iwlwifi removal on < 3.14 kernels The iwlwifi driver has a workaround for some PCI bugs that require it to be removed and reinserted. Unfortunately, this doesn'w work on kernels < 3.14, so ignore the actual work function in that case and print out a message instead. Signed-off-by: Luca Coelho [rename patch to have a number prefix] Signed-off-by: Johannes Berg --- patches/0085-iwlwifi-pci-device-removal.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/0085-iwlwifi-pci-device-removal.patch diff --git a/patches/0085-iwlwifi-pci-device-removal.patch b/patches/0085-iwlwifi-pci-device-removal.patch new file mode 100644 index 00000000..c72cd09f --- /dev/null +++ b/patches/0085-iwlwifi-pci-device-removal.patch @@ -0,0 +1,24 @@ +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index 7229991ae70d..d77d0aa3bf7b 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -1946,6 +1946,11 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk) + struct iwl_trans_pcie_removal *removal = + container_of(wk, struct iwl_trans_pcie_removal, work); + struct pci_dev *pdev = removal->pdev; ++#if LINUX_VERSION_IS_LESS(3,14,0) ++ dev_err(&rescan->pdev->dev, ++ "Device disconnected - can't rescan on old kernels.\n"); ++ pci_dev_put(pdev); ++#else + char *prop[] = {"EVENT=INACCESSIBLE", NULL}; + + dev_err(&pdev->dev, "Device gone - attempting removal\n"); +@@ -1957,6 +1962,7 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk) + + kfree(removal); + module_put(THIS_MODULE); ++#endif /* LINUX_VERSION_IS_LESS(3,14,0) */ + } + + static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, -- cgit v1.2.3