Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1225391rbb; Mon, 26 Feb 2024 02:52:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJZWdPSqHYrR701AslcVERQ/TNQotmVesJBVcjO7FhkhaTuuarAUZDkvdk0y914PkTBzRu6+AAbpY6cudr9SBmR+tRGls/M1Xx86kbBg== X-Google-Smtp-Source: AGHT+IH9aQ2yG1sAIuD2BcAUjsO/b1OKIxX9F/G2Mnw0aA2eBO9tRj4oZ7/dYm2qb84YAy4UNZwf X-Received: by 2002:a05:6214:3a88:b0:68f:a813:f0d with SMTP id nz8-20020a0562143a8800b0068fa8130f0dmr8251086qvb.32.1708944746269; Mon, 26 Feb 2024 02:52:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708944746; cv=pass; d=google.com; s=arc-20160816; b=cB4XJBLq4XNcUqYcwoBAkMAqr0GH5EbPmbjpyz52eIByNhCGYs3sbU8IqxPsbcJaTI mAEI7LZMjIfX8aktTBP7kVgvEsUJ0MHxcf0/+38BMCJxDn2QkGzs1l9PQBNXa5WEfAif 0CLMUbZXfY/1wBtMU6zdwHY5hDk9sSg+kH/uAfNrvzbdEtJ93MNiTw2TFVFWtRkXLVsT Myy+u0WoFlWdb8wsB9PNic9C7uMe95IgmWGsdWMxHblKtgOD6J3/vtmdARxAXm9CaT+j Nk4ZuwYkgM4LsUssC4ExhJ9C26AFxfpgpYk9VdlQ1Hsvwo3RWR4AIXQR/YKXTfgLoinU GL/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=js8CEG4qRs+xipr8fOPk2Qz6bOEGnrQE3fDthEZMgeM=; fh=L2JTK81heYpTPsutANS2/6tVASbfBpk+bgHxbdhqbk4=; b=Ct8smT7/K3wkdxvNEzBwwXNEvo3Y5/l7L0k15P/+fu2wWxmw0N0PChrFdpCDt8xBrS 6KzZlxOOPcYu7yghieu/S+cFAvOtOG9EMF0IdlmgiWVNKexlP7MrtdyQtLawdm8vcq0u Wuv2E/bnhirWDLK01y1MM8kKNMEEly7dDVpWBs6WprEwiKfxTOlH66xFhxEBIS8ZER0t Bx4rOf3LXM9aEKEYkMX9Jo7SET9Ai1LsHEO6IkwiwzkQoCW5bvth6cWCHdIt464w+0l3 gNXPBulRT4mtA0xyyu5XU6hWVHvjns18vgnBpgR8pmGTP5NWDgkAE/frjcp1Pd2ShR0w 2O8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SH9ZnHw9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r11-20020ad4576b000000b0068f65c8e094si4905745qvx.299.2024.02.26.02.52.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:52:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4004-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=@kernel.org header.s=k20201202 header.b=SH9ZnHw9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 6C2EF1C2200A for ; Mon, 26 Feb 2024 10:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8091F56743; Mon, 26 Feb 2024 10:45:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SH9ZnHw9" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5CB9756742 for ; Mon, 26 Feb 2024 10:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944341; cv=none; b=YRhhGKEkj1af1+FHt9wYBjVjXVZguCiGmLNsHSrEze/OCyrY3ooKVGmZ7gItn+8m65RIvQg3rci+3apQDzWP7TwLVntPAZwx5yKOdrwBZqkzM/jCT4AiLxQegKHXgMCrYZpg70iQJOz8TrYBdpF2N4efTrmXyQ4mdPCZSVApnPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944341; c=relaxed/simple; bh=ypJbOTquQXZ2hbU4PVAHyt/Olgkjp1gpiGx1r5vbjQY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=gMJ3rlDb9vMMobydlMPYe8/opwOetd3A3OUYpRbqAYOOMfF9gt51/6+rDcWEGjochw5RnZqN9De8tows6814npcoRPTVJKbgLBBpfRCLlxpyG9DDslcYuOIp3AxJx9DVCN+or2hkh7EV/RXtd1sklQTB/mi+hnQsIF8pBj5wFnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SH9ZnHw9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09B29C433C7; Mon, 26 Feb 2024 10:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708944340; bh=ypJbOTquQXZ2hbU4PVAHyt/Olgkjp1gpiGx1r5vbjQY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SH9ZnHw9CyL3pjRvThozbJOjG2Yn27xzP+zRcI80M+gurpSsL+MQ7NRQG8aGTXmB9 uEpAlB6rW34FOW4KFiiYNjBqbT0Sg/sKQWR4kvqVdNQ5tIEk3FRj0U+EapwUkoat55 QdDWtmAWSL2r8dmjEKbPOAXgyKAR5TNXPTS5irMazbg+8ouEFnzQ+NHCbpnbpR4Iff zWn483aSpYLu4lEtO62o6O1kxjJ2KWbLnETdON7K4NY5WTwNgxM4TlpsLed1q9o0lk 8KydPqDSdnGamdl5eaMnZC1kmVa5TfOtk46ju4GcipUPnctVijWLHUV8QWcudSOJH4 swu6H7yOiI4Lw== From: Kalle Valo To: Baochen Qiang Cc: , Subject: Re: [PATCH] wifi: ath10k: poll service ready message before failing References: <20240221031729.2707-1-quic_bqiang@quicinc.com> Date: Mon, 26 Feb 2024 12:45:37 +0200 In-Reply-To: <20240221031729.2707-1-quic_bqiang@quicinc.com> (Baochen Qiang's message of "Wed, 21 Feb 2024 11:17:29 +0800") Message-ID: <874jdvld0u.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Baochen Qiang writes: > 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 [...] > + /* 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; I think it would be user friendly to also print the end result for the polling, for example something like this: if (!time_left) { ath10k_warn(ar, "polling timed out"); return -ETIMEDOUT; } ath10k_warn(ar, "service ready completion received, continuing normally"); -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches