From mboxrd@z Thu Jan 1 00:00:00 1970 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 E4C203DA7E5 for ; Mon, 11 May 2026 13:54:39 +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=1778507681; cv=none; b=JJ1gjTvzBJx9iAsHkvXSpmH1Xm7QelV1+LUBu7O9KpNOWKT8PvrK4YMITmhJgxAlfpmU2nMgeQBzdI1Z2O/gOfQR5HgkAU7n6K9dKfmPS61srWM9//T92DxX87zj4wy4X+pxNjhkBdNNNlv5GmV1FpNuikfxYkhWp1XQFkXd9m4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778507681; c=relaxed/simple; bh=r4olRqtT25PRvXYjfynWFNGrzUlqBkKYLbJrQ1jwD8w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oeNOX6sr64glapHbWsm25VqnEEbDw65pT2TA1FcQ7F26rHka49048ZkFcieHKQjIrgzzS/+bMWVRfycDHyOuXN4GUt0cT44VwtFyUHJw1Hitm6GBe97aPfbnrzpQSNijNKoabbec8dpaUXWSC7KTkSqbODy/4j0xQKgZKjGyLKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Da/O+MNt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VY1DTFJE; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Da/O+MNt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VY1DTFJE" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64BDATq13332677 for ; Mon, 11 May 2026 13:54:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= vseYlASF+Ag6wSqAVjdGQAFSwfi9OF8CpgFAIXGaYxE=; b=Da/O+MNtQqC81KKb o2tDoRKXnJ5kteHJ4nFROUGCl8Y6CE1Pc8jciTW/tW1RndhLyT8kTpY4gx5jsTmJ OugHOx8iD84k5vPcazZqZNdAUIgKOLezIBtc41F9aiQjdvnktoxbuWMRQocOWpHE rwUTJGGtot6UOPSItX1mCAlbt/gqasVvUByvHbLXrjB6BGI118Te5tnKQLpmf2SH mw7jAAomahMYGGs+HIKityAgAYGMyKCQHGGLcgexGNUn498JrorOqEMAYTtU/Frf otD6E0M4bUI/7a2ggBSYA/GTaXodHkbscTxNbAQ8rZaEziEcwQp2peC58uTpdW8z rwWtjA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e3ajgsd81-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 11 May 2026 13:54:38 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ba603a7d2cso47479865ad.1 for ; Mon, 11 May 2026 06:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778507678; x=1779112478; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vseYlASF+Ag6wSqAVjdGQAFSwfi9OF8CpgFAIXGaYxE=; b=VY1DTFJEoT0bRXi8Hz9aed4pM3cqVlNppo9Ju7xEhtNuaLn1aIxSmOj5J27umRamwY afMPXhixWhInweFIgpETWpNg/0A0SiDPOMgjYpngQ1fTHfzBGs2YI0YVK+8janvNJbG9 yJw/Avr3cA580b153yVLDG5dRLHNqqQn5GJZB/cAVN/660615KrFdhSKxfOFuGF7yeha G4bOYSM/J0UZPtOhzGz9lPE2Lp/shDEOX/qRIiS2160RJqLWxCnjb2aA/l+h6hle5VPL zOFgPB9Yo+mM+jbHLnzc46FsjU9wZ8nYLS09JqohS07q14OHIGhPVm1mFucNBuRSpo8o 5Bag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778507678; x=1779112478; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vseYlASF+Ag6wSqAVjdGQAFSwfi9OF8CpgFAIXGaYxE=; b=eNXjuONwX8gmgKqMW/A7uMTZqRG6EvV+gurcalZqF9agpoFwBupa/vUNVDXsipHQ5D ya7g6+InPUegoBx298Uy0qSlkfD5rQpZ/IgpaP47DH0YQa8wO5wOpkE/lkCZaVX3DLjd rOS/EWEz24KYMNthlJxDT0kt6RdOk0cg08xOZnB5x2TiBFkPM1NGw6XUO5+xxLPElsJ9 07iebKdO0lVKmmh9C/5OBymQJLJ864ippvDvaFytMt500rI19wCjVO9PrmOEm7ScTO/d 1b3pISDWUEKUnAZsW5w+LTsAinf/oYKlUvDBFniOornx8E2OwVib6ESAk/hkZBOHLcr/ 7Q5g== X-Forwarded-Encrypted: i=1; AFNElJ9inbuhk78k6KDo5DoX4hcws9B4n3TWE4boauf4vPCKCaw84vyMG9XpvMQCFDdCw9P29JPmzLgyi1l7sYg=@vger.kernel.org X-Gm-Message-State: AOJu0YyJBHWNWqVTEDXZ5zG23ptsnIe73iyLrtrwSvMp1hAQo97WiYyT P9Uxq8ey8EMzGUu3xd70YAqdt1l8AyukBRqEzwX4NTr8EmdumxocDxNqaa//uLjxMVEo+Yfm7l1 5SpR2iqIAXd8mhAqYPNOgA3Qxxz20MDbwoPv4Ic6958MIQ6eSCQ0J2kv/FfD+KAMjx1qfJWfDoI 5j/w== X-Gm-Gg: Acq92OG10Uvv+/UA19370LFJ2bi0/rXcBSQHouCjQWQ+xNk3eEPr0e/C5XW5QFJnS9G 2kUYr78WtQbsBdZQoB0a5Er0QzlSiH/iTG1ip7InhiYNSfBA+kh7lW604++lqrkkU0Yz724f71u 6xBdKHhHXJV+DrItFzPGrVgW/K2N+07iE2hI+Qsc7BswxE7/bd2vfG8ZYsbzbXEog5MtSo49uOB g9RdbnuJNwuDLWZl72gKe3dTjZD12Fh6TKIQtnrB/AJYlgU2blYqbwe2DSSotyfh89TyAORRC41 3pghxZA+aBRHIxs5LKsr9bET+GRdYt2EeTfYoHSLSo+5nM6NMR0biGkHCT9YbGgJmo4tGwO8Nvq g+NeiEkddTWuZPPxWHKy7QujB/ULIGn6FIURIOn6IPXHEBNm2qv4fbIUi4E7AA8oX+NCx0yT2Xs dDZCEiGMsqs3b7LwahZQ== X-Received: by 2002:a17:903:4b03:b0:2ba:21c2:d6cb with SMTP id d9443c01a7336-2babd4bdb6dmr161931175ad.16.1778507677834; Mon, 11 May 2026 06:54:37 -0700 (PDT) X-Received: by 2002:a17:903:4b03:b0:2ba:21c2:d6cb with SMTP id d9443c01a7336-2babd4bdb6dmr161930925ad.16.1778507677317; Mon, 11 May 2026 06:54:37 -0700 (PDT) Received: from [10.133.33.247] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1d27109sm106388885ad.1.2026.05.11.06.54.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 06:54:36 -0700 (PDT) Message-ID: Date: Mon, 11 May 2026 21:54:32 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] cpufreq: Fix hotplug-suspend race during reboot To: Tianxiang Chen Cc: rafael@kernel.org, viresh.kumar@linaro.org, lingyue@xiaomi.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com References: <20260408141914.35281-1-nanmu@xiaomi.com> <20260511111407.455-1-nanmu@xiaomi.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <20260511111407.455-1-nanmu@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=GfgnWwXL c=1 sm=1 tr=0 ts=6a01df9f cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=QsNdl-TZesgADIufeKYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: REr1gjG6wywT6kRACeqNFHrARGTvQZHX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTExMDE1NCBTYWx0ZWRfXzG7TFFffel+J Bxe9Xz5sflZ+eCtQYADz63c7ZAItrKjunm6fK0C6inVkTrmDutnZpyT1dhOC3LTC3qPk09dBv61 T/m6k7D8dS8teYGc6pNWFxk3Cjb68l+ti9D0yKZ63HrnopULguAqZuH1qS+Zdf/87q4pl0bycxp V0BbGDAjmPsgXoG9jLBYYbIvb3YbiDcQvrHLlrqIscegwgMM+gW/eQgUojy3KdfDRvED2WFrC/e p4mmszFxoJG5Oaf5kWWyjITXzf+yFbk8dS91dWbQZfITldW9OnGTSN8B2qRrQcLjZnMVQd0APr1 0KRwQEOv2wY8vQ6xiGb9XXvQkIyPzCly0aZNr6KzpihMEULr3kDn8tkdGu1Ftod5cYaWmvSdgbE f2hDjzE9qAT5poBo6FCkMNYYBSkZYLjF5rPoCvl4sKiRKD34yueCjZzY+7o6kne9ooL6CkBIb09 Xts9Mul/EG2U2QN3d6Q== X-Proofpoint-ORIG-GUID: REr1gjG6wywT6kRACeqNFHrARGTvQZHX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_04,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605110154 On 5/11/2026 7:14 PM, Tianxiang Chen wrote: > On 4/14/2026 10:44 PM, Zhongqiu Han wrote: >> May I know did you test this with lockdep enabled? Specifically, does >> the new cpus_read_lock() -> policy->rwsem ordering in cpufreq_suspend() >> trigger any lockdep warnings? Thanks > > Hi Zhongqiu, > > Thanks for the review. > > I did test v2 with lockdep enabled and was NOT able to reproduce any > warning. > > No circular-locking splat or "possible deadlock" report was observed > in dmesg across multiple runs. Thanks for the confirmation. > > My reasoning for why the new order should be safe: > > * The patch establishes cpus_read_lock() -> policy->rwsem. > * The hotplug path already holds cpu_hotplug_lock (write side, > via the hotplug core) before taking policy->rwsem inside > cpufreq_offline()/cpufreq_online(), i.e. the same direction. > * I grep'd cpufreq and did not find an existing path that takes > policy->rwsem first and then acquires cpus_read_lock() > underneath. If I missed one, please point me at it. > * cpus_read_lock() is a percpu-rwsem read side and is re-entrant, > so even if an outer caller already holds it (e.g. via a pm > notifier running inside a hotplug callback) this is safe. > > May I ask whether you have actually observed a lockdep splat on this > change on any downstream tree, or is this a precautionary question? > If you have a specific call chain in mind, I would like to add > targeted coverage before v3 so we can nail it down definitively. This was mainly a precautionary question on my side, to make sure there aren't any hidden locking concerns. In my experience, running new locking changes under lockdep can be a useful sanity check, so I wanted to double‑check. For context, none of the existing cpufreq driver .suspend callbacks currently invoke cpus_read_lock() so this does not affect any existing suspend paths. Looks okay to me. Reviewed-by: Zhongqiu Han > > Thanks, > Tianxiang -- Thx and BRs, Zhongqiu Han