Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp353963lqp; Tue, 11 Jun 2024 06:40:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiFzj9veE9sSpGKBiyUON/E9GsHydiAhNoYAAOcfxFvSmjMAwSWVjzYbigM73wGtafh8PBfI7WfyFu0eyRebJ+xrvAWGpg/lKf2XXzGA== X-Google-Smtp-Source: AGHT+IFxmjlWYeukvXIzI+UdJ6ahu57xCIg0bSc9dWHUdjbslo97yn/FzLxVI2wJpCylxgwnUXLL X-Received: by 2002:a50:9b11:0:b0:57c:605c:e23f with SMTP id 4fb4d7f45d1cf-57c605ce464mr7311509a12.33.1718113227132; Tue, 11 Jun 2024 06:40:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718113227; cv=pass; d=google.com; s=arc-20160816; b=kh/SjTyMq/5KdXT535KaLmmZygsG/oBQNxdrP7+6wO4nqUqsL6zzj9XD+c+sz7biKk gfIqxoiCkzB9XeX/mFkhks6ocUFqibiUEa4TARhzMo8DQSWFVF1s4pm+s38AN0a4VyU6 nmBtLMDAyYozlb13wuE0Irk//Z6VprsHuMmRhPfqNtYAUoAfoOv/WwFnqktPTFLFKRZX oe77IOZouT1xOxDE0L4fZgCC6Xr7qx8GiwyOHvPQGrsJf1vPw+94w6GU92ndtS98V022 bNzXmjuqMrN5SsTxJdaullBBnKp+PWOdxKOGdmo36ppT9xbhM6LEBUSTaD1Jea+uafnx tSyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uwg2nPAtovzEJcPR/iAln7nf9rw6MMGimGMwAc/Vbo4=; fh=qI75ngpYFqLEOdJ9Uo/tWT5aBLDKN9rCN8xVQc43KEo=; b=tymDGNb4VsAKmty810zIi7GyVWtIt31rBDlK9eHJ6vITkaRNYUBTo9bBOv7JIpOCZ2 bx/pJwyKFGsaKSBKV2VEq9sVDLmbI96IPrVg93PP8NZcnpjPH70y0TjbfJpe6k4DNPgR ek8wuPIgrwhlJ38hR5SZgnccxWex6clqZjN/9pti2U5LNr7suCiyGbaeUdAIR8qpcX+k vy4wyE3q44SVg9XWNmKcUXfBL5PpKSFoOzJjGnYDwV09DSvhKfdyvqN+exlq2s1//BtR FngAXxt7f/6nROa4PH5xKb3se/SSYnv8HRT5LjgRXa8GEnX310DXPgdMKIqiN0yzoQGU PmxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cHz6+z82; 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-kernel+bounces-209977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209977-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c6f26882dsi3726016a12.3.2024.06.11.06.40.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cHz6+z82; 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-kernel+bounces-209977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209977-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 E9DBA1F24E7E for ; Tue, 11 Jun 2024 13:39:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E47B817D355; Tue, 11 Jun 2024 13:39:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cHz6+z82" 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 83A3817CA13; Tue, 11 Jun 2024 13:38:59 +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=1718113141; cv=none; b=qCy1NDcy+BN190yqkCvPJgFF3RBH5z3gFpQoCNAaZpM7By+6gsiMdd/ZQMd+ZSUVIKLj79rUV5v/hc1Dm7LDBl/z6hZiWmSSTRHFiXIF5CYuhRMzOw3jLav7OHkOZW/VHolriCPTsEMngVXnBaISe67HP6bOhb2pkf8Wb8ThayA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718113141; c=relaxed/simple; bh=8sPQFZTSB2yrnIdnQc+GIDziU78/L8MOuVKAI1KIt30=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XPcLGps0OWrdkFv5sqdw2NB9gSkX/n49gFClg7l/ic7lEiQgFqwdNucuJX6dKFjMhYZIZ/rntuAQR8V6jFR0pm1rQmsVohq5Wh8DgPXTOtxFk80xmaU0cAmIkmaly+MNP0mdgSfRgjUXrMPg0QH7rlTWgPOgcQEElLYeY5zvu28= 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=cHz6+z82; arc=none smtp.client-ip=205.220.168.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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45B4bQWg030738; Tue, 11 Jun 2024 13:38:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= uwg2nPAtovzEJcPR/iAln7nf9rw6MMGimGMwAc/Vbo4=; b=cHz6+z828PfheWWm XER8yvU49sWW/m7YiKaczDGCnbyzEP93BKDTXZZqOgBaCv3TuNuBFTV6FXgFfTFT fJuNcLVf6JwBgSZUV8t1kvQM4jgAlMRtmpiWljvIdxm4iopSZ5eiZHj8S8RMWop1 MVzQ5KNIZOKzxGft4ozl/QnN+jrS0BvYQIReIzW7B6Plh54SmXwZZdlOLyT73f0+ wggmTbQoa5rfsGp3yUBf9tnpbbHbvQTQI6XPRpmBAclx4DcvG/deEdVpEHCYJY74 EqDWBVVvbek3Tdj2zuXVSZi8NRXE2EVkoclu0Xch/wqcwUhATBYToLsL+TCNxLWW n361Og== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yme8ry255-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 13:38:54 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45BDcrXO022598 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 13:38:53 GMT Received: from hu-ajipan-hyd.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 11 Jun 2024 06:38:48 -0700 From: Ajit Pandey To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Vladimir Zapolskiy CC: , , , , Taniya Das , Jagadeesh Kona , Imran Shaik , Satya Priya Kakitapalli , Ajit Pandey , , Dmitry Baryshkov Subject: [PATCH V4 1/8] clk: qcom: clk-alpha-pll: Fix CAL_L_VAL override for LUCID EVO PLL Date: Tue, 11 Jun 2024 19:07:45 +0530 Message-ID: <20240611133752.2192401-2-quic_ajipan@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240611133752.2192401-1-quic_ajipan@quicinc.com> References: <20240611133752.2192401-1-quic_ajipan@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 8Y2NsPTIkWQUnvrqYCkOnmfmQ_ggO3go X-Proofpoint-GUID: 8Y2NsPTIkWQUnvrqYCkOnmfmQ_ggO3go X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-11_07,2024-06-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 suspectscore=0 bulkscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406110099 In LUCID EVO PLL CAL_L_VAL and L_VAL bitfields are part of single PLL_L_VAL register. Update for L_VAL bitfield values in PLL_L_VAL register using regmap_write() API in __alpha_pll_trion_set_rate callback will override LUCID EVO PLL initial configuration related to PLL_CAL_L_VAL bit fields in PLL_L_VAL register. Observed random PLL lock failures during PLL enable due to such override in PLL calibration value. Use regmap_update_bits() with L_VAL bitfield mask instead of regmap_write() API to update only PLL_L_VAL bitfields in __alpha_pll_trion_set_rate callback. Fixes: 260e36606a03 ("clk: qcom: clk-alpha-pll: add Lucid EVO PLL configuration interfaces") Cc: stable@vger.kernel.org Signed-off-by: Ajit Pandey Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-alpha-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index c51647e37df8..a538559caaa0 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -1665,7 +1665,7 @@ static int __alpha_pll_trion_set_rate(struct clk_hw *hw, unsigned long rate, if (ret < 0) return ret; - regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l); + regmap_update_bits(pll->clkr.regmap, PLL_L_VAL(pll), LUCID_EVO_PLL_L_VAL_MASK, l); regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a); /* Latch the PLL input */ -- 2.25.1