From patchwork Thu Aug 8 13:05:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan periyasamy X-Patchwork-Id: 11084135 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 860F014DB for ; Thu, 8 Aug 2019 13:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71EFA288F6 for ; Thu, 8 Aug 2019 13:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 662C5289AD; Thu, 8 Aug 2019 13:06:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E59F7288F6 for ; Thu, 8 Aug 2019 13:06:03 +0000 (UTC) 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: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:In-Reply-To: References:List-Owner; bh=qCo/BHD5IAgHGFHg4EzhluQAFKAXar2HnfL6BVR4G7M=; b=Qwb DHAeFkYrhCFUToeYenaevES2QIHjwwpah1f61oCa/x7WQWP/2ZdJcVSpHtEscG9GW25uWlY4UyGFc 0vEPiDK5Jws5a4RYvqSZ4WVUOiD7ztHg7OXtJ30+Zy3mJY9+c9inI98BVRDAsX+RcO2DP5SHQBndO sP1K2GdqE5/DJo7LikmFfrLIEmgJT0zfCRyL+5fG1j6pQj6TrNEfYFAxW65en+9OSgu4pBkTkTSEv LtZrFhfjudDF75ATdlur3yaZu0UjV+aPFWb+OcX0zx69pXWLrrCU/9BL98grUs8xJUMlWjKbQTtXg LGvmCpb5h1SI1aN8RnhEssHoIc9Rvng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvi7G-0001dJ-E5; Thu, 08 Aug 2019 13:06:02 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvi7D-0001ci-Ta for ath11k@lists.infradead.org; Thu, 08 Aug 2019 13:06:01 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4308D60E41; Thu, 8 Aug 2019 13:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269559; bh=TgwoOcKDX1Rx/1691i0Gz0Bd73PUhCfurZf4106t6D8=; h=From:To:Cc:Subject:Date:From; b=GKj9JyG4sX3Ke0xUf8rEaptNbeRxP+uWgaGW+/WrmsHQCMkjLIQnnjImtLjNgNr/R MR3Z8ucIAHMJWMQNwwkHPOt5CoBkMZuHoNoXhp5JXzcJGWUmqw94JAQUfEEuGUXtqH wkRAGxPR92zh7VD/pD8pVeXWMbKFPQdFVX+yFpWg= Received: from CHECSTP284781-LIN.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: periyasa@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 553A460770; Thu, 8 Aug 2019 13:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269558; bh=TgwoOcKDX1Rx/1691i0Gz0Bd73PUhCfurZf4106t6D8=; h=From:To:Cc:Subject:Date:From; b=CVlt1t6N/AdS3qIqlo5ud2Ip71l9QBq8FkPe/U0ph3JZTH5NZydEY2lOhmhFVwsf8 H8r/MtsuCdvSk7fiqcTA+JK3+zLUdpvnBkgsseYA+4ryH1InODXblEXOIg3X4fJJlB EZ2b+Jwhcn8KSwwN/eLBKlZnnx7DFKzHwKOjOal8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 553A460770 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=periyasa@codeaurora.org From: Karthikeyan Periyasamy To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: Remove mac_registered variable Date: Thu, 8 Aug 2019 18:35:11 +0530 Message-Id: <1565269511-27056-1-git-send-email-periyasa@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_060600_002005_53BAA429 X-CRM114-Status: GOOD ( 13.39 ) 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: Karthikeyan Periyasamy MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP mac_registered is used as a check to avoid the mac register functionality in recovery flow. It can be achieved by check the dev flags. so removed the mac_registered variable. Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath11k/core.h | 1 - drivers/net/wireless/ath/ath11k/mac.c | 14 +------------- drivers/net/wireless/ath/ath11k/wmi.c | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 79134c4..a0d6832 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -594,7 +594,6 @@ struct ath11k_base { struct ath11k_ce ce; struct timer_list rx_replenish_retry; struct ath11k_hal hal; - bool mac_registered; /* To synchronize core_start/core_stop */ struct mutex core_lock; /* Protects data like peers */ diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 8ffdf59..5ecb74a 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -360,9 +360,6 @@ struct ath11k_vif *ath11k_mac_get_arvif_by_vdev_id(struct ath11k_base *ab, struct ath11k_pdev *pdev; struct ath11k_vif *arvif; - if (!ab->mac_registered) - return NULL; - for (i = 0; i < ab->num_radios; i++) { pdev = rcu_dereference(ab->pdevs_active[i]); if (pdev && pdev->ar) { @@ -381,9 +378,6 @@ struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base *ab, u32 vdev_id) struct ath11k_pdev *pdev; struct ath11k_vif *arvif; - if (!ab->mac_registered) - return NULL; - for (i = 0; i < ab->num_radios; i++) { pdev = rcu_dereference(ab->pdevs_active[i]); if (pdev && pdev->ar) { @@ -401,9 +395,6 @@ struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id) int i; struct ath11k_pdev *pdev; - if (!ab->mac_registered) - return NULL; - if (WARN_ON(pdev_id > ab->num_radios)) return NULL; @@ -5373,7 +5364,6 @@ void ath11k_mac_unregister(struct ath11k_base *ab) SET_IEEE80211_DEV(ar->hw, NULL); } - ab->mac_registered = false; } int ath11k_mac_create(struct ath11k_base *ab) @@ -5384,7 +5374,7 @@ int ath11k_mac_create(struct ath11k_base *ab) int ret; int i; - if (ab->mac_registered) + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) return 0; for (i = 0; i < ab->num_radios; i++) { @@ -5455,8 +5445,6 @@ int ath11k_mac_create(struct ath11k_base *ab) ab->cc_freq_hz = IPQ8074_CC_FREQ_HERTZ; ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1; - ab->mac_registered = true; - return 0; err_destroy_mac: diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index e7a74e0..a9e2d3c 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -4398,7 +4398,7 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *sk } spin_lock(&ab->base_lock); - if (ab->mac_registered) { + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { /* Once mac is registered, ar is valid and all CC events from * fw is considered to be received due to user requests * currently.