From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796133020; b=P+31KIGIB7xrAh8G/56ur6qi/25zWcce1oQ/t9JGCC7teNezo5B0N4N9Pw4oJxqJQT4I dtFhSK25NMqfwVB17wdxlEnUXHXWFNGD6zXd9cenFh0BfW4HcylsBuhUL47y6D9sonHsF Kwd7e8jYYsy5ddTxBFnlkhj9iLalWDaAzFAIwww/+zaAZBZuupejRI+UEJc78/GPQTLBE 3H/ucVFwRYlvQ5FHfuUIA7rmOVub1xYnS1T5CZRerr80F71xtpKCbrA1CAg+HEDUML1Tg amz393SrViAHpmnYLfSWg+6VOzo0kVHJbOyiBSk4Q+Hya/GwihrBwieRMQG/DuWOrIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133020; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Authority-Analysis:X-Proofpoint-ORIG-GUID: X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=autCF3ozaFZMB8OqZ4K4b5lJITxWNwwscQ2BydPnkGw=; b=qqTzdFlkhNZjprNxAzUUOoVV5CXm/WIKwe11jCCs+XyCBsSy+80iejWx6hlTFtX/bqJY OHgxPd2Pe1A4tARXCk8z5DLPWXKyrbF+7UKJt6CofGCuxL88KP5OI+WpvOR5M+De6/iRt J5d+QG41XLQX79rfo7YeLojEd1QROk8sePpE/5IcxstQNHwmbDVwhQbfOQWKLd81BlN3t q7wNQPXlFkJskVWGO9qlzdMv+fPKEO4eF1JL77w1NLiVIDbex/8ajQyuLmIE0MNBkAoQn i4y+CNiCtlJVwr3vkjMfKcOT30Ouyu6BgDbJcjMc3eXoT4/u9pQWRiMueiLPOffc8Hw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=XcrJP7Nl; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=IRVSfDvW; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CA88606A6BE for ; Tue, 1 Dec 2026 13:50:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2CA88606A6BE Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=XcrJP7Nl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=IRVSfDvW Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B1D1aWs1172501 for ; Tue, 1 Dec 2026 13:50: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= autCF3ozaFZMB8OqZ4K4b5lJITxWNwwscQ2BydPnkGw=; b=XcrJP7NlQFZYMeP5 +XXeyYX/VhMBCXkgp+IyTgFfE56g7zTWsaIXXTRvTtmcjOLdcBQJad0wnJUSe/yF 7Wpf5UWejhx3xDYxbDF4HZraOmdpqlhG9Y/CfEO/VTx6x77LLBnNzHAyQkVKYheS tL1sYK7apZeVBzx0gbkl5vJp1EZeaadV4PznNl2eptk29IpWF6HBFRP7hXDn5W49 P4DQBoK+iIKYyHjoIZfXrgBcTwwiC8pv1XsZEw1SqbvyGY2JmM6vCw0f5ZwtVzhz bbhy0rnuG7PoUy4kZlIfbfddzhk9UE5lbktb0pBdvSgAvqwOvjAjH0EDcEpacz0b F2Qc0w== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9pts2a0x-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 13:50:18 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2f02c63901aso107608575ad.3 for ; Tue, 01 Dec 2026 05:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796133018; x=1796737818; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=autCF3ozaFZMB8OqZ4K4b5lJITxWNwwscQ2BydPnkGw=; b=IRVSfDvWGydy4zKPc3XBC0fhLcvUhMbevsKxTqsHYQW8TcmRVBKz/7GKYhTUMMGu/Z MlOHaZclIRHMUo+nWSXEoPYrFwF5fiWwAmcIEJrjRJmeweYtfSXczAdrjBaq6LYSvf8x ATvfZxCsqCaXzBLvBaHuQbTMcTm8cFWs9vKRnO5j4zZJgN/mhshC+FLyg7+eVG7sHd4k YVk8SJF5K+8sN6niceyb/ZvS4dXiRChVWZdUdAol3dlUKcZzCJmL7MPwinEbgqF4ujCM B337llnUYFLWaXFkkNLWeme0rD1l1obq68qM6b/dJY8+CyIP1bGBRAeETnn7Fd6jNS0w vzIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796133018; x=1796737818; h=content-transfer-encoding:content-type: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:content-type; bh=autCF3ozaFZMB8OqZ4K4b5lJITxWNwwscQ2BydPnkGw=; b=24kPZVujBbrdq7InhVU4F3xlS5yvGXbZkN4LXQcfxj0e9sV2E+mHprVn7E1dTYbxTK Ss97qQ/0PNtsJh4sejfF0M9iYQC+I2XbZwuFrJUlG5/v7MHNYCOHuGe5XwW8ajeYKAuH elwA7huPG4XbtN94PONT88EL/otNvBW9iXy0Dh/omMskH+Wa9pF+u6TcVm8OSAyDxG7V Coa75B52Ja88VJWzHWeGD0PbHaW7hcirmiE19BJwcGOpLW1Q/Yi7clUjR2HUOSDJiJnz iTbDmUT1mvc892KoJpPHty4Rt2ZJMj8MuyNuEn9gg5/rhmhpCJC2t0376rNoPg32ynLK 83xw== X-Forwarded-Encrypted: i=1; AL+hErH2Bosnn6CC1H0DL416c3jkkMRQynC4AMy7/sE3fz+croBcVxNq0D5XGd+EBPYaZ4axDOp2fAko290p1Fo=@vger.kernel.org X-Gm-Message-State: APuU4Z+Lzl2mLPQPEmgrY3d/ajKs2injIDyLBIF+NIIpnu4caorxU2Bd 8FVYviMD4bKqL+y+duDC5hH9mxSfOGwetSSZYh/6WdaL9rE4Rpg3Yea6V/W5Vf0HKeeeiFp+2Jq nw9tdkjukaSLdodYnbn0lxjBtsXhNtDYwSfe6X1I47bIRN+mt7vKlfH7B4AkVzu5Te+Q= X-Gm-Gg: AZFdTZdnVXr05CwW8R8dg0SElAAWf59T75K7leqHKmWFdRfBmX0iaZzT+9IdyXMpVuZ vPEBNC3exZsJGLXgxv9TfGzlR+OEv7QjJgMZbEbt4nZy//iy9w0Yzzm1fpNDtt2DRdQt6LGvUK5 U1q12txSZVdHo0i9uRyaYp2tveoKeyZAPtzCGmLwC6WVmMhEnKycd3BIiGko7CIgaALP3EZ1eUr EedhkR416VHVRkMc7jfvoUQv5TKF3uwt1V1VJd/c8YketZerv9DwVx1fqId0uPRH65QrreV3TLK BoAPOwdcREgivjj0845Q8jf1ACPpDnXK8XiPkoCcMer/nXDhEW0hDAEw2+qXRWQI/Q0WbeDC5WA E2PtvjssSj3yL1ylNfahZ6k+BKaLAGDLHh13xcOxPGhnU3tGxq4vRX74jBE+vn7AL8ADsAPdR9A cQWPusWqU6+KXg6rtEAjZqyXlohsg/jFevno5+B3tFIkA= X-Received: by 2002:a17:90b:5109:b0:3ac:9c37:942e with SMTP id 98e67ed59e1d1-3b41c953f98mr39804389a91.49.1796133017606; Tue, 01 Dec 2026 05:50:17 -0800 (PST) X-Received: by 2002:a17:90b:5109:b0:3ac:9c37:942e with SMTP id 98e67ed59e1d1-3b41c953f98mr39804357a91.49.1796133017032; Tue, 01 Dec 2026 05:50:17 -0800 (PST) Received: from [10.133.33.245] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b405ecbd0bsm60683589a91.15.2026.12.01.05.50.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 05:50:16 -0800 (PST) Message-ID: <0085e298-fe27-4e10-8e8b-0bde027df5e2@oss.qualcomm.com> Date: Tue, 1 Dec 2026 21:50:12 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] opp: Allow multiple clocks for primary clock operations To: Chuan Liu , Viresh Kumar Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhongqiu Han References: <20261201-opp_core-v1-1-c43c8f010b5f@amlogic.com> <142270f1-f22c-4264-b141-6b67c3d3fc61@amlogic.com> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <142270f1-f22c-4264-b141-6b67c3d3fc61@amlogic.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA1NCBTYWx0ZWRfXzA0JIReDAnFb cfYNTNwXXoS5jFipNzzglZ4eBG1HO4Fxb3+gyBD0uzkc7ysbF5QQvpLNopYXTG9mpxovlqicjyF HDSCPXcTw1zer8APSwiL3LZjGUGtpoo3DiDLxEMzPndau31gqMB1eNAxiUb8/ZQifCvSPA+BEP5 RWwOyfUWULwgO+bj56XqorLCYydLjPAhUJw7+erShoF4oBjpyHC1JAe2ry2MCuYhn/LuBcASntL gsWNlnonLFu+5MPVBL9o9sIwz15OwANFb75vrPF57zwv+8DeYQfjfC+1fNNxIuGQ7zfTCXt3NAg 0/r4iuPV7/K42K5NPRMrvcQL+Pn5Yz0ulLTEU3DiDhYGaRS9AKEZyl73ypydYLpKeXRpsw6FkCH kGOfvFCauuwTxgvN9S47mfkUCcTN9kB9ZwDe/BKsndpx67OSCxHql3hZogdUW5BRh2HE0Y2tG99 4rpIIaKTi9q7rJJaJVg== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA1NCBTYWx0ZWRfX+sWOWxYjLjKT ULgjhKXGkD+ac1Qzpu/aFqPNLf/C7h3W+60mPwlaOr6plDCj9CNuoRGWjSNEYEt9EodQpClMg/e nHJM6yoY1D8PiIGczeRndp0BCCZ0/6g= X-Authority-Analysis: v=2.4 cv=Cqoq4X4D c=1 sm=1 tr=0 ts=6b0ed09a cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=iwHfj0v4dbTm0dfxz50A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: upwJu5bXPdYXnY_19m0hnziBzKvbzgZJ X-Proofpoint-GUID: upwJu5bXPdYXnY_19m0hnziBzKvbzgZJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010054 On 12/1/2026 9:01 PM, Chuan Liu wrote: > Hi Viresh, > > Thanks for your review. > > On 12/1/2026 6:12 PM, Viresh Kumar wrote: >> [ EXTERNAL EMAIL ] >> >> On 01-12-26, 17:34, Chuan Liu via B4 Relay wrote: >>> @@ -2376,24 +2376,24 @@ static int _opp_set_clknames(struct opp_table >>> *opp_table, struct device *dev, >>>        opp_table->clk_count = count; >>>        opp_table->config_clks = config_clks; >>> >>> +     /* >>> +      * We could have just dropped the "clk" field and used "clks" >>> +      * everywhere. Instead we kept the "clk" field around for >>> +      * following reasons: >>> +      * >>> +      * - avoiding clks[0] everywhere else. >>> +      * - not running single clk helpers for multiple clk usecase by >>> +      *   mistake. >>> +      * >>> +      * Since some OPP helpers still rely on the primary clock, update >>> +      * the "clk" pointer to the first clock. >>> +      */ >>> +     opp_table->clk = opp_table->clks[0]; >>> + >>>        /* Set generic single clk set here */ >>>        if (count == 1) { >>>                if (!opp_table->config_clks) >>>                        opp_table->config_clks = _opp_config_clk_single; >>> - >>> -             /* >>> -              * We could have just dropped the "clk" field and used >>> "clks" >>> -              * everywhere. Instead we kept the "clk" field around for >>> -              * following reasons: >>> -              * >>> -              * - avoiding clks[0] everywhere else. >>> -              * - not running single clk helpers for multiple clk >>> usecase by >>> -              *   mistake. >>> -              * >>> -              * Since this is single-clk case, just update the clk >>> pointer >>> -              * too. >>> -              */ >>> -             opp_table->clk = opp_table->clks[0]; >> >> Why is this change required ? > > OPP core uses opp_table->clk as the primary clock in several paths, e.g.: > >   dev_pm_opp_set_rate() >     -> clk_round_rate(opp_table->clk, target_freq) [1] >     -> _set_opp() >        -> _find_current_opp() >           -> IS_ERR(opp_table->clk) / clk_get_rate(opp_table->clk) [2] > > Without this hunk, ->clk stays at ERR_PTR(-ENODEV) for multi-clk tables. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > tree/drivers/opp/core.c?h=v7.4-rc5#n1439 > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > tree/drivers/opp/core.c?h=v7.4-rc5#n1245 > If making ->clk the primary clock for multi-clk tables is acceptable, the "not running single clk helpers for multiple clk usecase by mistake" bullet in the comment above would be stale, and the @clk kerneldoc in opp.h ("for single clock") would need an update too. -- Thx and BRs, Zhongqiu Han