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 491C14CA295 for ; Tue, 21 Jul 2026 14:58:32 +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=1784645913; cv=none; b=XkTgywx8F13fN92z4iDV8tJE6nPky8MWfW2TCIuK/RS7d28F98B1Apa6+0zEGR51ZWMXQjBqi0uKt68+MGCKpG4wctG9RRLlXXVEIzzOllGi8bLFjWCyFjJWUEaqZ/lsofgRjFTlGWNwnMIBijVNMsRDOdGrQoxCO2QiMrDRT+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784645913; c=relaxed/simple; bh=XceuDuLrzakfs0zugQBbXJa+oizwCWt+Pl0ZpC7HxL4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ixuykkDFh/91RnzHDTNbdbZjk3u9MsZLTDxiPcH8c2LtsuKK/fd9+dwQifVkgA7V8Gi95bFwqTB5yFgMSY5avkVyPSVL0T00om9myyKSd6JnXUM7WV0xelLpiJObVipvjUIlv9qdxyTVV5t/QpFsvtj8OMEtLYMh0RtwhETXLp0= 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=PDQZyP1a; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cttucgpd; 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="PDQZyP1a"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cttucgpd" 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 66LDg7FX1687576 for ; Tue, 21 Jul 2026 14:58:31 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= K+LK8F70ldltnOCivKw+ePZv3anat5mG9iynUsCcEZU=; b=PDQZyP1a+PemFjTw AQhSirae6PXtc2O2DukzeDWgNvycAuO0bHrzkHmSLrye89JVi7vw8X1lMdkd4EI+ cceh01uxqGDQcDrCpWyI2CVe4FWoRZh8a4HmhW9rqf+F/b4/4bgohBvzOESHiVy9 lhrjhfTVgqdU95qzXfXoCQ7C9EvNmIUCiBbynTq/AtNDB0qcFxzCIdeLxiGrWwOV rHub1ktrI+MP9fkmWqioGMWZE5LKKjN0CD8jGm7nFq+E1aXQ4pjbNf+wO16wfUI+ A3n4e6z9MoteF49osiSBFL3YkZ2891JCQSKKJSF0y/Ir+pgIEM2dBa5ZMb6UlLY9 MMUKvA== 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 4fj9c40h3r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 21 Jul 2026 14:58:31 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51ebdfceddcso135932201cf.3 for ; Tue, 21 Jul 2026 07:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784645911; x=1785250711; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=K+LK8F70ldltnOCivKw+ePZv3anat5mG9iynUsCcEZU=; b=cttucgpdVfJoF9JdXhXeulndM4X+3SCgEt1z1DOs6BZDHKiYVCoVs0U2FE+wr3ecCU mTrbk7DKv3c/w4FaOFbTGDDZiuwrjYbC0f799Ze8JDRFsbTdQga2Uh4IvElxBeEp2zRw 6K5NwkS/5sp9G/vwWlhtQP0iHAn7rIBHWXpmwZ00WDESOisoACIHchiXfL7y9icM5r5I q7R9575ZiikqSr9F6S67J6zFGdWT+ehrkugQwoqJXQxvHAJ9v60/5AvHNtox7+pJomFH +48PfFVX+3AbvZUvDSX/o0nWrrqCNM9PSFzs4vr8CRD3bsKFRBe64sHMdhNKQgVSk1ox 1+iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784645911; x=1785250711; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=K+LK8F70ldltnOCivKw+ePZv3anat5mG9iynUsCcEZU=; b=Oys4/lWBzHo1cLsE2OX9ZPz0TozsZPFM8SPLYfzKymGM4/dxPaO/SAjvneajszgQCS F6IoHCa9KZnx1/ij/60A8kHGsnSxWjVkbx+YVJ7/q/m+NlN7zb6GI0S/qJ0ADKCJDlAG w/VZjTtQxM+1jQPICQB+r7bIEhDktgMfsCsZREp+qjcnD7yla0Vsh51STCbupoxzoihq 6d5aDB3Lpo33yGHt7FMCUHmVgLz/Zkc8g/Dz97L6mlP5NYEMQutpecPIJRlsCozL35qy TVhKpcmVmFYeVrO6Ogg5fDLvwHNx4iyo1PqYiFah8Khs5D6RkkuAedTS8H03RVY/XR+M cA9A== X-Forwarded-Encrypted: i=1; AHgh+RobGgsgu4xYw34uoPgRoV5bGjiQACe2zYSxvfDGKVNEPcne1SCmWw5F1ln/usnbPWh1HugnK92Qg7XG0IQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yz20BbAMsCE3NH1DJ1ol+C8pq7CTGZbg6ZMHnDRkkD3nc4mKERe hHJWJtR5pS8YbyBzEW4pZ62Xuk+FxZn4yduk/L3/PQRBIs5ZoAPJQFErb52rrDHHMpuC6bjl5TQ 0YFllnCGRZpVRa1JIVS8oK0qwNc66uIrCvzeJXMOr6JsWvGV4a7+6FugOiNAPsfTvTZ0= X-Gm-Gg: AfdE7cmFjhvgI704dreRMeCO/REw8EuA/Jpx2oobctlosgjNMABiK/tKiskm5Q8qc4u A+XvWcUUKvs+XT1SIP1L9tetCIlcgE4kylqY572U3UMA2L6IJTJDU4hGGjL17ijXX34RvgVRRtN g+ked+5gC1lhCOYr2Pk1fO965IlQX/K41ITOH82Q4/mQqVIK0kd5Rb+QaN/us3ncDXo/m39k6lt 1V9/KYf5dXzN4pzWNbYBl+WC4dRae4r6WKTJek/JkGs8PSuI53PWhEVmTNaVfBpOBRluODmemeL BBADEjBElbxBcL7hxBeda6wnbuuXtCfTN8UF4qyP+0Tf9AvrPPrfPbQ2FZ6NbEb4G4lUNMeASdr zznVHbpPt7JNJzGEmuG+8FlGL7xyVZWx+kUWZ8fIB1bh9i9PIHyW3HQXxowXbD6ElVAVsNgSwtT 3PlDLlALl1oYn25437Cu9FYtpFqJfDif9sK1bAStjjqO6gG0zBBFg= X-Received: by 2002:a05:622a:909:b0:51a:8c97:938b with SMTP id d75a77b69052e-5213e190f97mr180208091cf.66.1784645909541; Tue, 21 Jul 2026 07:58:29 -0700 (PDT) X-Received: by 2002:a05:622a:909:b0:51a:8c97:938b with SMTP id d75a77b69052e-5213e190f97mr180207641cf.66.1784645909028; Tue, 21 Jul 2026 07:58:29 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:751c:d61c:c91:60dd]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69e6ffbba0fsm5875369a12.17.2026.07.21.07.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 07:58:27 -0700 (PDT) From: Loic Poulain Date: Tue, 21 Jul 2026 16:58:21 +0200 Subject: [PATCH 3/3] i2c: qcom-cci: Fix CCI clock rate enforcement Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260721-cci-clk-fix-v1-3-5eae78700da8@oss.qualcomm.com> References: <20260721-cci-clk-fix-v1-0-5eae78700da8@oss.qualcomm.com> In-Reply-To: <20260721-cci-clk-fix-v1-0-5eae78700da8@oss.qualcomm.com> To: Robert Foss , Andi Shyti , Wolfram Sang , Dmitry Baryshkov , Luca Weiss Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Loic Poulain X-Mailer: b4 0.14.2 X-Authority-Analysis: v=2.4 cv=I4JVgtgg c=1 sm=1 tr=0 ts=6a5f8917 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=fiHgs4EJ_qdzu2AaPLEA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-ORIG-GUID: Kl9zmli9x4buLTvDoWbq5ilCj7N8gH11 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIxMDE1OCBTYWx0ZWRfXxN0leLySecjg RkOkB/igy5YZBdBDauXe0vV+QTqYf8NxFJnMBc5XWYCAu30+PyA96sWuaAfq3xKDVtjJPsj5Te9 nsTEcxCb50tIpeUMeX1VBV9JE3p7m7w943qyvb8agCZ43eduh+uxWht0r4FAgdWXWrqf/p6vrJr MnA7GS//guLKtG0+/k2CYQK+FI8LCOxcvr3GL6e2mDSC/SsaILawEw9aP7FSlHYalAvmccUhp1A dp0pJT+Xck8OyqSkttxdf60oex0Ahoo6+F8vYfNceum7OzBOMZjI9qLNf/ZygM5TVQWHh/yMFeF fDzlIj34GXNlUc5/hNdoVH2AhGPavdeqr0UoJPiE7dITum+AyjLC+ojDUHV2vFbqcS2JBebjSWj T1lILOqWpwugp+x6TMUtWgWgDqUMp0UevDolYDw5Y2FpM9uArkPA+DrLgtZEoSOiNbTHG/ASh5r 7umNY2VJgY96i0pRryQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIxMDE1OCBTYWx0ZWRfX6yLj+XA4nmeJ q/XDAiN0v7a7iNRJ/Phfyb+UUq2QHJTaVX3OiugKWXaEpkmPqxzKq3HNdMExVWMvpik57Up2Xoe W94VOyxKbrhPKka+4Yr4OjS1uil1ZmE= X-Proofpoint-GUID: Kl9zmli9x4buLTvDoWbq5ilCj7N8gH11 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-21_03,2026-07-20_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607210158 The hw_params timing values (thigh, tlow, etc.) are in CCI clock ticks and were calibrated for a specific clock rate per hardware variant. If the clock is running at a different rate the I2C timings will be wrong, potentially violating the I2C specification. Rather than just warning about a mismatch, actively set the clock to the expected rate at probe time. Warn if the rate could not be applied so the user is informed that timings may be incorrect. Signed-off-by: Loic Poulain --- drivers/i2c/busses/i2c-qcom-cci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index 5f74edde8558382e63e2c3d0fbe19489f325e8ce..e001c0d565cebd386fd67b1d9d532360b29c67d0 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -519,6 +519,7 @@ static int cci_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *child; struct resource *r; + struct clk *cci_clk; struct cci *cci; int ret, i; u32 val; @@ -587,6 +588,15 @@ static int cci_probe(struct platform_device *pdev) return dev_err_probe(dev, -EINVAL, "not enough clocks in DT\n"); cci->nclocks = ret; + cci_clk = devm_clk_get(dev, "cci"); + if (IS_ERR(cci_clk)) + return dev_err_probe(dev, PTR_ERR(cci_clk), "failed to get CCI clock\n"); + + clk_set_rate(cci_clk, cci->data->cci_clk_rate); + if (clk_get_rate(cci_clk) != cci->data->cci_clk_rate) + dev_warn(dev, "CCI clock is not at expected %lu Hz\n", + cci->data->cci_clk_rate); + ret = cci_enable_clocks(cci); if (ret < 0) return ret; -- 2.34.1