]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: mei: retry mapping the shared area
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Fri, 28 Jan 2022 12:30:55 +0000 (14:30 +0200)
committerKalle Valo <kvalo@kernel.org>
Thu, 3 Feb 2022 08:24:50 +0000 (10:24 +0200)
commit63ab652cb7b7bad0a13807c51c63d05630d2582d
tree160ef1c0dbb62c35e9a3b2ad16adaa8fe82b9027
parent580303f72d683154bbcc263962fd374f333673f8
iwlwifi: mei: retry mapping the shared area

The shared area is a DMA memory allocated in the host and
mapped so that the host and the CSME firmware can
exchange data. It is mapped through a dedicated PCI device
that is driven by the mei bus driver.

The bus driver is in charge of allocating and mapping this
memory. It also needs to configure the CSME firmware with
a specific set of commands, so that the CSME firmware will
know that this memory is meant to be used by its internal
WLAN module.

For this, the CSME firmware first needs to completely
initialize its WLAN module and only then get the mapping
request.

The problem is that the mei bus enumeration completes
before the WLAN is completely ready. This means that
the WLAN module's initialization is racing with iwlmei's
allocation and mapping flow.

Testing showed a problem in resume flows where iwlmei
was too fast and the DMA mapping failed.

Add a retry mechanism to make sure that we will succeed
to map the memory.

Fixes: 9b95cff37bce ("iwlwifi: mei: add the driver to allow cooperation with CSME")
Fixes: fa9698bfa8b8 ("iwlwifi: mei: wait before mapping the shared area")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/iwlwifi.20220128142706.cc51e6a6d635.I4b74a082eb8d89f9e4f556a27c4339c15444dc6c@changeid
drivers/net/wireless/intel/iwlwifi/mei/main.c