Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp399025ybj; Tue, 5 May 2020 00:19:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLnF6PEVH54xr29nPh32/dhb4kygjCPQCVpj5N4kHxNzean9YtHfOP/xsqnynUbbNmBR5vm X-Received: by 2002:a05:6402:2293:: with SMTP id cw19mr1336608edb.351.1588663189560; Tue, 05 May 2020 00:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588663189; cv=none; d=google.com; s=arc-20160816; b=xEqN4D4svf6clHX9jB5CFJ7ysVD966Jcwu0LOCaKiiDAERSkRKxiu/7WflGqql3myr AVqVf+Hh8QOG1DMfOrM7cVR/pqTJ+CpCQ67iZWSDPNb+AODighUlNnr2QZj0v74vjFcb pwjp5jldazTS+tdXbuS/ZzQ0xNPVoXpuOTBtjm/QeNaVIO+x5rQNbCSiYPRwW268YVF3 NbbwkybGY51QGdYdneK8eiLneTmKPK1sXhelnuQVOWyxlrTJwGVROmUSiyB1n4fivoRv AI3k8JSNjDJRuOaNLWubZuKm+5xL3mUcYNhUT287tYbMnp1wSsx98qYcJMiGB2LUydmd +E0Q== 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=FHvKSwOq7HDlR/x83tultcrCPZZOptkuScQLeJFruww=; b=q/PyCzVnB19Di/jCKNVLZQFvKLvXPzS453LGS5XHZEhnttqE/Bk2XKlPDKa6WpsAU0 FzWeg2yVeQ9n9t23whDt7pLURyDT5GzJQ+NCMMwOwhuv5zE8zO//KsiOjLa9awj4WDWd 6LIoMvsbuPud6D8eznglYWrLgtKsCPNSCInoiWnRnsIKPjc1VLQRtvNqvzzrCtKxUutl hAPn0DSWG9/zjJFPhDsIQFyyLOeX61D9GgLS1gVhLN4xQhEE1a9fgSPSIZGGNYOjzORu nuD8AZWTVAlhZ5N/4AxJxtYFlUiwgEWBpRo1hIYKKREzzUgb3wor8bIsOmPHtsR8xUYw 4f1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=dy8gI5Mm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si589945ejo.283.2020.05.05.00.19.20; Tue, 05 May 2020 00:19:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=dy8gI5Mm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbgEEHSL (ORCPT + 99 others); Tue, 5 May 2020 03:18:11 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:53627 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbgEEHSI (ORCPT ); Tue, 5 May 2020 03:18:08 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588663088; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=FHvKSwOq7HDlR/x83tultcrCPZZOptkuScQLeJFruww=; b=dy8gI5MmD7QIhHZJxCSC3F+8JL7jA+HJKZMJ7gPAByILctaJYFbiglWXXyiuuULdhLcVXGU9 0xFJfqs6REo9BrGT5QgRyPRTgb/Hd6ENb4dMTHv2tGiRD0lUFBYLXqUt7rS2IpTMpxopWHAs h+7Qncml/NbJYnLU7dei36ovCxA= X-Mailgun-Sending-Ip: 104.130.122.26 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 5eb11321.7fdbc0f4c6f8-smtp-out-n03; Tue, 05 May 2020 07:17:53 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 83413C433F2; Tue, 5 May 2020 07:17:53 +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 pillair-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: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id 19569C433D2; Tue, 5 May 2020 07:17:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 19569C433D2 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=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Rakesh Pillai Subject: [PATCH] ath10k: Skip handling del_server during driver exit Date: Tue, 5 May 2020 12:47:41 +0530 Message-Id: <1588663061-12138-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The qmi infrastructure sends the client a del_server event when the client releases its qmi handle. This is not the msg indicating the actual qmi server exiting. In such cases the del_server msg should not be processed, since the wifi firmware does not reset its qmi state. Hence skip the processing of del_server event when the driver is unloading. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/qmi.c | 13 ++++++++++++- drivers/net/wireless/ath/ath10k/qmi.h | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 85dce43..7abdef8 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -961,7 +961,16 @@ static void ath10k_qmi_del_server(struct qmi_handle *qmi_hdl, container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); qmi->fw_ready = false; - ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_EXIT, NULL); + + /* + * The del_server event is to be processed only if coming from + * the qmi server. The qmi infrastructure sends del_server, when + * any client releases the qmi handle. In this case do not process + * this del_server event. + */ + if (qmi->state == ATH10K_QMI_STATE_INIT_DONE) + ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_EXIT, + NULL); } static struct qmi_ops ath10k_qmi_ops = { @@ -1091,6 +1100,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size) if (ret) goto err_qmi_lookup; + qmi->state = ATH10K_QMI_STATE_INIT_DONE; return 0; err_qmi_lookup: @@ -1109,6 +1119,7 @@ int ath10k_qmi_deinit(struct ath10k *ar) struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); struct ath10k_qmi *qmi = ar_snoc->qmi; + qmi->state = ATH10K_QMI_STATE_DEINIT; qmi_handle_release(&qmi->qmi_hdl); cancel_work_sync(&qmi->event_work); destroy_workqueue(qmi->event_wq); diff --git a/drivers/net/wireless/ath/ath10k/qmi.h b/drivers/net/wireless/ath/ath10k/qmi.h index dc25737..b597205 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.h +++ b/drivers/net/wireless/ath/ath10k/qmi.h @@ -83,6 +83,11 @@ struct ath10k_qmi_driver_event { void *data; }; +enum ath10k_qmi_state { + ATH10K_QMI_STATE_INIT_DONE, + ATH10K_QMI_STATE_DEINIT, +}; + struct ath10k_qmi { struct ath10k *ar; struct qmi_handle qmi_hdl; @@ -105,6 +110,7 @@ struct ath10k_qmi { char fw_build_timestamp[MAX_TIMESTAMP_LEN + 1]; struct ath10k_qmi_cal_data cal_data[MAX_NUM_CAL_V01]; bool msa_fixed_perm; + enum ath10k_qmi_state state; }; int ath10k_qmi_wlan_enable(struct ath10k *ar, -- 2.7.4