lkml.org 
[lkml]   [2018]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 072/246] iwlwifi: pcie: fix race in Rx buffer allocator
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Shaul Triebitz <shaul.triebitz@intel.com>

    [ Upstream commit 0f22e40053bd5378ad1e3250e65c574fd61c0cd6 ]

    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>
    ---
    drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
    +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
    @@ -901,6 +901,8 @@ static int _iwl_pcie_rx_init(struct iwl_
    }
    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);

    \
     
     \ /
      Last update: 2018-08-01 19:54    [W:4.146 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site