Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2458261lqb; Mon, 27 May 2024 23:36:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtrem0tl6g+iz+L8AZHXsaAZcZCy+7BtsFZfykp++6NhmwEKUTHIEoTI0NPVT2NrsvKoGmv+gWasxsm5RKlaMOcISmtCy4XRTlwFg/Rw== X-Google-Smtp-Source: AGHT+IFjKdrLbNFs1Qt+SrS4yLc8t3zIhv/iyvjRnt4xGEm85snYltAACkSLD3YgcxWTD3vI37r5 X-Received: by 2002:a05:6808:3a99:b0:3c9:c548:b9bb with SMTP id 5614622812f47-3d1a7647440mr10091885b6e.45.1716878185089; Mon, 27 May 2024 23:36:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716878185; cv=pass; d=google.com; s=arc-20160816; b=SEPB97xNBYRib9pxliD4v3D6jH7Tx5nqLMtIIvucir6tejAr8U28sD3AZkV3PTeqUU v7VIYqg85GgwM5vS+2v8godwM71MhZhVXU7QrKbIO7bWkFu3cEdFuppAzldimGWTGLar fRHLurUWIR38KDVXzITN6zCQBZGWXkO80N/1ol61RQ8LnT5GqKVgjP3n3EfZfZGfhGwe u3aw543VvpGlEy1cofMnmLcrzBXGTPvihN29ZiJHS/x5kPtdNNh6GkHIS7zg8BfP8TCO eT/x8oMMnBtnKtZPePT4K96ArmNExiCduNHmZCzBkdrDFq8CFAdtKcO5bWYXqDW/Hs38 w6kQ== 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=x7xT2WlzRSPBKZc0sZFZ1/gvRKwRjy3S+c3RtkoLvQ8AkSI8bfGY3fhMBecokV/b+8 h/acSkdnflU4gLrIztX9Qj0aMwbKibUi74W40Lk+d5FO1nK/DGpZcXDnsftR5GeVRc1q bH1VBCi6zHC5YBRQuFlaNdBEJUBwvaSXBzcGm04wmddELUZIsmuQn5XoGrC+qekvmPFZ LEzIyV+fxe8fJd5dKwOGBh+Cyg8jyy/CImdDRhFg9GZ6hfjfQA8kwV8tyOlxDxTO8bAI xUqOWbTwY2fY7EdaA77gjLyTWnM8NwwRoLMN5AKvDVep0oehj5RZ2LlWbm1LDLszLuOg n6gQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WXxD4vAB; 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-8159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8159-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221e566b3si7643783a12.154.2024.05.27.23.36.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 23:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WXxD4vAB; 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-8159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8159-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 B4944283C4B for ; Tue, 28 May 2024 06:36:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE84B6A33F; Tue, 28 May 2024 06:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="WXxD4vAB" 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 4553A61FD7 for ; Tue, 28 May 2024 06:36:13 +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=1716878174; cv=none; b=cUpm/fL2teFYUbRRVTm1JoLmAMnizJJkHisWcwOX5ifVQbHZnAcYokxySwgpnb33Mex5ebX5yCZMgv5L4bEQ+Y6+md7m+OMcZLd6GfeNYMDTlZzaXXyed7QbqTt/KgD+6Rse7mhb46KsOQuoKxTJEHNEUk468ZqE/2Yt6/7kvW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716878174; c=relaxed/simple; bh=dwkthOA7GWS4R8gzE42HqNlpALzQ09xMHfIGVIahTSA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sxh+5nHhLzP16SzQzjLv4STR8YV5oSptYohZUUDSFZPc2lC01/GrsMEDlnNFWC6Vunp0W0bp/a3hRdRnw8sLk/bGxxAMpdq3dPN7sgeZ6Z/FocxaF7ix7aIWYzCw3o+3zWIpevayMKIV0mFbJ1tQxLnJaChr+ZIOu8k8phhI35E= 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=WXxD4vAB; 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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44RNoxhX008223; Tue, 28 May 2024 06:36:08 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=oRG1vZHhL6M emXix6GK9KFZsHBV6u+6OcmvB1zTdbH0=; b=WXxD4vAB4FZLDm7RY4rp9wI9enA EAXfvrcTC6G6oWFi/k0mR0miqSB/eoK1an49tZI+b6CL56pi4blhcU7z3sWKNl15 /xaHSVSYZEyewKUWgCpsTYgooUfAAMYFwPPabNFt2Q0o5X93cwJK6rF5UMPbgrpU kEf5lg1igP27Pt/pgBxb3sDwBR3ohyBz7awcX7WCt3Tx4P8qe3vzbIOtYSfZ2KjE eMQt/PbKqjr3iDVGutuqe3zQTTqmViKsd6eDdzHN1Enh76lVaHIJ9OS3FXHYY+vC J4232w9lATocNZPTV6ptXPhlwL2/pQz3yjLWsAjk+zoeukISGiUdV8QzVfw== 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 3yba0g5cg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 May 2024 06:36:08 +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 44S6ZxQ8012692; Tue, 28 May 2024 06:36:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3yb92kd5xx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 May 2024 06:36:05 +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 44S6a5NI012788; Tue, 28 May 2024 06:36:05 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 44S6a5EX012787 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 May 2024 06:36:05 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 4146166) id 21D5E411A5; Tue, 28 May 2024 12:06:04 +0530 (+0530) From: Harshitha Prem To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Periyasamy , Harshitha Prem , Jeff Johnson Subject: [PATCH v7 4/8] wifi: ath12k: Introduce QMI firmware ready flag Date: Tue, 28 May 2024 12:05:43 +0530 Message-Id: <20240528063547.1400700-5-quic_hprem@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528063547.1400700-1-quic_hprem@quicinc.com> References: <20240528063547.1400700-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: n3krbtTUpQJukTrS_Ff8pto0AaEHXD5l X-Proofpoint-ORIG-GUID: n3krbtTUpQJukTrS_Ff8pto0AaEHXD5l 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-28_03,2024-05-27_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=904 malwarescore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405280047 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