Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3715472pxb; Mon, 24 Jan 2022 16:09:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaQevEIJhsMX6m2/ygSqYJpi+nB73M/TQjpwEmQRyWesA83Jc7GFJVb2wzqy92h8PWsCt4 X-Received: by 2002:a65:5a8c:: with SMTP id c12mr13737213pgt.54.1643069352780; Mon, 24 Jan 2022 16:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069352; cv=none; d=google.com; s=arc-20160816; b=FvWIHjMRXKMexgADJP46ryw7OB1BdoDhrZBVhtGgLp9pWgekPzyBRe+zgFx6JDWwE+ N+2u1c1m5o81w7qnzTJp0IjrL74qEtEu1TgfidL2g3QjThldf+4/dYM5Lz2Iw+u9zgYe nMWHnXzxIup3FzD49DgeTlvqatNt7yXrtA7c+c2Nh4EId+1MJIJXJ/ItviDWDkIRrldU KD2e6VK0xJGo699MKx2iVKsex7np7/P8/sMB5FJfrAFQmc6ErXUmFez4y34aC+Ceh9U7 lMVGidcDRQ4+TgGxrsJkNzXebfZhMUOUMPucgJBWD3o9lS3HahqeLShwSj9R2Y7xioIz FTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u8aWJBvgd+Yga4cvoRcxGzavx7e0+sQrjb5vQXdppCA=; b=jJS0lPqtzkKlKlGV/pjTi6CzDe3Q8vFH2TVAqfxsssN7hkE+uFge0BmGcdNbCRVcbX kGVFOsKGSKadfmwnfHIr1zhZ32bP9Rx6zmll456mUa5lZcQULd93Kk6Sn1xgTaXCANOJ UP0nNjDdgniRe5jOLNbvGNdnG9fQl7sSMxnqb/k3EQb9b+vtnRo5nJ5GMeQkeckC/jDS q7BVdSUJCK7K4yBtn+fRXA3eGvJTUv871ziZM/QhfxmWDZ8Gr6EgqPywStTt01briTqa OyjGdwbVQRoo3Y6vj3qoegGxdi0rkhFWEDwUrucstom2aFNQQS5HUMMTbhSMRTy3IIP5 zhBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jbt3sKYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si4295080plg.343.2022.01.24.16.09.00; Mon, 24 Jan 2022 16:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jbt3sKYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2369294AbiAYAB2 (ORCPT + 99 others); Mon, 24 Jan 2022 19:01:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1847011AbiAXXSP (ORCPT ); Mon, 24 Jan 2022 18:18:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4283C0604F0; Mon, 24 Jan 2022 13:26:05 -0800 (PST) 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 AC391B811A2; Mon, 24 Jan 2022 21:26:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D54A1C340E4; Mon, 24 Jan 2022 21:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059563; bh=c7/XBWzsaYmWU+H2uCUZADGkTpa6wfvO5HYwbEXPfCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbt3sKYYnGeIjkDukbneQlskK/8kdKI9OHGHLBjE2u/XyH4sFMeljUZfQRd6EFUmn hFgCnwo0eBF9IfJIxX+5RkaALLiC3qpMZAmKDIV7cRv8gN/kjZAW0krBz87+0nmXyo O618R4OZVyFUlk2Z7WuAjDVqJDV0pSuMyOnsisSA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shaul Triebitz , Luca Coelho , Sasha Levin Subject: [PATCH 5.16 0625/1039] iwlwifi: mvm: avoid clearing a just saved session protection id Date: Mon, 24 Jan 2022 19:40:14 +0100 Message-Id: <20220124184146.348656466@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 f93f15357a3f8..b8c645b9880fc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -1167,15 +1167,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); @@ -1189,6 +1184,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