Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp787811ybb; Fri, 10 Apr 2020 10:06:28 -0700 (PDT) X-Google-Smtp-Source: APiQypK8wxC3hD2M73t0YUdEhj2q9eb9QyWG2K7vgzr3mA9HLkrP4GlcgRrotQdSGhvVUQ+BY7GO X-Received: by 2002:ae9:f802:: with SMTP id x2mr5171784qkh.144.1586538388830; Fri, 10 Apr 2020 10:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586538388; cv=none; d=google.com; s=arc-20160816; b=Yz5SxPAuPVTbqVWMlwdFHi127jBCtD0fCpdQKroMOWY5rtTC8RP+LgXXEl8IuwwI6E eb+wHFnPMQ7M7LTF83+Fabg2ReqUsCvBwLOXZq9cCNdqupGMIThbQIMVb0V89oAZI3+T 28b+asS6+Yerc3KRYfMdihGVgVOGAzlpfG/rPEcnm0etu18aN6HW44WGp7HpEWF1kOrK P1Qkae3GvTPvNtp+5EPxQKQfWlanNEMRvMc1UC51/QT30nNsMFkvBqZR+TGkqaDs0bjx 8d1dthO6uYQmpG96MIVXqrLJbxturs0Izb9cMPU3Vhaa3BxsuuG4ii8jhkpF8BwaDpiq VK/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=Kv7myonseSRBAS2TYbse5+s5rqqp2VnQhWcDuHD0LYw=; b=JLYehsF4feH4UZAN/mc7g761Zqu5eteeTTD9tFehuYvVes6oR473JlTjVVQviOIq1B jPdXn18mPEFRRdIK/5uSIFsv5TbvhfsiSuw2tGOlnBo8OGOwDrUa38gRBpqg/QlNZVIB vM5zqB35rfJ208PkwMMFHE5mezeGJpeaSsB3jAamIqzgwmrANzjaH/8CXCM6U5WOUGvz B+04mz83YTjY+UCiuCDFmVjiIGGCoNW0n7WkLkVnEtGUTyiNsh+b7CsEtanzh/7mZ5l6 ouu9hbxSoHeZzo7uZ9RLyAS9afOdKWsxDFZhXVomhIMsIuUu+8y9pZGhQqY6AouJvWxp WwlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=r8mq23Ib; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si1346763qvn.1.2020.04.10.10.06.14; Fri, 10 Apr 2020 10:06:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=r8mq23Ib; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbgDJRFm (ORCPT + 99 others); Fri, 10 Apr 2020 13:05:42 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:47827 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgDJRFm (ORCPT ); Fri, 10 Apr 2020 13:05:42 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586538342; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=Kv7myonseSRBAS2TYbse5+s5rqqp2VnQhWcDuHD0LYw=; b=r8mq23Iblxz/nLklqy5shbkLXV4uRyWIiEgL/BTv/K16MuIhPPqqprjmMGc5Ra+jC3q/iEEy m8aHoRi5WGJpvIfG4Vh8qB4fDa/UjbN7yNm3s3scKk1TgA36vXwHsEdB+KjsW6Ensydf9mcB gD/P63PhW08CTDw7+kmu5BjGzn8= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= 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 5e90a753.7f5456de4298-smtp-out-n05; Fri, 10 Apr 2020 17:05:23 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2A79FC432C2; Fri, 10 Apr 2020 17:05:23 +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 che-swdbs-01.qca.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mkenna) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7A143C433BA; Fri, 10 Apr 2020 17:05:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7A143C433BA 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=mkenna@codeaurora.org From: Maharaja Kennadyrajan To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Maharaja Kennadyrajan Subject: [PATCH] ath11k: Cleanup in pdev destroy and mac register during crash on recovery Date: Fri, 10 Apr 2020 22:36:43 +0530 Message-Id: <1586538405-16226-1-git-send-email-mkenna@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Debugfs pdev entries should be cleaned up during the crash on recovery. If not, mac register will fail for the reason that it is already registered during core reconfigure. Signed-off-by: Maharaja Kennadyrajan --- drivers/net/wireless/ath/ath11k/debug.c | 3 +++ drivers/net/wireless/ath/ath11k/mac.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c index 8d48517..825e7ba6 100644 --- a/drivers/net/wireless/ath/ath11k/debug.c +++ b/drivers/net/wireless/ath/ath11k/debug.c @@ -803,6 +803,9 @@ static ssize_t ath11k_debug_dump_soc_rx_stats(struct file *file, int ath11k_debug_pdev_create(struct ath11k_base *ab) { + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + return 0; + ab->debugfs_soc = debugfs_create_dir(ab->hw_params.name, ab->debugfs_ath11k); if (IS_ERR_OR_NULL(ab->debugfs_soc)) { diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 9f8bc19..4783394 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5891,6 +5891,9 @@ int ath11k_mac_register(struct ath11k_base *ab) int i; int ret; + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + return 0; + for (i = 0; i < ab->num_radios; i++) { pdev = &ab->pdevs[i]; ar = pdev->ar; -- 1.9.1