Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp623541lqh; Fri, 31 May 2024 11:04:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4YHWttETPlCUdlu/ozvqsqQ9OSiIxNS0vf6a8z7XEQqabMeezjr1EVqR6oGcJzAWuJjSC7e9AHou2X84k5Uj9p1LIjg64zIqWRW4ymg== X-Google-Smtp-Source: AGHT+IFSeFcI01mzXeV967TfFDcnAmKKTF+lMwOD4jxL3oCy98euGOuJOJl1zEKXPo6JEPDsUH6r X-Received: by 2002:a05:6512:4898:b0:52b:4f30:9cac with SMTP id 2adb3069b0e04-52b896cd347mr1684388e87.56.1717178683162; Fri, 31 May 2024 11:04:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717178683; cv=pass; d=google.com; s=arc-20160816; b=tzrL48VivclEM8/9M/IUusmWRzkUbGiuR10S/5ZvNUiVWf+XRHFR+oLsA5oBtk4QQL eziQ10WCThMZNzBW/JpXdH/BGjkJveysdr7luQUqlmiAZfuY9SH4KC4xt3pcPVa80V1g 3euQKEZWwamyhkVt7BoyBtfZDRqycTdnC0ROYD9y7n+amwAP7EvbpV/wlR7aiqzYyCFI GR/Oie02mNCUhRHPUwUn89Msyd8d2aym4dhrzMLMr6dZilzZ0pyueYFBBZfIH+b3xNFp IURxXcJ4GS/wLoIqjp4RU+VVT45FzoJILROC4EJs5Lgj1UtUJ4x0s7zh/IW/8UPKiUPl DIgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=B7MMRbCqOgGeJzxv+gPxvkGOZqM3j6DoSUBeP22zQcg=; fh=gjyKuI8lXSKwquXF/tvFPrzHVVLmD81gAC9iylGd+k0=; b=liDRmYMY8yf4ePp5YHQ2JseJXcJ0Wb1CCt6aKgZKpKIgVTLz08ejSKfouI9KY1oixb EELvFZRMscK4ykB0dwFW7veQyvuZFiw7nQYfY/ilKUoCTcJzEX9QyZFAeFAFEkItNeRS dqBmECSD90PkKIOlcHg1n2FvsT+NL6LB6I7egsfu2zd/S5DjxzGHFUNM23FCAWYKBCJm XDj/yejuiUHekCCYxjp1rCl475GBZ11zy+Q0Te+QyvlqQiw27X/UROP2aqpr5gGsdv6G VLoAd+oXmRdHzYMS1HqJwq0WY8O4dWkG7C2fPwnwLrK30VkjqabZcFIYSkYgMPL7QTIY mQeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=D2F6Aw0F; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31cb3f8esi1132012a12.609.2024.05.31.11.04.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 11:04:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=D2F6Aw0F; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8355-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 657D11F25E25 for ; Fri, 31 May 2024 18:04:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0985717CA08; Fri, 31 May 2024 18:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="D2F6Aw0F" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B6BA158A00 for ; Fri, 31 May 2024 18:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717178672; cv=none; b=H9ol/LyvJpM3HKXoKH6Ryy409CD7X//fL33umOE6yMyb3jHElJjqhDunxdzY/sJbw6VoeLiIsz3/92T1eRXvjIqz+EbetT/lk9ikZpnijcCUknPEkjDjbpoqH8bkQak91tL2HYfd1cKgEXOqE0m5KVnhKtqHVK6vZ2R+BQfghUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717178672; c=relaxed/simple; bh=Ry2ztlie/YMjQ/HL+oL3XEibQAsQ/lXar9M3OOQSEmM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ioEs6fKj7f2/CfZEaHlYLqgROTRt32YHD/NFTz8OoUzL1PzdwH/3P3nScDvm8tJc8iRGBKts8jq1qYvae6+vd6xIYvrYy/hMTSqFUCwpJn3B88uuj0fXS17QdvuJgCAxyMmKjUeICtUoeznxgnc2B9leURGz5FuoqPZ0N0aWovI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=D2F6Aw0F; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44V9phei002576; Fri, 31 May 2024 18:04:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=B7MMRbCqOgG eJzxv+gPxvkGOZqM3j6DoSUBeP22zQcg=; b=D2F6Aw0FYAVV0SHArhGw9Q0Vob0 1eGhKol+q39VcjCllYO3RZesyOUSjquLBgygcSyvyXhJNpk+Myi7YLJHPT/JeWI5 GP+n1cAtx2Hmo2ZEhfyY/+3/v+jDSMSCIh7+NsMXgmgHUwMB6H71eoczXji4ZjyF EYY1AHe346zfvJyCEokSyfBQzl8C2TQn/zDLzhfQmmm331Xa1XCCwWwlLDK7ShsK SrxKxvcM7m7RsdOx2ztjq8KYZ7i9f1nIuIxemEEwr1tobiFc1JFXeBoTZ/ZzoyQN wjAjVGEVCp0pGuYreRw/Wepv2hcHtXLffbS+6EOCaLSP6jPIGsXIk7Ji4sA== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yfc9nhbxs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 May 2024 18:04:20 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44VI4Gp1012042; Fri, 31 May 2024 18:04:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3yf34nn90h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 May 2024 18:04:17 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44VI4H12012068; Fri, 31 May 2024 18:04:17 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-hprem-blr.qualcomm.com [10.190.108.75]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 44VI4Hdi012066 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 May 2024 18:04:17 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 4146166) id 7BBBE41137; Fri, 31 May 2024 23:34:16 +0530 (+0530) From: Harshitha Prem To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Periyasamy , Harshitha Prem , Jeff Johnson Subject: [PATCH v8 4/8] wifi: ath12k: Introduce QMI firmware ready flag Date: Fri, 31 May 2024 23:34:07 +0530 Message-Id: <20240531180411.1149605-5-quic_hprem@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531180411.1149605-1-quic_hprem@quicinc.com> References: <20240531180411.1149605-1-quic_hprem@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: -Kh774ZhDqfbA3-s_avEvoV1vhiQFP22 X-Proofpoint-GUID: -Kh774ZhDqfbA3-s_avEvoV1vhiQFP22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-31_12,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 impostorscore=0 bulkscore=0 malwarescore=0 clxscore=1015 spamscore=0 priorityscore=1501 mlxlogscore=903 suspectscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405310137 From: Karthikeyan Periyasamy When hardware device group abstraction is introduced, QMI firmware ready event of different devices in a group can be received simultaneously. To indicate firmware ready event is completed for a particular device in a group set a flag (ATH12K_FLAG_QMI_FW_READY_COMPLETE). This would be helpful when hardware recovery is introduced for hardware device group abstraction. Add changes to set/unset ATH12K_FLAG_QMI_FW_READY_COMPLETE flag for a device. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Harshitha Prem Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/core.h | 1 + drivers/net/wireless/ath/ath12k/qmi.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index a22f3561deb0..bc2a9e1b1885 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -208,6 +208,7 @@ enum ath12k_dev_flags { ATH12K_FLAG_HTC_SUSPEND_COMPLETE, ATH12K_FLAG_CE_IRQ_ENABLED, ATH12K_FLAG_EXT_IRQ_ENABLED, + ATH12K_FLAG_QMI_FW_READY_COMPLETE, }; struct ath12k_tx_conf { diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index b93ce9f87f61..23cd21a3fa97 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -3023,6 +3023,8 @@ void ath12k_qmi_firmware_stop(struct ath12k_base *ab) { int ret; + clear_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, &ab->dev_flags); + ret = ath12k_qmi_wlanfw_mode_send(ab, ATH12K_FIRMWARE_MODE_OFF); if (ret < 0) { ath12k_warn(ab, "qmi failed to send wlan mode off\n"); @@ -3320,7 +3322,7 @@ static void ath12k_qmi_driver_event_work(struct work_struct *work) break; case ATH12K_QMI_EVENT_FW_READY: clear_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags); - if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) { + if (test_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, &ab->dev_flags)) { if (ab->is_reset) ath12k_hal_dump_srng_stats(ab); queue_work(ab->workqueue, &ab->restart_work); @@ -3330,8 +3332,12 @@ static void ath12k_qmi_driver_event_work(struct work_struct *work) clear_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags); clear_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags); - ath12k_core_qmi_firmware_ready(ab); - set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags); + ret = ath12k_core_qmi_firmware_ready(ab); + if (!ret) { + set_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, + &ab->dev_flags); + set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags); + } break; default: -- 2.34.1