Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp592384ybt; Fri, 19 Jun 2020 08:54:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn1v7k+QLKpz2qfslU19sRWisftQJ4VKlWpx7AnfcxYeJGKYe67HiEB7kMM/SAYmsI/TT7 X-Received: by 2002:aa7:c609:: with SMTP id h9mr3826570edq.155.1592582073964; Fri, 19 Jun 2020 08:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592582073; cv=none; d=google.com; s=arc-20160816; b=U5d17KOQA7tiaH7hDMzp+fXv9unG+ARzUSc8wDq1i2GgPICy/r/UvbmtUAPN0GuwLM OtthwD78KB7Klt7Eso5BbVz8FGBiH8ZQGG0r2im9YMle4QbbG7M2+/8NMBkehIUwRJlF MuGqB9QVCqhptetvn0qAu/lQIQLA/wpGMaxHGXtiHwu87zXMJpOZ9/VC8bVYBh6ppDWk KuS9vhzx5HcXf1J9cGrtFNH3w5WPFRgaXDgTWKa572nMf90vv6Z6ZORqzRHPn+4IU4B5 Cr7PNGTW5dwGD8lNPVwuOTI07YYhO8BZ+DIZFAN7XvNZPe7rXNYp87+MaT7Gg4nEaAmZ tqMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2FSpzPBBNGt8OJ+/1hUX1n+pacGefvJzoNZVyVYnCPA=; b=p5sh35tmQwvp9EDQxSM/4t94J8JwzNt2hmlTksRpES8bqNagV9t6KSFBTbqGnkDKQG NlLVvWSUDMpVTwpbb3622uuvufD45MMon/YclRlgOeEIuUqIN+NlrGR30EJ3RH+npBGY 4F1ZufIMWrymlvrmslBR8mDMUvZhTdLu14y+vA1opojYsuqLXZpDrQ/KOuDft/XZssce RarPbsmSunkaOPsfB4iwNAY6bnLpJ2omJ+NsDZiRKKd8bhU8gxrghN1QNAvhybUEiHj9 eVa7F3K2yZd3SeCLrMzpDh/76Wk6RqvPoJb9bZhW0lKopYG1W3vZjBTYkjrGN390PLD+ /6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fiBuOxjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 y26si4068270ejw.566.2020.06.19.08.54.11; Fri, 19 Jun 2020 08:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fiBuOxjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404695AbgFSPvl (ORCPT + 99 others); Fri, 19 Jun 2020 11:51:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:55570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392683AbgFSPX6 (ORCPT ); Fri, 19 Jun 2020 11:23:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 80616217A0; Fri, 19 Jun 2020 15:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580237; bh=3fRy+M5MKsobW1DMkCE6aT8AuhzEA6KfX/ybdilXmPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiBuOxjwWI78AmHtQDiOy/8ukzkEOVN5BvI9bjCUdYiLkXppQI1A/2DEQaXDBa2GL 5KuCSMCFVbxNyjK3nCJap7Ufq58+l/ktusGUotFaZcFG7hC/Upi6W5MBcLE7jHdUB/ 66Ms6TdnShvfX8oO4uNbyyncxEDAf83oknTOl1uA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rakesh Pillai , Kalle Valo , Sasha Levin Subject: [PATCH 5.7 173/376] ath10k: Skip handling del_server during driver exit Date: Fri, 19 Jun 2020 16:31:31 +0200 Message-Id: <20200619141718.519617653@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rakesh Pillai [ Upstream commit 7c6d67b136ceb0aebc7a3153b300e925ed915daf ] 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 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1588663061-12138-1-git-send-email-pillair@codeaurora.org Signed-off-by: Sasha Levin --- 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 85dce43c5439..7abdef8d6b9b 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 dc257375f161..b59720524224 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.25.1