Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2321863imm; Mon, 28 May 2018 06:03:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqui5OVg4TE/aBI+2hEHDVEhosTRcCamvM05KuCvBZ/k3T/mXeoyM8PZkAiKe18Nx3m3yBE X-Received: by 2002:a62:f24a:: with SMTP id y10-v6mr13475827pfl.75.1527512612189; Mon, 28 May 2018 06:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527512612; cv=none; d=google.com; s=arc-20160816; b=PYuIeVo++xgxcMS3h+9mzt4isFRwnIdY7fi7ZfUOvNcTaZyb4rAQGqVbVyJQizFyLj Ub8HEWPw7Fj7j1CUIKhXMVqfReVA+EKaE/D5P++9LC2bAG7NIJM84uiY49I/TPbYj+Cw cXJcAOT4iHmjiBZBr/JzGcLB9R6ZJ39rFpq3uOn/G9DjUjQPC87EUT1pZG++edUUmyTU 7TMb5o40S/Kzup7oDkkWuz11nMCazvluahqLCEa8kACl0F886O6WpOMWNl4O12lLIggR DJT4F+fzTn0ZkFkrRyF6ibFj81RBLjWg9YCzFLD43SSL30lr0buLT+e3UqZ5J3WBkrmr Nzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=uYT/y/DtGxjAIooaA20C7WwWqLkzKGj4yYQnCzjXhn4=; b=vdEQZ0mYKWRbY23iFZTjsmBhVCmuSFohYC71i8MSVvH/cykbajwyMLxTJSGIHVGhMa aR9juVhhJImwIr0lJEmQxjBzH+E3qE6vU5znGYFeABxIQjb6TlXVBVSBPUscbptmwLpK r1zIaSOZ/tivSfboM+/Fv4tXJZ0/WGesleQCsXNmodgjAKQHWFAq4b+ahNp9+1XJe0Js VmtbAcRc3gO8NP2qNpxxdjO/+O0eALe+/I9QZSi7GM3NyyDsLyP7wdvLbTAzE1boPz4E M5+kTb91grKBm9XkYOTOwwj6HGMk92ECti7QYimmNztZz3W9Q9vLUkW4CNb0G/VqmmFy 8IPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QU/Sq0Bb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i133-v6si5551769pgc.351.2018.05.28.06.03.09; Mon, 28 May 2018 06:03:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QU/Sq0Bb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164190AbeE1NCW (ORCPT + 99 others); Mon, 28 May 2018 09:02:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:42542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164117AbeE1KxU (ORCPT ); Mon, 28 May 2018 06:53:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 CF73A204EE; Mon, 28 May 2018 10:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504800; bh=ji/UW1je6A0ddRW06qqwes/tmDGXFyO3Ko+5YXUlOc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QU/Sq0Bb4TV7vQQtEenizJRB6bJHS0zg47hZXrljpcRgih05fUlaDA3MtHeCyJzp4 8bsQMl/YeuJLPUk1kDVfpZT1lCoajFnIIkqkuKDUDzHJTA3+ZHuYSCg44MDr2NrY3N 3OGO00NpzerUmCIU6yitmFxozkLxILaxhSxrR50Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Avraham Stern , Luca Coelho , Sasha Levin Subject: [PATCH 4.14 268/496] iwlwifi: mvm: clear tx queue id when unreserving aggregation queue Date: Mon, 28 May 2018 12:00:53 +0200 Message-Id: <20180528100331.148530445@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Avraham Stern [ Upstream commit 4b387906b1c3692bb790388c335515c0cf098a23 ] When a queue is reserved for aggregation, the queue id is assigned to the tid_data. This is fine since iwl_mvm_sta_tx_agg_oper() takes care of allocating the queue before actual tx starts. When the reservation is cancelled (e.g. when the AP declined the aggregation request) the tid_data is not cleared. As a result, following tx for this tid was trying to use an unallocated queue. Fix this by setting the txq_id for the tid to invalid when unreserving the queue. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -2645,8 +2645,10 @@ out: static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, - u16 txq_id) + struct iwl_mvm_tid_data *tid_data) { + u16 txq_id = tid_data->txq_id; + if (iwl_mvm_has_new_tx_api(mvm)) return; @@ -2658,8 +2660,10 @@ static void iwl_mvm_unreserve_agg_queue( * allocated through iwl_mvm_enable_txq, so we can just mark it back as * free. */ - if (mvm->queue_info[txq_id].status == IWL_MVM_QUEUE_RESERVED) + if (mvm->queue_info[txq_id].status == IWL_MVM_QUEUE_RESERVED) { mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_FREE; + tid_data->txq_id = IWL_MVM_INVALID_QUEUE; + } spin_unlock_bh(&mvm->queue_info_lock); } @@ -2690,7 +2694,7 @@ int iwl_mvm_sta_tx_agg_stop(struct iwl_m mvmsta->agg_tids &= ~BIT(tid); - iwl_mvm_unreserve_agg_queue(mvm, mvmsta, txq_id); + iwl_mvm_unreserve_agg_queue(mvm, mvmsta, tid_data); switch (tid_data->state) { case IWL_AGG_ON: @@ -2757,7 +2761,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_ mvmsta->agg_tids &= ~BIT(tid); spin_unlock_bh(&mvmsta->lock); - iwl_mvm_unreserve_agg_queue(mvm, mvmsta, txq_id); + iwl_mvm_unreserve_agg_queue(mvm, mvmsta, tid_data); if (old_state >= IWL_AGG_ON) { iwl_mvm_drain_sta(mvm, mvmsta, true);