Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp231898lqp; Wed, 22 May 2024 02:55:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoF8uba4vzys69gYfEubB+LznpRS86PVRzOg7SLyOJyaJ9kLAiaN9mTkNroqqEWiuDbn+CNNqCq8h3G3INstCLHDF5RA3pmmTjURGgNA== X-Google-Smtp-Source: AGHT+IHcaqLbSfCrdBN8TjMTrMILkA8J4K4SwX+VlPkpc30OD1JbiZ6X7Qy7SE56MUk7kxdw2+nA X-Received: by 2002:a05:6359:672f:b0:186:2ac7:316c with SMTP id e5c5f4694b2df-19792037bd8mr111452755d.20.1716371732886; Wed, 22 May 2024 02:55:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716371732; cv=pass; d=google.com; s=arc-20160816; b=AsZUe+7FH/6d1foB+9yZ5sHRZ4kOkk3EqdWIl0gpBFVCsD5nnc5dgxsG4JYXK1SgXx 3ja2F+c4KikSr01to4Y6Ca6BTIx2CXcngCssuM35CWrivoWGjJTPnH18R40Zz8yUWbiM 0ESPPFZfnUF01CDg//qLn2oH5Z8fa6Pp5QWEJHpVUggaMj4zYabd5WGCpm2hRaxv8NLz Z55LjDlXq1fkR3mAxjTe1cNLyXWsqsRhHvxwqg1591Rbg/avjWz1lwSWY999S9MLzMts va/i7sTmWhSiyiuTEn9UjhW3q22bof4t5CmKnzBmoyXZcQt0y0b2FMixTshU82Sw7Ojf lQdA== 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=oRG1vZHhL6MemXix6GK9KFZsHBV6u+6OcmvB1zTdbH0=; fh=gjyKuI8lXSKwquXF/tvFPrzHVVLmD81gAC9iylGd+k0=; b=O2+0KEvXrb50aeFOdKpBSJt5a0AhikMgMKICdGL13+1YfjBsrZ8+X1OqN34+jyDCj5 jVCTM5w6wnVVVeGuwdBCpSUsGmxAe2ceUGjPx1mXrKl2CZta7doWvJ5x6ZnVzKj6HZKz Z/lIKDvyUDk21je+neqF0YUxFX/KD+yDXX5xAdG5jQKiL3QNKUcsjQDQFBn4Tkm8BjVj vjpblLai0dvWS0h6Bifdwsi/In1FqcRZ2fBQ8UyYLes55v+/8k4iMMkBe68+9+niIHmK /N9nGMVL5DOrYrIsjJX/QRrf/XqMd3kpfVgF15aycC5IDm3HQxgR5XU0MRRBAesi9YMF mAyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=igpbat+J; 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-7949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7949-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f7353si5274783a12.350.2024.05.22.02.55.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 02:55:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=igpbat+J; 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-7949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7949-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 366A028178F for ; Wed, 22 May 2024 09:55:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCAB77F460; Wed, 22 May 2024 09:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="igpbat+J" 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 6112281726 for ; Wed, 22 May 2024 09:55:22 +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=1716371723; cv=none; b=Rq3xp95X0NXWM7qrdTpcQ90d15wFTeotL2ZaVeUcrldFpV1Nllks7yYDXezVTUMjdieDvmTLaQYjrMZWkqLxVVKrEp8ZyCMy5tHNRCR5TTQUsgjY0JiplaZsyJD+Q8qgIvwEIB94eWmiC5VUREI7wBQ2G0q5JkZH4ojeDReoOiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716371723; c=relaxed/simple; bh=dwkthOA7GWS4R8gzE42HqNlpALzQ09xMHfIGVIahTSA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iZMkytHC+UExIJB65MrCyJQW4ndEOFmeeEmtnp/YAPDU3tRZGVmgHGNp2vj14dUHt6RPD1V/od9CiQ5TLcbqIUhbefMTcfCE3oOZpTdiTEf5zKvEXk+bGnw0VgEj0u11NU5SE/BJr/TMHKVfwGcIL76XzZVRrV77Bp21tEfSlnQ= 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=igpbat+J; 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 (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44M5a7ka025366; Wed, 22 May 2024 09:55:20 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=oRG1vZH hL6MemXix6GK9KFZsHBV6u+6OcmvB1zTdbH0=; b=igpbat+Jn2RGCspb2/wOAtX tY4hiFefQ/8vHkde/ye9/f+HhWw8LL7BOH/T6Pl2zn9LnYqq06U/gVkTW0sH1LjO kTYk4IA+MqLPGu6SLCDrn2dhbK310het6zCfSATql7dxTrFGPaLOIGPuVURJqnSN 679/JUnLB8qE/S4RaxpJBxotgJ+WuiKMvIBvT3V9ujJZgBwkWbI0xc2SHe04hT4t /bextLrLngR7jnTfawRfBYCxlmobOMfgAGGNju5fyc0E7M55jD8dS6YZaNgteWtt e1QUC+6qJkXHbwBF9uLHmkPVLeJSdD9qvyndroY2Ctie1Bj6Gt41bTfTyUPgb7A= = Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y6n45rnac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 09:55:19 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44M9tFb5024963; Wed, 22 May 2024 09:55:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3y6ndkfpvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 09:55:16 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44M9tGPX024969; Wed, 22 May 2024 09:55:16 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-hprem-blr.qualcomm.com [10.190.108.75]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 44M9tF50024968 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 09:55:16 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 4146166) id 19FAD410F2; Wed, 22 May 2024 15:25:15 +0530 (+0530) From: Harshitha Prem To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Periyasamy , Harshitha Prem , Jeff Johnson Subject: [PATCH v5 4/8] wifi: ath12k: Introduce QMI firmware ready flag Date: Wed, 22 May 2024 15:24:35 +0530 Message-Id: <20240522095439.2596989-5-quic_hprem@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522095439.2596989-1-quic_hprem@quicinc.com> References: <20240522095439.2596989-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: WOY8iH4XoZuCfLOEPL7hhkI41vkwX2sK X-Proofpoint-ORIG-GUID: WOY8iH4XoZuCfLOEPL7hhkI41vkwX2sK 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-22_05,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=907 phishscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405220070 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 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 f273cb93dedb..4bec52afa507 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