Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3195912rdh; Mon, 27 Nov 2023 08:21:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfSizevOt+SdHpxo619Y8i5q6asob+G5+BSgrqyeygKjb4hKdKtBgvFo9vurJVuyvrCT2W X-Received: by 2002:a17:902:c40d:b0:1cf:9790:f244 with SMTP id k13-20020a170902c40d00b001cf9790f244mr12334747plk.47.1701102065413; Mon, 27 Nov 2023 08:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701102065; cv=none; d=google.com; s=arc-20160816; b=f9MuUWHjmjlqNqbwyPnOKfZ6flFXOZc8wSk8qiMGtbWyy5Dzsv97Ex+C98mkRwq6Zl gsEHO9MUvy+wWnsUcRmDsvajqTzy00JwL5YzRubpQd58AYenNwssI6ARuE0vtC3c05/u 6+ELXoBCL7BP8eLtXHcudXdExCYLkB4GT+jyzxDJM+6IZte1eu3ZAXjrEGkB9CjjZhyz +nxRDLjtTBUznxWfxcvfBZV7z2WDV3WNcFj2gGnykTcto0QMrMefPyQY6pLiVfqIwC4a lXrQnABQ5AYgfyNBGJOSc6R/r7RKTB3uA04UJn8gAJNrdivaJAL/wmES65b7LVxPFMGq pWWg== ARC-Message-Signature: i=1; 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=F5+bqGpv7J0Eykbgac62yzZMW3BunghfA3zS0UDZojY=; fh=DsmpQugfDyHzy3r7IhaRWgu+h4RwOFD/lORqFRmQRCg=; b=Rwp5Kr8fwoxJg1+kqO+oUBivxnb8kMwSEBmz1I/s2fyyvj8oX4HqxYZx4FPbSKo6BU y5+dgllaWCHtPgcgfVm1grb7xB2754aQDH194bJWTMNSjLAcjjK8vosyoL/9eaPQxiqX SALJvsMaZuPbmpVmLEoHOw7HK6VFCHDp0BaR8bUq36eDli+ph21tKmQp9X9PMy2hQ98X MnW8cmE7rBmwGHUEbNhPeqN7y4NNnHmChTKZ1NV4IP5b00sZZZQ4SNdZRE+OANbgb4DP D16BaFJzaeufPScO/j9rPwfv9rA4cMreGl/6stxe+nZAqeSuq/vUu7aKLhlplj8iiG6T fmAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JsgMvRhK; spf=pass (google.com: domain of linux-wireless+bounces-114-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ju14-20020a170903428e00b001cfb6a814aesi4939249plb.255.2023.11.27.08.21.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 08:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-114-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=@kernel.org header.s=k20201202 header.b=JsgMvRhK; spf=pass (google.com: domain of linux-wireless+bounces-114-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-114-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 832B42819B4 for ; Mon, 27 Nov 2023 16:21:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C676B374CE; Mon, 27 Nov 2023 16:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JsgMvRhK" 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 9EF42374C5; Mon, 27 Nov 2023 16:20:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59BFCC433C7; Mon, 27 Nov 2023 16:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701102034; bh=s8f7ejt6/6A/AIKa6sJs8NlXnpAnYLCNcVR7yofQBJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsgMvRhKBl6PnzS9ItHmj3EGCaHJXg/wa2vfw54wgB1WF8Umbv12JcXRE1oEldS2X d+tuMKSmovorfeVEd+H8TX0WgncpcYbkyNTp3GVvb4nEzCdnAhv295QB72ozEAxYEM zY9HFQe0u0BCB+sjaI1y1QEVCRFifdt5jUMCOUyMPYEj0iUFlinaDaUWpgU2bTfeEv RWnROdB9hFH1GoXJtYNxBpKRLkGLWiNuXVI6s5xUBEeMoUaifJiu0X57hBthAnP7AJ colAu1cpiPAlC7xqKlfN4Y+EwsO4FE7bln0CMI9CyuW4O7sZWAvps/cE/9ij7uE79R ojQQ2z2Ntc3hQ== From: Kalle Valo To: mhi@lists.linux.dev Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH RFC v2 7/8] wifi: ath11k: thermal: don't try to register multiple times Date: Mon, 27 Nov 2023 18:20:21 +0200 Message-Id: <20231127162022.518834-8-kvalo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231127162022.518834-1-kvalo@kernel.org> References: <20231127162022.518834-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Kalle Valo Every time the firmware boots we call ath11k_core_qmi_firmware_ready() which ends up calling ath11k_thermal_register(). So we try to register thermal devices multiple times. And when we power off the firmware during suspend/hibernation (implemented in the next patch) we get a warning in resume: hwmon hwmon4: PM: parent phy0 should not be sleeping Workaround this similarly like ath11k_mac_register() does by testing ATH11K_FLAG_REGISTERED. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath11k/thermal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c index c9b012f97ba5..80abf472fb87 100644 --- a/drivers/net/wireless/ath/ath11k/thermal.c +++ b/drivers/net/wireless/ath/ath11k/thermal.c @@ -162,6 +162,9 @@ int ath11k_thermal_register(struct ath11k_base *ab) struct ath11k_pdev *pdev; int i, ret; + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + return 0; + for (i = 0; i < ab->num_radios; i++) { pdev = &ab->pdevs[i]; ar = pdev->ar; -- 2.39.2