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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDF09C433EF for ; Tue, 18 Jan 2022 02:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343743AbiARC1A (ORCPT ); Mon, 17 Jan 2022 21:27:00 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38952 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245218AbiARCZJ (ORCPT ); Mon, 17 Jan 2022 21:25:09 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 077BAB81232; Tue, 18 Jan 2022 02:25:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D1BCC36AE3; Tue, 18 Jan 2022 02:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472706; bh=22TBzvVqrxec+4D1GlxVLaO6klk4pPbSwURl8EjB0iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hi5viyUqKjnX7lAIwforbLN6GSq2rf1SnT7UE11LIyUrb0iDf8nl85O1uwvPmakcI 2NA8f8YEjZU+p5u0WvOM8iKK+UbTRXzJg0IGd0cIsRktHDkhpW6Q1HP4lQS+dQuttb UIKwlHPe35xWujQEQa4uNiJEnjQ1JrHpNIvpzdsFQ8Y66pWDw7otttpgIFaqnLuD8i /XnRsFwpCxmBkw2HsE2QPWpjQos5PwfMmrA5yCCncneEGgGJxlHvn+GZPsB0xBHFXo CN04OBPzf9BNrK8thH/mSRIjk9MgjNcLE5MJAGmWsN9AxNBlH7Q+UdC/ZNyuCgYkQz aCjHedDthnm6w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shaul Triebitz , Luca Coelho , Sasha Levin , kvalo@kernel.org, davem@davemloft.net, kuba@kernel.org, emmanuel.grumbach@intel.com, avraham.stern@intel.com, ilan.peer@intel.com, sara.sharon@intel.com, nathan.errera@intel.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 105/217] iwlwifi: mvm: avoid clearing a just saved session protection id Date: Mon, 17 Jan 2022 21:17:48 -0500 Message-Id: <20220118021940.1942199-105-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shaul Triebitz [ Upstream commit 8e967c137df3b236d2075f9538cb888129425d1a ] When scheduling a session protection the id is saved but then it may be cleared when calling iwl_mvm_te_clear_data (if a previous session protection is currently active). Fix it by saving the id after calling iwl_mvm_te_clear_data. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.b0743a588d14.I098fef6677d0dab3ef1b6183ed206a10bab01eb2@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c index e91f8e889df70..e6813317edf35 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -1158,15 +1158,10 @@ void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm, cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color)), .action = cpu_to_le32(FW_CTXT_ACTION_ADD), + .conf_id = cpu_to_le32(SESSION_PROTECT_CONF_ASSOC), .duration_tu = cpu_to_le32(MSEC_TO_TU(duration)), }; - /* The time_event_data.id field is reused to save session - * protection's configuration. - */ - mvmvif->time_event_data.id = SESSION_PROTECT_CONF_ASSOC; - cmd.conf_id = cpu_to_le32(mvmvif->time_event_data.id); - lockdep_assert_held(&mvm->mutex); spin_lock_bh(&mvm->time_event_lock); @@ -1180,6 +1175,11 @@ void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm, } iwl_mvm_te_clear_data(mvm, te_data); + /* + * The time_event_data.id field is reused to save session + * protection's configuration. + */ + te_data->id = le32_to_cpu(cmd.conf_id); te_data->duration = le32_to_cpu(cmd.duration_tu); te_data->vif = vif; spin_unlock_bh(&mvm->time_event_lock); -- 2.34.1