linux/drivers/net/wireless
Johannes Berg 54d1e8b27e wifi: iwlwifi: pcie: (re-)assign BAR0 on driver bind
There's a race with runtime PM getting enabled by userspace:
 - we rescan the PCI bus
 - this creates the new PCI device including its sysfs
   representation
 - udev sees the new device, and the (OS-specific?) scripting
   enables runtime PM by writing to power/control; this can
   happen _before_ the next step - this will runtime-suspend
   the device which saves the config space, including the BAR0
   that wasn't assigned yet
 - the bus rescan assigns resources to the devices and writes
   them to the config space of the device
   (but not the runtime-pm saved copy)
 - the driver binds and this disallows runtime PM, so the device
   is resumed, restoring the (incomplete!) config space
 - the driver cannot work due to BAR0 not being configured

Fixing the actual race is hard and deep in the PCI layer,
though probably should be done for upstream as well; perhaps
runtime PM should only be allowed after resource assignment,
or some other TBD way.

Work around this in the driver for now by simply (re-)assigning
BAR0 when the driver initializes, if it's unset.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230921110726.5f5f782a4e97.I4b7bf5c52ba44a8c7f9878009021689bbfa9c5ef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-09-25 09:14:59 +02:00
..
admtek
ath wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
atmel Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
broadcom wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
cisco wifi: airo: avoid uninitialized warning in airo_get_rate() 2023-07-11 19:22:54 -07:00
intel wifi: iwlwifi: pcie: (re-)assign BAR0 on driver bind 2023-09-25 09:14:59 +02:00
intersil Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
legacy Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
marvell wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
mediatek wifi: cfg80211: annotate iftype_data pointer with sparse 2023-09-11 11:27:23 +02:00
microchip wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
purelifi wifi: plfxlc: fix clang-specific fortify warning 2023-09-04 20:33:34 +03:00
quantenna wifi: cfg80211: split struct cfg80211_ap_settings 2023-09-25 09:00:39 +02:00
ralink Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
realtek wifi: rtw89: load TX power related tables from FW elements 2023-09-22 10:43:59 +03:00
rsi wifi: rsi: rsi_91x_usb_ops: Remove unnecessary (void*) conversions 2023-08-23 14:07:16 +03:00
silabs wifi: wfx: Use devm_kmemdup to replace devm_kmalloc + memcpy 2023-08-23 14:09:23 +03:00
st wifi: cw1200: Avoid processing an invalid TIM IE 2023-09-18 17:28:12 +03:00
ti wifi: wlcore: Convert to platform remove callback returning void 2023-09-18 17:31:37 +03:00
virtual wifi: mac80211_hwsim: Handle BSS_CHANGED_VALID_LINKS 2023-09-25 09:12:33 +02:00
zydas Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
Kconfig
Makefile