Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2280873iof; Wed, 8 Jun 2022 01:17:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPVf4oG7C/uVtYhHJBfvMZvT6D9VRaxFbV9PaFpBT9jZQC9GOkQmjZqaNLKX/HnDqeTIFc X-Received: by 2002:a05:6a00:1c8c:b0:51c:4b1e:61b3 with SMTP id y12-20020a056a001c8c00b0051c4b1e61b3mr4753486pfw.65.1654676276650; Wed, 08 Jun 2022 01:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654676276; cv=none; d=google.com; s=arc-20160816; b=Xus0MgU57Zf8ge2YxRGBTndh0prJGzfBxb2O9NKUJmZDZAlHfo4us7CVPAIfQoD0ii ItYeQP6fJCfA8kpYhCQErwil2RfnOihs7f3PQci0HwFVbgYSTprcpoJ+dw4EyjXkoe7+ 8SSu5uI/yf/lt+Aikp6H2+CXfQf1GUFqMgORE8SQzAA2ZTCfIw0SNvxH8to9R7Opcv7f 0oSuhjcY+doozHJSbpN7cgEZitIgd+A+hPbI8bFg0K1K2KGFTk/h4aMrEOY5yHy2i5gt eWSuKS7sERPgmVdITU0Nb6AOHe1KrkzgMbZ3Zf6bIc0NWWQsCSluvOLIrcrae9shtCXa xGsw== 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=IVbWIL7Bcb7FtemFHlFMwGF9ZAmtdgaWIaNm2cAp5EU=; b=IbOUmRlMlrCfQWabzFVqhD7WEgMSphu6IhtJ9AjGLoiT4HiHAz+xxlLT03P3IaxiRW JCm2e2OfO+nrICypYaYSHXlKuucFiWFrtel+eV9DqeZpXGamw86Md135Cgi/JuFtN9LM QVO1HWvkSi7zmrsRYSiGLJhF3DVRPZ30yRs1Xer6RnSZQdZ0H7Dn5ps82JORmP3U8EZI rSwd+NjF8S/manRwxz4VgUc8maDA9tAQt+wXR3jCjAQro0Ecjuxprg+ROuWZLzKjBxxc mXgw5Zoj6EqSrmsrPsmNWrlbUoXyi7Uj3eWEKSgo0G41+5qpYHeXEPGqmxgJxrJGUbv4 xC4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DfQ84Bg0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l190-20020a6388c7000000b003fae0c67055si26949417pgd.777.2022.06.08.01.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:17:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DfQ84Bg0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A414A3A7BE1; Wed, 8 Jun 2022 00:48:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385590AbiFGWqF (ORCPT + 99 others); Tue, 7 Jun 2022 18:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380214AbiFGVet (ORCPT ); Tue, 7 Jun 2022 17:34:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1690176D55; Tue, 7 Jun 2022 12:04:31 -0700 (PDT) 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 5EAACB822C0; Tue, 7 Jun 2022 19:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2DB8C385A5; Tue, 7 Jun 2022 19:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628670; bh=wEKKenlvPb1mVxBs0kYMNPZMdqG1HK4ATWQH0fnv72Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DfQ84Bg0EVX0xxJak6MMQXbJ+X0k5rZqckIhnQ2QVTrCkFvjhSCcZdcc/xnqBscWB VjgwW5TSDvA/DZT8N2rgHdaIgtslrNdgXqR/hqoRC2o5bylxgSxIB9NrjmEDAwXD+D 6P5VqBd1/uQc8l3wJuSBX/p4ka+J3BaBZZpcYWLo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baochen Qiang , Kalle Valo , Sasha Levin Subject: [PATCH 5.18 411/879] ath11k: Dont check arvif->is_started before sending management frames Date: Tue, 7 Jun 2022 18:58:49 +0200 Message-Id: <20220607165014.793023265@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baochen Qiang [ Upstream commit 355333a217541916576351446b5832fec7930566 ] Commit 66307ca04057 ("ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev") wants both of below two conditions are true before sending management frames: 1: ar->allocated_vdev_map & (1LL << arvif->vdev_id) 2: arvif->is_started Actually the second one is not necessary because with the first one we can make sure the vdev is present. Also use ar->conf_mutex to synchronize vdev delete and mgmt. TX. This issue is found in case of Passpoint scenario where ath11k needs to send action frames before vdev is started. Fix it by removing the second condition. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Fixes: 66307ca04057 ("ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506013614.1580274-3-quic_bqiang@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/mac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 2c8d5f2a0517..54d738bdee0e 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5520,8 +5520,8 @@ static void ath11k_mgmt_over_wmi_tx_work(struct work_struct *work) } arvif = ath11k_vif_to_arvif(skb_cb->vif); - if (ar->allocated_vdev_map & (1LL << arvif->vdev_id) && - arvif->is_started) { + mutex_lock(&ar->conf_mutex); + if (ar->allocated_vdev_map & (1LL << arvif->vdev_id)) { ret = ath11k_mac_mgmt_tx_wmi(ar, arvif, skb); if (ret) { ath11k_warn(ar->ab, "failed to tx mgmt frame, vdev_id %d :%d\n", @@ -5539,6 +5539,7 @@ static void ath11k_mgmt_over_wmi_tx_work(struct work_struct *work) arvif->is_started); ath11k_mgmt_over_wmi_tx_drop(ar, skb); } + mutex_unlock(&ar->conf_mutex); } } -- 2.35.1