From patchwork Mon Apr 27 13:44:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sathishkumar Muruganandam X-Patchwork-Id: 11512183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A2C315E6 for ; Mon, 27 Apr 2020 13:45:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBF3B20656 for ; Mon, 27 Apr 2020 13:45:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ftnZSSBo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="nSWFg5Pr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBF3B20656 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uU2V+I4mEbBCImY3xz35T4fTCbWaLayt6W37LfxAk7I=; b=ftnZSSBooCveSJ2C2jM/vdO7FL 6U/gBIToXZX+DMYFKDjjosb89eDm/KLzTO0JSYPMRtmGNjKUreqQP4EYd+y0QDAH4aD7vomCWZ8W/ q4H3SvCkHk6oTa7r571XY3oJdnOuQLjkloQuTa9j8VbMrA9ANDzZbO8C8kCj+w77R6gTuA7ugVPAK S52p7om3BCC9pC/CXgvBa4GKeTQQBzHk6s+nGqFiNBcHSqZ6ckNGVa+SdpPOVVwqZ/jncgbFYr1D2 pDconaEDaH3/ltWVBlG/mKQnO4eQneAPzAO9PBj81QyVPxjlC4w1j7nfeM91VWkrO6wTHkU5JwcLE LxtSHJSg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT44e-0000Fg-UU; Mon, 27 Apr 2020 13:45:28 +0000 Received: from mail27.static.mailgun.info ([104.130.122.27]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT44a-0008Ak-C4 for ath11k@lists.infradead.org; Mon, 27 Apr 2020 13:45:27 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1587995126; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=7ICCT2+tbWtu868EIqFl223/Mq5QcoeFd0GbK4KNJUA=; b=nSWFg5PrHljAwHTVDBZcNYtpMLIEpR3HZx7cintJ06BX/1rjqOJ+BvwTlHKVgOF4+2AIpHOs Hpl06yv6Lo/pL3ab6U1aOsE9KigSsiaeVCjd5IJxQtUInzrsAkF+LDsKNGJgBCBly3B3U7yi clAMcttxfXdreFUVJbM37j9j6rw= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyJmOGQ2ZiIsICJhdGgxMWtAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5ea6e1eb.7fbb7e779f48-smtp-out-n04; Mon, 27 Apr 2020 13:45:15 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0FC46C433F2; Mon, 27 Apr 2020 13:45:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from murugana-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: murugana) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6E5F2C433CB; Mon, 27 Apr 2020 13:45:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6E5F2C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=murugana@codeaurora.org From: Sathishkumar Muruganandam To: ath11k@lists.infradead.org Subject: [PATCH v3 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev Date: Mon, 27 Apr 2020 19:14:54 +0530 Message-Id: <1587995095-7808-2-git-send-email-murugana@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587995095-7808-1-git-send-email-murugana@codeaurora.org> References: <1587995095-7808-1-git-send-email-murugana@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_064526_476472_290D0AF4 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [104.130.122.27 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sathishkumar Muruganandam , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org In Multi-AP VAP scenario with frequent interface up-down, there is a chance that ath11k_mgmt_over_wmi_tx_work() will dequeue a skb corresponding to currently deleted/stopped vdev. FW will assert on receiving mgmt_tx_wmi cmd for already deleted vdev. Hence adding validation checks for arvif present on the corresponding ar before sending mgmt_tx_wmi cmd. Signed-off-by: Sathishkumar Muruganandam --- drivers/net/wireless/ath/ath11k/mac.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 065b7d6d4ab2..2b3a63ac216c 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -3793,15 +3793,30 @@ static void ath11k_mgmt_over_wmi_tx_work(struct work_struct *work) while ((skb = skb_dequeue(&ar->wmi_mgmt_tx_queue)) != NULL) { info = IEEE80211_SKB_CB(skb); - arvif = ath11k_vif_to_arvif(info->control.vif); - - ret = ath11k_mac_mgmt_tx_wmi(ar, arvif, skb); - if (ret) { - ath11k_warn(ar->ab, "failed to transmit management frame %d\n", - ret); + if (!info->control.vif) { + ath11k_warn(ar->ab, "no vif found for mgmt frame, flags 0x%x\n", + info->control.flags); ieee80211_free_txskb(ar->hw, skb); + continue; + } + + arvif = ath11k_vif_to_arvif(info->control.vif); + if (ar->allocated_vdev_map & (1LL << arvif->vdev_id) && + arvif->is_started) { + 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", + arvif->vdev_id, ret); + ieee80211_free_txskb(ar->hw, skb); + } else { + atomic_inc(&ar->num_pending_mgmt_tx); + } } else { - atomic_inc(&ar->num_pending_mgmt_tx); + ath11k_warn(ar->ab, + "dropping mgmt frame for vdev %d, flags 0x%x is_started %d\n", + arvif->vdev_id, info->control.flags, + arvif->is_started); + ieee80211_free_txskb(ar->hw, skb); } } }