Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2496145rdb; Wed, 21 Feb 2024 09:16:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/3h9ZtKYVbpIbSN9rQ9bWK0k1Me68CbQKufGcBl4vU6rPkbFA9gS4It7lwZc7xKc/rOBBLm/1qoV3JXMsSEoLqNNbCVo8XnqjYmy5AA== X-Google-Smtp-Source: AGHT+IEBxUtLlQlFce0/3jEFgZGMS2mBRaFa4lVDh0pq3K5LrCdPXQUu3Q2r+pNNH1rfPGaKS+Gv X-Received: by 2002:ac2:4101:0:b0:512:aa7d:3beb with SMTP id b1-20020ac24101000000b00512aa7d3bebmr6986528lfi.26.1708535794283; Wed, 21 Feb 2024 09:16:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535794; cv=pass; d=google.com; s=arc-20160816; b=WRrGwPQUNVKCSulom6r+1LL4ozlc8YdYuTbyyNKHCijPCMvX1YgQMYhB1IFi6iZJRh 5D46UcAtqMFuAdDNjEZnVNm5XFIqZ4eCxTNazMwW2NvH2WM82U+RL5QXEh2mZVWBKOGv lHiP/juNvz4xf0hUtipWM3TeW8qH7Pejr4EH9ZTx6R3ilrC6bpnKUqWYdBX4g0HT6HKh 9Iw8Vk2pG2c6D1Fvn+WZ163eA21F1EVH1Ssbqs5hC3RYESJYld3i0BsAJTPLHuJKNM5/ LCcaL+hEMjyxE083eirWx7QXChTCDrvEDWHDvNGrgYuDXWWwVT/Attiz0+dYdUu9L0Wk KbwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tsOvlPAUo0XfljCTLtSz5JL0bPSChABZUyJuSiEqFqA=; fh=lP+FyPnTPmJOMA/wP4iC1fr6HzuBVIppIk9dmo9v2y0=; b=Z6rJM1a8NftLBS91VMxG+R2WAaGWv6L6c1Fa0bxuwdeIjVxjuXoc380WsTa2Vj0PZF pFxTtZORd8gcA2nBDdCY3MWWSYOLo6t4T13zJmS7s84+2UupDJWA2MMFd4SmM+ZVSdU5 KpPOt/VxFdTxv7T5XWvHld9oafib5XmmM68W2cjnn3cIGfNkdiCZgEgsrYmd9KMy9VEi pAHtSTiCuwIHdszSRqMVipIHSENs6TphZvIYJsRJ0pTPgNu/QHsbqAND/85/XlN6M2TE 2w4U5/+w7sHL9ljyWRKA7d8NwcGLAYXUdZsrLtz0/imjoAokT1TUHMpb4WSroHCs9eRC 6MPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gpyKoVep; 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-3871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3871-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j21-20020a508a95000000b005644278ebfdsi3799754edj.635.2024.02.21.09.16.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gpyKoVep; 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-3871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3871-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8D2341F22CCB for ; Wed, 21 Feb 2024 17:16:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A68A483CA5; Wed, 21 Feb 2024 17:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gpyKoVep" 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 26BFC81737 for ; Wed, 21 Feb 2024 17:15:46 +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=1708535748; cv=none; b=tgRtovhp/9fykP9UYPMskttiEDxy/iXi9pUNxVCrwTVYSrXk7Ky6o3201ttDUAwMpAV2wU0/A4pVdp4LeZTZXE/RK0zNvJM5Qn8DPbByXiNzOK/cHgpbB9jWtIlbahbkq/+upJedtqQV44t+ocINkhdfbAajPldTawb+niQAHzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535748; c=relaxed/simple; bh=cGWK8PhlL5QHrqLls+AqISkWrpennN2EucBv7npLBFo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=mkD2kfeYsxL8z2ZRqR6oKUAJe6wdhGBT572qDlkxnwo4tKbFiY8w5kK01S9OgKNy2JUh1iZE+pL6IOAHsaYKX4POkoaa+NqPWBE7ITnzI+Bx2LL1/4T9w4KFuUwPZsH7BhqpYGutzYXsTHTU5jnIdnVAcIT/jairvfHBGPy/RlY= 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=gpyKoVep; 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=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41LAkMgA012320; Wed, 21 Feb 2024 17:15:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=tsOvlPAUo0XfljCTLtSz5JL0bPSChABZUyJuSiEqFqA=; b=gp yKoVep/nva/6IrGn7d73DMZHTkFv8QGW0MNKvGhdZL835f3WBZ9GZf3EKgJ/khNi FLiHnBYNUlpv1w/dvdvWELJ8KyHJpP7qtf0313rw90bo7DIx75cO28fmHrlIET08 xtFnlZ74P57QMIpD22bw2kT8FHluFOHu/duSE4IKtsVTd+XsVO3UKENiFUUkglgH uipTtlfdZ8dED17x5s+A3CTrSvlVKMDx+YHMB12p5wrL//i47bJdplwDQHTqkYyA HzUM4/mft/aGes9vHpSh3YcYKHPz3+oWkUtYb08+RzRbbMzKsdVdpnWP+r2KYo2m 5fHAoU18J1Ar/YbwL4Gw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wdfqa0x4j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 17:15:34 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41LHFX37008439 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 17:15:33 GMT Received: from [10.110.34.22] (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; Wed, 21 Feb 2024 09:15:32 -0800 Message-ID: Date: Wed, 21 Feb 2024 09:15:32 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/5] wifi: ath11k: thermal: don't try to register multiple times Content-Language: en-US To: Baochen Qiang , CC: References: <20240221024725.10057-1-quic_bqiang@quicinc.com> <20240221024725.10057-6-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240221024725.10057-6-quic_bqiang@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: 1M2zobVpWLyD4TQsriClUV6y8j8luoqX X-Proofpoint-ORIG-GUID: 1M2zobVpWLyD4TQsriClUV6y8j8luoqX 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-21_04,2024-02-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 phishscore=0 impostorscore=0 malwarescore=0 mlxlogscore=930 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402210133 On 2/20/2024 6:47 PM, Baochen Qiang wrote: > 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 you need to add your own S-O-B > --- > drivers/net/wireless/ath/ath11k/thermal.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c > index c29b11ab5bfa..41e7499f075f 100644 > --- a/drivers/net/wireless/ath/ath11k/thermal.c > +++ b/drivers/net/wireless/ath/ath11k/thermal.c > @@ -1,7 +1,7 @@ > // SPDX-License-Identifier: BSD-3-Clause-Clear > /* > * Copyright (c) 2020 The Linux Foundation. All rights reserved. > - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. > + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. > */ > > #include > @@ -163,6 +163,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;