Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp893498lqd; Wed, 24 Apr 2024 22:58:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/ZzHPkxCGvd3vdctEQsCywWuGn9MEXk6plXfNaG0EnT81JGVofbG5gpFc/oRzn4cbB8PG/jCgsVUZtfWd0oivuHlQnZ8rgAoBGKSlQA== X-Google-Smtp-Source: AGHT+IFJj+jJ2sxfPzJgzSZkP9zCRyKlqCkiGieGWdqkM4iKAeY3tHP7vzaZf09pU0cBgP9sbYlE X-Received: by 2002:a05:622a:1182:b0:431:9bea:82ab with SMTP id m2-20020a05622a118200b004319bea82abmr4781008qtk.35.1714024706319; Wed, 24 Apr 2024 22:58:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714024706; cv=pass; d=google.com; s=arc-20160816; b=dSkAr8Hum2lHfWKqNw5zXTI70jrASMok3JW1YwSRcU2iV+yiNEtpru7VszJsHNIB7L XjACh3HWCdQhxh+mFiw+fqqEmvEfXHBjIhEi9E09Nm1ndK4+GKXE8EXkjI7UL0deH/f7 0qsx1935l4jZghTnaMeviZ6ps1wz46mhR4l/nSde3KtHKjEVELUdqSEtRTu1crUw+ihm gcUIW1f918yvAIYUkyAR4+3GqvmsnHD/yxeXnfQkkoAjLfTtAiDqpuj1+bCH4bxEcAwt DLqm2mjvCYXWCWPDHOzBoDUxwDcCiMapfSLzYqATk1mm6Ek6bL89XRV/t9AeGaX8HeD9 8B+w== 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=T6cnWBbpLkEEzq+wVTTMeblSACLWaaWwGLhf7dvp/lE=; fh=wnySVr9+WO9j7lO1L6CVbSw/CjEiK6R10EUaKUiDPbE=; b=ypr+nc/NyYlG2Q429Vn/oMUq45sfT7zcflnFgramjB7S9nDL5PYCbSZiglQ7jK1W0D GlBsFlGK+PpBdfoS3j4j2LHU8Q0h8FKDK34NVhi2bkja4h9Nd2iMgNKQTjWuz/yucIgN S2yCYJ1tBvKXYfmKeTgzIGwiCS893yIteAujRJVcnhfXMStk6cO7u1n6eBGOzxyQrWsV yuakdBRke93dLsDFCYgB1LitI85ly9VlVfe0u1uPQUSKnZ8sauDRRaw9xhCgaLfjv7F3 mneMhQShYSbofbXWjaG9YVt2+WFxv/4K/udwmIiDVYwuagPvn/lkHLtcYT+kjRld6yc4 k9Cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=I9FPmhny; 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-6808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d16-20020a05622a05d000b004375eb96130si17623152qtb.201.2024.04.24.22.58.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 22:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=I9FPmhny; 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-6808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6808-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 034171C215EB for ; Thu, 25 Apr 2024 05:58:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EDC33D0D1; Thu, 25 Apr 2024 05:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="I9FPmhny" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 7A1693C082 for ; Thu, 25 Apr 2024 05:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714024695; cv=none; b=WacN6l5u+YC9IdtNLK8rg8mt1SXHo41YwgpRinwUdMAk/hahlm0eyEldqQBUOAG8u7Bw0oEJFMOpe0s/41MTXVoDV/miUfHzRDW/SpooyftHDEASQMnz9h8AnyQmPNntXkOKVD0fjs3WQJwYqLyk2J1DE13OOnp9QxRD7ss4HSE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714024695; c=relaxed/simple; bh=jXXrbO6CgtwXAkjXCNq73Lt35nxgb0bBtKYVyMilBCs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qKk8l3cboOt49YZ3gH8umVlz1UQ/vbxOg2MriXw/oq1UBgBgxHJCkI3kWIjv+fHWMgotTPbkqTuk7PIB+1htrLJrrFmg8teC6V8LhsqdiJb84yKO48i2Jg+BDxymI6OcDaYpzASfs/x14f6w5JmVVqIsd9oEJaxAj6JXWPCWwZE= 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=I9FPmhny; arc=none smtp.client-ip=205.220.168.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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43P2iT19002361; Thu, 25 Apr 2024 05:58:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=qcppdkim1; bh=T6cnWBb pLkEEzq+wVTTMeblSACLWaaWwGLhf7dvp/lE=; b=I9FPmhnyU7C0JJDk8b23rTP CKT548VN2RZu60apCaqKn/JG/sodwYHHGL1aaIxjk+N+wCgUjFG8I2ygcL1mcz+E YB0aLoIY7VmkdWGTCff950SvIcgOi8EaGmR0tcMMNsd40fQe15WEbd5GpkK4XWS4 4KNzRLPhZoKmgcozp/FPuVSBhRsLkdxgtGRe1cQPiNEsLo+GqCTt8px3HYpv9azQ amt3Co2vx0cnU7P3DgHcKlgHPJWoZPzJ1QFwJG714feyQanFGC6c/8jpVFTFhMUm hrGL2VDL0nO4GmeFzHQg7pBHJfae7sqU0CAj12YHT/PL+QVB2qBKfjEaBYWKubQ= = 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 3xqenggcr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 05:58:10 +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 43P5w6r2031696; Thu, 25 Apr 2024 05:58:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3xm6smbfp2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 05:58:06 +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 43P5w6XF031690; Thu, 25 Apr 2024 05:58:06 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 43P5w6FF031688 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 05:58:06 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 4146166) id 0472A4114F; Thu, 25 Apr 2024 11:28:06 +0530 (+0530) From: Harshitha Prem To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Periyasamy , Harshitha Prem Subject: [PATCH v2 4/8] wifi: ath12k: Introduce QMI firmware ready flag Date: Thu, 25 Apr 2024 11:27:55 +0530 Message-Id: <20240425055759.1181165-5-quic_hprem@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425055759.1181165-1-quic_hprem@quicinc.com> References: <20240425055759.1181165-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-GUID: 1DUm4s4DT8uvRPR1o2p-6ocJcRpJZoBD X-Proofpoint-ORIG-GUID: 1DUm4s4DT8uvRPR1o2p-6ocJcRpJZoBD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-25_04,2024-04-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 mlxlogscore=816 phishscore=0 malwarescore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404250041 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 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Harshitha Prem --- 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 db6124c8f660..58230aecb7b9 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -210,6 +210,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, }; enum ath12k_monitor_flags { diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index ebb20fc8e3ba..7a1e4eb0370e 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -3017,6 +3017,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"); @@ -3314,7 +3316,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); @@ -3324,8 +3326,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