From mboxrd@z Thu Jan 1 00:00:00 1970 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 A24283A6F17 for ; Wed, 3 Jun 2026 14:02:19 +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=1780495344; cv=none; b=SEyuVFTSvYJqKI/ad9whHgNkAXCnhqShcFFhgEw5aFQzWu2jn/IT0IyYzxOyMg75TwyIMdkiA8ebXrq7sRwU6xKEj4sYinqGrqxSseAf0UdASyxxxbYV2eDHXN4ZVkr0fVQPg/OMjEHwH/yCj77uZVXIUNcv5avDLVG+Xdhybz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780495344; c=relaxed/simple; bh=5q57Ll64Gptb6Z3cMHEn7AH0lMu6trdmtIQANyRR074=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=E/1FtlBZnRmNAurfuOAA0oDfv8+ngYrgFEkwzHDChXYfDMN9MCTGnU/ra2Fwc1MPhdeBVMbfDeGYrvY2Xkt8QJ8Ov8spVq3aoYHh1cE8XESI2lvqxyy0i1fWura4ZR5G4n2PyU/T0Rm6JHlBbQDs+r04DF6ou2uiJM5FbSnsvTE= 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=MgHBTNPX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cONcz9ew; arc=none smtp.client-ip=205.220.168.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="MgHBTNPX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cONcz9ew" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Cel9t3077899 for ; Wed, 3 Jun 2026 14:02:18 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= hH7KWT6cXh3uKU606LDzlxduout/UQmpGnjBLUaQ+Tk=; b=MgHBTNPXivkCNtK7 PfUhOT/iHHs3wZPZSTDcOjXXvoqpQqXf8Ai39TDMU3glZwMXyyzEQ/nwS2MGrn5t uJc5rW+Wf5YEvnJW/XUDJWMDZaVTUQ9gUyS71Nu2i0cw7cFPdkp9WLJrzygC+2so urw6Gza3HAgW9/uy+Gj79p1pwQhHgelbWWrrMyQQFopdUFEX9ofJJYWUZC2tAino nexP+K4f1ZbGBo1SGls4I193QfPlZmSIpxCFMBNZVscv8ANLuWetgEMMzE/qFNfN /VBLTh7b7lTxZ7JzkKTDkJ7ORX35QNAMj62db9JC67OJGtpBwLS2qS7gqMN4XrOM RQHK2w== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejabbtsfj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 14:02:17 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2c0a99db8dfso44986715ad.3 for ; Wed, 03 Jun 2026 07:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780495337; x=1781100137; 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=hH7KWT6cXh3uKU606LDzlxduout/UQmpGnjBLUaQ+Tk=; b=cONcz9ewwNT/mmsS1f16lQVZDMg7k8rQAN5a3u4tCGEu/lMuSvFb9lJwcvhg9nNOTB dC+tsF5EbFbYA7MjulU2diu5qFDPLVAgOUcUIVZL7O3d65HM9+JJo/WcWAI91IjGOu02 KPHOAhhzB8eWwbz3q45YVvG1JZG3zCNK8eCI8HDIxGSYK7QjKmzIDyV8iHL+kzOZyC7N OhYvZwGeuajJzRKKCyTxosj3WBd8hozfCJPQtjc60JZdPPCGcYLOFkrqNN1LEa2zl2q4 05hCLoHrx0CrNHWZM3MrNnuH45hQVFUHXdsnI10knzd6W1PQVPk/SfhoUS+n3oli2MvX B76Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780495337; x=1781100137; 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=hH7KWT6cXh3uKU606LDzlxduout/UQmpGnjBLUaQ+Tk=; b=JKsOSVrnHdYfEwKgUgLiea4FTwzgjei4vJuvzcEmgUqvswbUqjIAQliXBVnsQyt/HS SlPZDIuoXdEcvZ6TcYJ2gZY8D7KKm6POjTVSukK+rrc0anJRLcNhKNGd7tl/jsxZ2Ceb QP0Sb8xPI46nkWGGBF9Rg0wxlqB61iZ1444brL7fNuIkJH/9RzSEzQ1h3hP8GG6HSvRz DMOW3VHLlXtoDCTqlhLWlaEFtrq4dKJa4+9SBpB5CuCU1NIOqoWKCo8tNQnRq+yjnCs1 ZfsvcA64Ej95oxKoj8eTWnSwDW8C3IYkrDRqJ6fsVScB7wK+R48mj3avd+R6TamOLHQB l2bQ== X-Forwarded-Encrypted: i=1; AFNElJ9dPLr61h5ctHG9k/TLUZf8cYc/gcNP/J2k9x0oBw1BOq4j1rPbp+WPS9fi4mz1IQ7/jbcorOnWKrn9kUQ=@vger.kernel.org X-Gm-Message-State: AOJu0YweJvvR4FoVHeZBx8LTNC36k7ivG22G7fGk76cbmdOM2O761+yx mjSpKdA9sJIugyTeZLcKQUkwF8+CMAfwF0OTxHtU04EQydysN5WaoMy2vnbgHgahSJTELP6QiRj 8PGdqpSxdtxGV7Ctk4WFVCD2OgKkV66m9nxy97EfEGCfWXA+kYoqOexjhwSvJq6mPULo= X-Gm-Gg: Acq92OGlK9NIIm3mMEcQyZopXWN9usMSZf3NprnHIkitmdD9qvfLTYqo4+sShOoQgBT heGuZdCOyh5CDMbSgWx3QxBPjiRmIy+dy47iIoyBj/l3LAL21jN242yMaGmBTIpjsokoFvlRnU4 SFpk3h8kir6gB3CwpkjpoZf9zWlrr29hxcGlHoxGOlZd+qpYlOhOxMf8qOdmj4Eo/oxaenyxmL3 gNJitzKbsKZ5t7IwPsXr6MKf8YG9kr+YD98k7ulCo6WJDf3iLVM6ygeBkKm6dUuE9dxrq7eCshB Qq+cHRzvAmKFzcIVho2Vo1SDwBh+8pxh9eAHqOHbDS7HrhC4hheKLY3sHRXxdNa4YhpLqRsWrZ6 B7WLqMBhlR5oRS9gx/Csh82dN+a621MPSRs7y8vM9uyaGj8rdW3OoLsi67DbJBDxA1db/+oISsc kpit4D6GPy0hLRi3YmAUGC2EfxOYbA X-Received: by 2002:a17:903:2446:b0:2c0:b9a1:6493 with SMTP id d9443c01a7336-2c163a0fd98mr35342635ad.10.1780495336467; Wed, 03 Jun 2026 07:02:16 -0700 (PDT) X-Received: by 2002:a17:903:2446:b0:2c0:b9a1:6493 with SMTP id d9443c01a7336-2c163a0fd98mr35341475ad.10.1780495335559; Wed, 03 Jun 2026 07:02:15 -0700 (PDT) Received: from [10.133.33.112] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f6d211sm27170395ad.3.2026.06.03.07.02.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2026 07:02:15 -0700 (PDT) Message-ID: Date: Wed, 3 Jun 2026 22:02:10 +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 v4 1/1] cpufreq: ti: Add EPROBE_DEFER for K3 SoCs To: Akashdeep Kaur , praneeth@ti.com, nm@ti.com, vigneshr@ti.com, rafael@kernel.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vishalm@ti.com, sebin.francis@ti.com, k-willis@ti.com, zhongqiu.han@oss.qualcomm.com References: <20260528090510.829513-1-a-kaur@ti.com> <20260528090510.829513-2-a-kaur@ti.com> <191fcae6-1578-41b7-b425-f93abc3b8be7@ti.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <191fcae6-1578-41b7-b425-f93abc3b8be7@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDEzNSBTYWx0ZWRfX27HxoPH98L4T Y4KJj5btEV9VM4bQdnVqBxbgS8oh4+JJBtVWL+sa3aocK95Z2SfiWEM44zFNntrue+nCiHj56t1 YZKDBa37HwRvS3b5oDGxkE8Mxa6885ouP6guXcxBid60j0kSRffLATOGxFMhHiedtAD9QtsCHIR WeJbAb7/9wCGehBeaSt9OhwIb75v4Lum1xdHePUoWaPyHqG1Nk2TgnBOUf4++sNUCpCYPexebfl rfvLIDYpo21NLSRvQDAq4+pttfkbHl3Rwnq123K5Grsf5XdkdxPbROMVIS3tJkzLyGOOz1cdG0h S1IPDRLHrcigNAPCNb8pmaTWFqbR+EymSrgqLf6P7ml2LyBq/l98YQyZgKkJl8vFjKP+Zo8NtEb a5ciXpjUzC0WscdiSYp56nx3SRqHrg== X-Authority-Analysis: v=2.4 cv=UqZT8ewB c=1 sm=1 tr=0 ts=6a2033e9 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=sozttTNsAAAA:8 a=pIEw26tzc6_NIsGox4gA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: VchgVV632GZVtZTPiC7YE6_K-aq3XYLJ X-Proofpoint-GUID: VchgVV632GZVtZTPiC7YE6_K-aq3XYLJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_04,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030135 On 6/3/2026 3:23 PM, Akashdeep Kaur wrote: > Hi Zhongqiu, > > Thanks for the feedback! > > On 01/06/26 08:58, Zhongqiu Han wrote: >> On 5/28/2026 5:05 PM, Akashdeep Kaur wrote: >>> On K3 SoCs, ti-cpufreq relies on k3-socinfo to register the SoC >>> device before soc_device_match() can return valid revision >>> information. If ti-cpufreq probes before k3-socinfo, >>> soc_device_match() returns NULL, leading to incorrect CPU frequency >>> scaling behavior. >>> Defer probe when k3-socinfo hasn't registered the SoC device yet. >> >> >> Hi Akashdeep, >> >> Thanks for the update. >> >> >>> >>> Signed-off-by: Akashdeep Kaur >>> --- >>>   drivers/cpufreq/ti-cpufreq.c | 12 ++++++++++++ >>>   1 file changed, 12 insertions(+) >>> >>> diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c >>> index a01abc1622eb..8219751da175 100644 >>> --- a/drivers/cpufreq/ti-cpufreq.c >>> +++ b/drivers/cpufreq/ti-cpufreq.c >>> @@ -99,6 +99,7 @@ struct ti_cpufreq_soc_data { >>>       unsigned long efuse_shift; >>>       unsigned long rev_offset; >>>       bool multi_regulator; >>> +    bool needs_k3_socinfo; >>>   /* Backward compatibility hack: Might have missing syscon */ >>>   #define TI_QUIRK_SYSCON_MAY_BE_MISSING    0x1 >>>   /* Backward compatibility hack: new syscon size is 1 register wide */ >>> @@ -347,6 +348,7 @@ static struct ti_cpufreq_soc_data am625_soc_data = { >>>       .efuse_mask = 0x07c0, >>>       .efuse_shift = 0x6, >>>       .multi_regulator = false, >>> +    .needs_k3_socinfo = true, >>>       .quirks = TI_QUIRK_SYSCON_IS_SINGLE_REG, >>>   }; >>> @@ -356,6 +358,7 @@ static struct ti_cpufreq_soc_data am62a7_soc_data >>> = { >>>       .efuse_mask = 0x07c0, >>>       .efuse_shift = 0x6, >>>       .multi_regulator = false, >>> +    .needs_k3_socinfo = true, >>>   }; >>>   static struct ti_cpufreq_soc_data am62l3_soc_data = { >>> @@ -364,6 +367,7 @@ static struct ti_cpufreq_soc_data am62l3_soc_data >>> = { >>>       .efuse_mask = 0x07c0, >>>       .efuse_shift = 0x6, >>>       .multi_regulator = false, >>> +    .needs_k3_socinfo = true, >>>   }; >>>   static struct ti_cpufreq_soc_data am62p5_soc_data = { >>> @@ -372,6 +376,7 @@ static struct ti_cpufreq_soc_data am62p5_soc_data >>> = { >>>       .efuse_mask = 0x07c0, >>>       .efuse_shift = 0x6, >>>       .multi_regulator = false, >>> +    .needs_k3_socinfo = true, >> >> >> It seems that `ti_cpufreq_soc_data` is a hardware description–only >> structure. >> >> After further consideration, may I know would it be reasonable to >> consider using of_machine_get_match() instead, for example: >> >> static const struct of_device_id ti_k3_cpufreq_of_match[] = { >>               { .compatible = "ti,am625"  }, >>               { .compatible = "ti,am62xx" }, >>                 ...... >>               {} >>       }; >> >> if (soc_device_match(k3_cpufreq_soc)) { >>      *revision_value = 0x1; >>      goto done; >> } else if (of_machine_get_match(ti_k3_of_match)) { >>      return dev_err_probe(xxx); >> } >> >> Just a thought — you might want to consider this if it makes sense. >> Sorry for not pointing this out earlier, I may have missed it befor > > The structure already contains driver behavior flags alongside hardware > descriptions: > >   1. multi_regulator (bool) - Controls whether the driver uses multiple > regulators (driver behavior, not HW description) >   2. quirks (u8) - Explicitly documented as "Backward compatibility > hack" flags that control driver behavior: >     - TI_QUIRK_SYSCON_MAY_BE_MISSING >     - TI_QUIRK_SYSCON_IS_SINGLE_REG > >   The needs_k3_socinfo flag follows this existing pattern - it's a > driver behavior flag that controls probe deferral logic, similar to how > multi_regulator controls regulator configuration and quirks control > backward compatibility handling. Thanks for the clarification. >> >>>   }; >>>   /** >>> @@ -443,6 +448,12 @@ static int ti_cpufreq_get_rev(struct >>> ti_cpufreq_data *opp_data, >>>           goto done; >>>       } >>> >>> +    /* Defer if k3-socinfo hasn't registered the SoC device yet */ >>> +    if (opp_data->soc_data->needs_k3_socinfo) { >>> +        dev_dbg(opp_data->cpu_dev, >>> +            "SoC info not ready yet, deferring probe\n"); >>> +        return -EPROBE_DEFER; >> >> >> It would be better to use dev_err_probe() here and return the original >> error, instead of using dev_dbg() with -EPROBE_DEFER. >> >> Also, the message "SoC info not ready yet" seems a bit too generic and >> not very descriptive. Which SoC is this referring to? > > Thats good suggestion, will update both in next version. > > Thanks, > Akashdeep Kaur >> >> >>> +    } >>> + >>>       ret = regmap_read(opp_data->syscon, opp_data->soc_data- >>> >rev_offset, >>>                 &revision); >>>       if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING >>> && ret == -EIO) { >> >> > -- Thx and BRs, Zhongqiu Han