Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2125303rdb; Tue, 20 Feb 2024 19:18:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUi1yqSuZynUm90vcq7sGQn7ObPGBWa5F+LCML01hJlDeTaUrhhBgnCLxxyR33z8lfDZuv69hGbJsTkdOrtoaSlAQ2y96sEpV4pt6I7w== X-Google-Smtp-Source: AGHT+IEaAHbQdOPr8AeUkUCZlSwVpQ9bB7slAP8WKz/aFP2xyLIctb15TPQKY+xRxKICN5cjNupR X-Received: by 2002:a05:6808:3010:b0:3c0:4bb8:4a62 with SMTP id ay16-20020a056808301000b003c04bb84a62mr19371211oib.32.1708485489827; Tue, 20 Feb 2024 19:18:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708485489; cv=pass; d=google.com; s=arc-20160816; b=Rz6B77p8cfnEJVhBpDlQ8I0JeFB1lXXZP5HAyYfHAoiWmykdtqrTliCmT6SBuOum8c NQ/GQvabDsWbwJZBfb4WsABocNtEVC0XGJmmSRFKK9PhvmSHygr9i8WsjjM4aR7hA/P8 5rSFgB+ODsb5Zsi1fZzPOSa5eLIjFTH/uglJ1F3ykKZCrTCvKrcJeowM3l4Gy47dU1R8 3Fl5tjyZ199hn9eB9CDJcNM5/HS4AoAMHhMJ1RnFBtChxaLXquMiLjCvx1tIBNNxbXNE LG4N3FCwW3Ga2ekZWpnTVcSNWaqJB4GMY18PnkKG9h76G/mdQRV0Q7YcU2eeFpnvdFTr KFow== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=N9TYB9zipmIqlro+9b5dbX+BTYs7BItINZ03gTqNIfw=; fh=g/RvK5K3cwwQnpxfNTVIJn66R3svdR+eUl33YNuSbPA=; b=QUqwDhFeeUtSrG+M8JOGakREKH0F4V5V/c3FzrGH7ut6kQanlYxJM2TA0/u+nwL6oD RtmutBwRssgx5GI6TazUo5HFBASnWVLcIiAaTsrUIsu+jTRGeTd2FcYBZwdP1e0u6KWK dVeOpSc4qJmX9ag1NzcmQpTdqFyEywukrJpWWhwz6/a2dPPvUzqmx7qzuGVqffuFYG6o a5tLrJOJsUvap3trZ3DbX6xvJKu2kz3rRghUJJlAfWyZ8sj5s+p3MeDn0WOCmdDoDtEf yDHuuW+5BjFgYuJs4fjhY+sBVNoa4LeZoA8+R+ioTf7L6UciH7gy3LaQbu/LVKXAXD+T iqnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mLTyqS0u; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3836-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 s127-20020a625e85000000b006e47d95408asi1992353pfb.145.2024.02.20.19.18.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 19:18:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3836-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=mLTyqS0u; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3836-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 5EC37284BBA for ; Wed, 21 Feb 2024 03:18:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF97D2556F; Wed, 21 Feb 2024 03:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="mLTyqS0u" 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 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 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 --- drivers/net/wireless/ath/ath10k/wmi.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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; } base-commit: 707e306f3573fa321ae197d77366578e4566cff5 -- 2.25.1