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 498D71E9B2D for ; Fri, 2 May 2025 10:38:15 +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=1746182297; cv=none; b=KG45PK+z1hgJPy1doFA6Rl4jyiqytIl8SpCDmNIxJaHfCLN1Zrq10JEe0WIOtGPZSiyByOshFGEgepAVLaVCnWV03ofw6EQyi4kzsi9imWoxHjF9HaW/CgD/k4ThaQHt/CLNiEQn0wfWsbKGJG/IxIQy7UaDZ/jaXEswZiagJpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746182297; c=relaxed/simple; bh=Dsp/Vg3p6mjWb/dCOEj15xgjKuqN4noVHOK2BkCe6n0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qeCQt6Q5zC3IP2p6uZFDtF3C98PIxM6biB74zXmYN4oitLOR8Ku3KEVaqAUOQNFL1thimpfwWj+8UB04ITUKnnLq9QcYaif79YGvnX7hcC7w+wmvp2TrtKBFiZuQpT6UyTJMsxB70tGSdW38fEdRP+mslg+ZxHjsVBg/DZoLF+U= 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=dpNExA7J; 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="dpNExA7J" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5421N7a7015414 for ; Fri, 2 May 2025 10:38:15 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= 27eve1BdY3tnRAGhbk65ewCzrhADgzBYCgA51jfhing=; b=dpNExA7JoWLT/JyH x7iXR1JkA+iVcobGXUWBiJBKDGHwoZFbCt3wgauV3xs1Vpd4wupWuTcI49WMlIly KP1kFhOZWabqGmeGQHRc2UXDN9XIY7ScYTQpFSyakfqjAVLBVIScXR9fer0i9M9P 8DmqtacryeGMu5zRLxh9e3Gymqwba5LgIQCbP/BAGCl8GduE7FtILmh1HaMek5l0 u9C+EZl91iD+z0EyFTf/b3jJ88WnD0pMwT5AgJsemlQmDfBpAJqVsQhcAy4LOSmA 52oaYuqEi00BFoSkSBS+AgoA6dmio7m8SxPWxj7On7xx76Y65SxaG3MSNwmAz5So 5ZkXow== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46b6u4g0sd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 02 May 2025 10:38:15 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-476786e50d9so5582331cf.1 for ; Fri, 02 May 2025 03:38:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746182294; x=1746787094; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=27eve1BdY3tnRAGhbk65ewCzrhADgzBYCgA51jfhing=; b=GztLPC8XwpGV5tkYS1M6a7eSxX29KQ0t/Lylcs0A6Q6/LYcy+28FQrJSQbK9dSztzp 8YosgDx7Wafr8VtX4WWUAK+OXRnFsKES2GhY5+c9yDmSwfP5iTqWHGjQ9mBmtqDNm30Y ATmNzTo7fp0qOllxQdiH7J257A+dEtbv9rbePdKnFWYvlqbCc+U31AIALVlWSfG0bzYk oqcGaSRwa98ASjZ0JsFdGeR0AwtYGzhtBO0Wsm7g26lGVyAcit4CKIPxPKcmY8l7AP52 0RT7VG1Ttpy5KEXzB3bwymINF3G7qDj2BS3TEtBr+LpdIiNdYWjFVUEDTJF3JM/XxAKb JGJA== X-Forwarded-Encrypted: i=1; AJvYcCXGDw6OqfD2rCMEEGeN6km8WI5be40W0fHzR2OeIs3MZbdQPGrOmXnBvT7bqXsOOyun3BbTVdOFx7o=@vger.kernel.org X-Gm-Message-State: AOJu0YxJbOhdr5uXll+28lhsN26lwceA/pr7gE83ZNknIeQqTBld5RAh pgCj1QE4gsiNynIqsnm2J1gnG6wimwBe5bGkDKuPUyYv9awDDDe0vaUrJnJxH/IT/vnMlY92FX1 zBR6N0lI4MOP3WGOtKzlNyhnzRhzZm7m3gNCBg5mgyuJZO/zS58z8niYwWK4= X-Gm-Gg: ASbGnctyRPNm2MiIRt5TflL7sjutQAz2aiDeDGbP2XvzvRCz7BqrDUaOi5oNyOI1vz5 R5thde8wsD53SVSv+tQkrlHQpMmpXRcjG9uz65b5MsISsyi/armfPd/JdErgwaFKIs0VDBkLpiP 5/cNdvLyu8lk1xdFB2a0QGwTFTk6dBLnAAuwdSmI/cXCToe+hBfaJVsFPK+qVxJ021LNSVpm7NF Vdekf23ULzprb7AWbNOWuenqnBUr8iC2fPlXdAeTr/4reGjtwAJCio0xBdy6KaFKqvUqRYyrjKp iD15229uVXwUaGAkX9DgaFmoHpf1UlohMU3EBzz0CmiyL5XgKwb+bsLHnOjmGCV+Ank= X-Received: by 2002:ac8:5746:0:b0:472:1d00:1faa with SMTP id d75a77b69052e-48c32ec0727mr11918961cf.13.1746182293947; Fri, 02 May 2025 03:38:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKHvEk56VJXvXDqb2SGsRRKO8oGVRV2j6K8YXDo+30VsX8SRDqdBcc7f+npY1XAg3WGjVVIQ== X-Received: by 2002:ac8:5746:0:b0:472:1d00:1faa with SMTP id d75a77b69052e-48c32ec0727mr11918771cf.13.1746182293538; Fri, 02 May 2025 03:38:13 -0700 (PDT) Received: from [192.168.65.113] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad1891a3bf9sm30951066b.50.2025.05.02.03.38.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 May 2025 03:38:13 -0700 (PDT) Message-ID: Date: Fri, 2 May 2025 12:38:10 +0200 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/6] clk: qcom: ipq-cmn-pll: Add IPQ5018 SoC support To: george.moussalem@outlook.com, Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Luo Jie , Lee Jones , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250502-ipq5018-cmn-pll-v1-0-27902c1c4071@outlook.com> <20250502-ipq5018-cmn-pll-v1-3-27902c1c4071@outlook.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20250502-ipq5018-cmn-pll-v1-3-27902c1c4071@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: BgNjjZuIXSxteRo-AHPl6AmJ1tIctp_Z X-Authority-Analysis: v=2.4 cv=Yaq95xRf c=1 sm=1 tr=0 ts=6814a097 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=UqCG9HQmAAAA:8 a=Mz09UsMhJyW2FU7oNKkA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTAyMDA4MyBTYWx0ZWRfXxiQz/y36WCoc cGRdzJ6L8w/WHxJKZVKFrbjK0PkFQg6DWWWfKE1tXBkiEkpT6G6SBkgfTfNPwobDls5jpeN5p/j ufSI2T6BVm2mz3UvOHnEBWb4CuSAjedTe5SItIu7+ydQ087t6XkoDyrh6YPMAEyjUwe45KccOHT AqsD7n978hR8vBE3tDj3p/BKE3obSeM6mNeJMzEbiDHWgWhMyvKFCYcBNGx88rZXrM0CODeSLbv 89bX2YMEc/eUqS8EaA1/SzNKTMAVCpAYo5E+WWzPAFgLDDlFyOTQR58EpiLga3UOail78OsRu8d YOhXTfzm3JgDr7YLwU/gmKPal86XyiWPD3RyuMkXjJwXKojn6xEg1A7Xc/abQKsgaiwliX8QkFY O0D52JDsh14dXYfD/VZ5/OE9Kzw0ctAqd8zitWWh3o9MVl3BDOpHEZdaiwiWK1773FGki1pF X-Proofpoint-GUID: BgNjjZuIXSxteRo-AHPl6AmJ1tIctp_Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-02_01,2025-04-30_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0 mlxlogscore=704 malwarescore=0 mlxscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505020083 On 5/2/25 12:15 PM, George Moussalem via B4 Relay wrote: > From: George Moussalem > > The CMN PLL in IPQ5018 SoC supplies fixed clocks to XO, sleep, and the > ethernet block. The CMN PLL to the ethernet block must be enabled first > by setting a specific register in the TCSR area set in the device tree. > > Signed-off-by: George Moussalem > --- [...] > +static inline int ipq_cmn_pll_eth_enable(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + unsigned int cmn_pll_offset; > + struct regmap *tcsr; > + int ret; > + > + tcsr = syscon_regmap_lookup_by_phandle_args(dev->of_node, "qcom,cmn-pll-eth-enable", > + 1, &cmn_pll_offset); So we have syscon_regmap_lookup_by_phandle_args() and syscon_regmap_lookup_by_phandle_optional(), but we could also use a syscon_regmap_lookup_by_phandle_args_optional() - could you add that in drivers/mfd/syscon.c? > + if (IS_ERR(tcsr)) { > + ret = PTR_ERR(tcsr); > + /* > + * continue if -ENODEV is returned as not all IPQ SoCs > + * need to enable CMN PLL. If it's another error, return it. > + */ > + if (ret == -ENODEV) > + tcsr = NULL; > + else > + return ret; > + } > + > + if (tcsr) { > + ret = regmap_update_bits(tcsr, cmn_pll_offset + TCSR_CMN_PLL_ETH, I think it's better to just pass the exact register that we need, instead of some loosely defined subregion - especially given the structure likely will change across platforms > + TCSR_CMN_PLL_ETH_ENABLE, TCSR_CMN_PLL_ETH_ENABLE); regmap_set_bits() > + if (ret) > + return ret; You can initialize ret to 0 and return ret below, unconditionally > + } > + > + return 0; > +} > + > static int ipq_cmn_pll_clk_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > int ret; > > + ret = ipq_cmn_pll_eth_enable(pdev); > + if (ret) > + return dev_err_probe(dev, ret, > + "Fail to enable CMN PLL to ethernet"); Fail*ed* Konrad