1
0
Fork 0

iwlwifi: pcie: fix race in Rx buffer allocator

[ Upstream commit 0f22e40053 ]

Make sure the rx_allocator worker is canceled before running the
rx_init routine.  rx_init frees and re-allocates all rxb's pages.  The
rx_allocator worker also allocates pages for the used rxb's.  Running
rx_init and rx_allocator simultaniously causes a kernel panic.  Fix
that by canceling the work in rx_init.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Shaul Triebitz 2018-03-22 14:14:45 +02:00 committed by Greg Kroah-Hartman
parent 59b837d592
commit 73425f6ad6
1 changed files with 2 additions and 0 deletions

View File

@ -901,6 +901,8 @@ static int _iwl_pcie_rx_init(struct iwl_trans *trans)
}
def_rxq = trans_pcie->rxq;
cancel_work_sync(&rba->rx_alloc);
spin_lock(&rba->lock);
atomic_set(&rba->req_pending, 0);
atomic_set(&rba->req_ready, 0);