From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E6B3C2D0C6 for ; Wed, 11 Dec 2019 15:17:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF3BB208C3 for ; Wed, 11 Dec 2019 15:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077461; bh=V80Xt/F5molGZym4VsMs8r/TwMbFXOPehtRwwyqzMC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bmERWEz0K/hC1vYA219IuQWFYeUF8/ag/ZFYiyvEvISHERUBB2w+JCYHXR47nkKhX GrRVb1hyxRSp+gp9g+0BpY6nzraIpa3BHCt1CJEEpmMm84OgikU3skr+2s1rHudY1N pAXXNyXklPyJKnMStgWHrHzt8WLwjECW2J4NVDWI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732046AbfLKPRk (ORCPT ); Wed, 11 Dec 2019 10:17:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:45130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729663AbfLKPRi (ORCPT ); Wed, 11 Dec 2019 10:17:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 531EB24682; Wed, 11 Dec 2019 15:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077457; bh=V80Xt/F5molGZym4VsMs8r/TwMbFXOPehtRwwyqzMC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+yMSgwkJD/gcLI1UFUoCZ9NS6CIghrbqN0k/qv7k/8myNOaPSFWsjgmOt1KXWH+f Hi86mFVY2nm7iRPr3e0n7C7+gzfvU5F3OiHNUCs3LnfYhowjArB+yHFxg2QGtUeh+h HVBhvEX8bWbIp8Wzu7H7YPHg1SwcYRsgrZbOyvuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Sasha Levin Subject: [PATCH 4.19 029/243] iwlwifi: mvm: synchronize TID queue removal Date: Wed, 11 Dec 2019 16:03:11 +0100 Message-Id: <20191211150340.826896898@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 06bc6f6ed4ae0246a5e52094d1be90906a1361c7 ] When we mark a TID as no longer having a queue, there's no guarantee the TX path isn't using this txq_id right now, having accessed it just before we reset the value. To fix this, add synchronize_net() when we change the TIDs from having a queue to not having one, so that we can then be sure that the TX path is no longer accessing that queue. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 04ea516bddcc0..e850aa504b608 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -440,6 +440,16 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) rcu_read_unlock(); + /* + * The TX path may have been using this TXQ_ID from the tid_data, + * so make sure it's no longer running so that we can safely reuse + * this TXQ later. We've set all the TIDs to IWL_MVM_INVALID_QUEUE + * above, but nothing guarantees we've stopped using them. Thus, + * without this, we could get to iwl_mvm_disable_txq() and remove + * the queue while still sending frames to it. + */ + synchronize_net(); + return disable_agg_tids; } -- 2.20.1