iwlwifi: pcie: remove non-responsive device
authorLuca Coelho <luciano.coelho@intel.com>
Tue, 12 Dec 2017 06:58:41 +0000 (08:58 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 26 Apr 2018 12:18:07 +0000 (15:18 +0300)
commit49564a806fc5551ef22140e9aa4e29c6788d3eb0
tree27985ddcfae067d87b3c4cb12e9661aaec377232
parentde460ddd8b795ceca8a826771ef8feb016bb438d
iwlwifi: pcie: remove non-responsive device

If we fail to to grab NIC access because the device is not responding
(i.e. CSR_GP_CNTRL returns 0xFFFFFFFF), remove the device from the PCI
bus, to avoid any further damage, and to let the user space rescan.

In order to inform the userspace that a rescan is needed, we send a
kobject uevent with "INACCESSIBLE".

This functionality is disabled by default, but can be enabled via a
new module parameter called "remove_when_gone".  In the future we may
change this module parameter to include 3 modes instead: do nothing;
auto-rescan or; send uevent.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Rajat Jain <rajatja@google.com>
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/trans.c