From patchwork Wed Feb 21 03:17:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baochen Qiang X-Patchwork-Id: 775526 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 417CA2F36 for ; Wed, 21 Feb 2024 03:18:05 +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=1708485486; cv=none; b=hyJg3z+BKV9ucO3cVYlh1TcB3iD5cKahmYIu2X0tkJ49BcqLLx5ceuWQCbysjH6aUsVoC0L20qSmpnDRlU/8gBRPNPo7vs7aKbqROqxTtgKK5UHe2ulT4LJokN7L13YasuVjWlL/PAdOygqnx7tVPOoa5F4TtcKazMsFgUzKCyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708485486; c=relaxed/simple; bh=8pluO4yVsJRoMwJoZxPs2ePOwLC9nh0gTeYJPgk2BPw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=UVxvbQW9EZieTjdiLTPW9FdhNx6rYMFSUXlPtqXdcsIfZ/kTvy8vVH0tDsQwfkDGw4VW5ZUYDHQueqzJ2dkEvpK8uufVbFjP3zlygk0MfO+lqLSjVJCRASbFUPxMUpz5tvi5vEc06tf3YXhMJnFNJDq481v26YYioivvGGKTQBQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=mLTyqS0u; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="mLTyqS0u" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41L1okpe008345; Wed, 21 Feb 2024 03:18:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=N9TYB9z ipmIqlro+9b5dbX+BTYs7BItINZ03gTqNIfw=; b=mLTyqS0uX65fIXcLRXgRDHw 9TBGMoiBLGBz8NKPFTzM77sltQ+Cc7EDmk50HYZh1LXMYglKhA6YZrFGsXB1XcTW 5oAXH1ldtF1GbtrDdOX5NsNDDFifSfmk8/EeGo9vQhLHCJoSRWnkVt2aS565pFiv NK7cZPfINIadICSdag0zyAD7aYPXMxb6gnqy7WD89eqoyeZp5WSNnq0muPwuq/2U 0qOddPXSyxKUfqESNU8ismsXZeDYHOHYU+gCxo71dCFoGWV6Jz7qZdcouHTI3h/p TIFvALvkp47BB2cANKKu0Tghh4MRNs5NwE+R6vccTGP3h71ORPKngFI6UQTAt5Q= = Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wd21urtyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 03:18:02 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41L3Hw1U025021 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 03:17:58 GMT Received: from bqiang-Celadon-RN.lan (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 20 Feb 2024 19:17:56 -0800 From: Baochen Qiang To: CC: , Subject: [PATCH] wifi: ath10k: poll service ready message before failing Date: Wed, 21 Feb 2024 11:17:29 +0800 Message-ID: <20240221031729.2707-1-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: -c-nQnZDSlBD1lQ_eWhIRu0eN8LD7fZt X-Proofpoint-ORIG-GUID: -c-nQnZDSlBD1lQ_eWhIRu0eN8LD7fZt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 mlxscore=0 phishscore=0 mlxlogscore=854 impostorscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402210023 Currently host relies on CE interrupts to get notified that the service ready message is ready. This results in timeout issue if the interrupt is not fired, due to some unknown reasons. See below logs: [76321.937866] ath10k_pci 0000:02:00.0: wmi service ready event not received ... [76322.016738] ath10k_pci 0000:02:00.0: Could not init core: -110 And finally it causes WLAN interface bring up failure. Change to give it one more chance here by polling CE rings, before failing directly. Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1 Fixes: 5e3dd157d7e7 ("ath10k: mac80211 driver for Qualcomm Atheros 802.11ac CQA98xx devices") Reported-by: James Prestwood Link: https://lore.kernel.org/linux-wireless/304ce305-fbe6-420e-ac2a-d61ae5e6ca1a@gmail.com/ Signed-off-by: Baochen Qiang Tested-By: James Prestwood # on QCA6174 hw3.2 --- drivers/net/wireless/ath/ath10k/wmi.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) base-commit: 707e306f3573fa321ae197d77366578e4566cff5 diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index ddf15717d504..bf6cb2c73128 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1763,12 +1763,28 @@ void ath10k_wmi_put_wmi_channel(struct ath10k *ar, struct wmi_channel *ch, int ath10k_wmi_wait_for_service_ready(struct ath10k *ar) { - unsigned long time_left; + unsigned long time_left, i; time_left = wait_for_completion_timeout(&ar->wmi.service_ready, WMI_SERVICE_READY_TIMEOUT_HZ); - if (!time_left) - return -ETIMEDOUT; + if (!time_left) { + /* Sometimes the PCI HIF doesn't receive interrupt + * for the service ready message even if the buffer + * was completed. PCIe sniffer shows that it's + * because the corresponding CE ring doesn't fires + * it. Workaround here by polling CE rings once. + */ + ath10k_warn(ar, "failed to receive service ready completion, polling..\n"); + + for (i = 0; i < CE_COUNT; i++) + ath10k_hif_send_complete_check(ar, i, 1); + + time_left = wait_for_completion_timeout(&ar->wmi.service_ready, + WMI_SERVICE_READY_TIMEOUT_HZ); + if (!time_left) + return -ETIMEDOUT; + } + return 0; }