From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 51A88388880 for ; Sat, 1 Aug 2026 20:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785615054; cv=none; b=uh3JO/wX4Rg5HXVITjseQYBZQa+1U91wPNEHZ+lghNNHBk9cFgysZgwF3T/mt/e3F9/8Ga+pS9zp9GQ7jONRGMYrS4Fxo2cN7gidAOUm2hKvGFyxWN8aZSvxTQA5t30/WBarinVOKfxCyUHFo7mzMRvIMKxyN2zQA15WedbvdxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785615054; c=relaxed/simple; bh=22+zTcgK8gKfK8bb+q6OFUiVpOFTKsJSlPJvbRHYQGk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=XtRJodPKKxZWKU2b1+r/WKZd7CoAabzRYxaIQ4cnTobUvWx1le+CTvoupErXS6QaByB+j0pn4+XEm7ctfF9otMuZdC+6nqbUBLOgS1y+viXXRZd1t28unfHAQqjllglHPsBq/ZBoEHjwBbcMGWSkA0Ajds/XHmletAlitg7EvYo= 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=UoP6Rlu6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WMaJpwU7; arc=none smtp.client-ip=205.220.180.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="UoP6Rlu6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WMaJpwU7" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671Ixj2N3716376 for ; Sat, 1 Aug 2026 20:10:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=jKyjyTHl2oXoRPvQdXSPBF szW+NcfRowoAcS6ytu1Zo=; b=UoP6Rlu6RMnOeDBwCOzo7/DVabATILOEY8WDcF BwMBg/a0epxyReD18GJy2zrSLxEGqFys3uQujiikBC7NasQgVPXoHGP1CE2eiKf8 O7P9WC0ww1R2yJ25DxJPdt5y9Fu6tLzb29TOmLISTKYq0jSPeG36ZFEdmFppwVVJ s/dlwNidNe9H0OQ8lik/SEsMgbO3hutdqArKTJduTGa2IDZmYXEn/M0bzzLdYzfG pPa7QPeE1XQZLBFfxsjaL4/7/Juu0zRMArTK8+Q87Ri/+xY19w4ZX6PIBqx7J3VD tCzIG25EqsrOYL5bKBOWe9j6OJ1lPg13TKkXMxeW1QHGbf2A== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fs8r6hnfg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 01 Aug 2026 20:10:51 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-8ef8249f73fso38080566d6.0 for ; Sat, 01 Aug 2026 13:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785615050; x=1786219850; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=jKyjyTHl2oXoRPvQdXSPBFszW+NcfRowoAcS6ytu1Zo=; b=WMaJpwU7dRb/j9CMOcsthIheHhicVXK9OFrMuWVurfB58zsbOoEQNWUtsi2MY5BGVX 86H/Ntig0dtKoXQhZIqxBOCPsP1DDRcvt/AgjppQ0Dx57yTEFy+H/k6WcOOEhXO+pewN Bm0OjMNl7ie+CYWFcdwENkP8N2FhJlySFgjCPtjZXvRyMOIDP50g/vRbzWZ3nVC2ShQj 9Boq8JE6iCEcLA1zjTl4uDFUrrBjz9wVVqA94wyMS983ED7JpsdU6A+/V86f01W4dvSH 7xZWuMHmPdqoZUd1lRet4I97eeSuSFPC41axlj8KwbqW0NRGrpTeLNvoybbFTL57EZ3a lVfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785615050; x=1786219850; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=jKyjyTHl2oXoRPvQdXSPBFszW+NcfRowoAcS6ytu1Zo=; b=AGqI5dnGi1Cx0+/ptKgiIR/HhIQryeH3mD/If3xY+C0LvCGRNDLdOIBXmi/LutFKHo MT9lqmNelW0AuAawLJ4WnftJMDhaa6wsj3TTTQ5pWXsFpaSBwXIrW3KH63ZoiCQBicPd ow4IkeI8bRzKXlMvw/kc07OkCeyvq65vXK3NYtNi59NSqlxZND34hM8AM/aIz9ZDmGqN GKnZ9N3nkydzdPcinIgeq8OwP3WGSNHoF9MEpI+terw/qNK8uPjsNPeEiOvsDU+FIDg7 d0GsPkG4xv0zG8DuAr3U98N7fL6yynbJsBFpQhybpQGZ4BIceCYkC49ihoICF9TU0MMJ tXPw== X-Forwarded-Encrypted: i=1; AHgh+Rr5FVfY70x9xlqEqORXU6pVw7nKWTjjgs3yEQYu7DP8h/A981qTKqahjGbZNzdNsznpB8QHQ1niPof4bGE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8Uq+1Qa/iG9tNbEvxzV7MdfX0qfWgAkZlqem+cPqbWDI36hwO kbVEPrQNaZ/LsKxJvW6HGgmjYvpc+dwCB1VUR1FegzCC2/xAfSvhuTo4qc5vB6xqRwGaqTx1UNq Skh3n9z5QO4HWOtsr+tTE1MKaZ+Kyfj4zjK1S7Vsd4xeVum4N1qokSSRgTiSbTWbfAw4= X-Gm-Gg: AR+sD11+gSaJTbizqRuahI1NErIuuSpYMChU0+xLLt+PYhhyBb9Z8OAAZHRbbHTg6fR IKJ4B8qshM+wjAUPpPAEsCJ/ynVnmbs9v9LiqRzEJ1u+B3l8+pQLlPZ3L1T6FgfhqsUO2tX7FHa plaMuoJsl1eb44Ti0DjBNyjAH94W5zW5V1hAwyICAlMM+rlCodokeiI/guVjvwGLDwPw35Odg+h 7Bo6A6CDCO5gd8JotaPtzNFWZTchqDJdKcRTJZF9qg3OzfU8B6b5CbpKdCD5jVJhIXq238bOp0E alrqJaGfTtmLwzdnBLxePNER2xENOIBCv+oQ1NevIEF2QcXzZKA9Lp047+UteYbDgmM6Wc9wTZF nnMYl/8tySF68eIO0aLY2psP+Ry7RIvYfIis1neLe9zXHWwk1dy7SAy+2Qx5H5vGTAWUt5TNgmg M/h61OjDXeQDLJVDclGnfSNedaNHfsbKu08pcz3apdB/Bao3MmdJ3O X-Received: by 2002:a05:622b:89:10b0:52b:6543:d8a with SMTP id d75a77b69052e-52b654316e8mr27140881cf.26.1785615050446; Sat, 01 Aug 2026 13:10:50 -0700 (PDT) X-Received: by 2002:a05:622b:89:10b0:52b:6543:d8a with SMTP id d75a77b69052e-52b654316e8mr27140481cf.26.1785615050027; Sat, 01 Aug 2026 13:10:50 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:61cd:dcd3:c61a:ac3c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1fd4537755sm358499066b.54.2026.08.01.13.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 13:10:48 -0700 (PDT) From: Loic Poulain Subject: [PATCH v4 0/5] i2c: qcom-cci: Enforce the required CCI clock rate Date: Sat, 01 Aug 2026 22:10:42 +0200 Message-Id: <20260801-cci-clk-fix-v4-0-e1d80da54e01@oss.qualcomm.com> 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 X-B4-Tracking: v=1; b=H4sIAMJSbmoC/3XMTQ6CMBCG4auYri3pD6XgynsYF6VMpRGottpoC He3sIIEN5O8XzLPiAJ4CwGdDiPyEG2wbkiRHw9It2q4AbZNasQIK4hkFGttse7u2NgPNkBzUTO ljZIofTw8pHnRLtfUrQ0v578LHum87juRYoIFKJClJKRR5dmFkD3fqtOu77N00MxFtibklmCJ0 LwSpWFlTXLxh+BrotoSPBGGa8lpQ0VVwA4xTdMPDuMTFzMBAAA= X-Change-ID: 20260721-cci-clk-fix-fe145b2acfa7 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, vladimir.zapolskiy@linaro.org, konradybcio@kernel.org, stephan.gerhold@linaro.org, Loic Poulain , Konrad Dybcio , Wenmeng Liu X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDE2MiBTYWx0ZWRfX12VVzv37z2mC dhg9vHoE6HtJDg99sScbrYiPVlRw0H5ZhSW90WSEkmivcqmXhaNUVH/DoDN3TXH8ie3Yfkuhmja kx//xOocTt0s8B2lUl2TxXx7iWJL7B0= X-Proofpoint-GUID: dVpozK-r5yxTZCuKtdyJWqYZLRLGyv9w X-Proofpoint-ORIG-GUID: dVpozK-r5yxTZCuKtdyJWqYZLRLGyv9w X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDE2MiBTYWx0ZWRfX2bo+I6+iZ0Ug CLq3P00vvKcKWtyG2Up9qrjm2IKBKXcqH/eNZsiM1UO95mJwsVg8gGY71jhBnUJugCu7dv64C/j bY7nCfX4vDW7Q+8BmabNWoApp3hQL8AOO3pE9jIBqThgZyT+FyTwHbu6pFv7q7MI9AT14U0axRA Bi0pm4s1ceftGPjj7OXIKTvRYwfWOdtTO/sluBqPRjnbZmG4+GMwJ+4PXlWO3FdcRA1vqj3tSxQ qHswtgrXl2+dMnKz9i8stfL3qDqj+oXPkYHsn3n4BxCtr6VeznW0hY31RWldGGzIer+UbSVv+1q NXN7cZScUmwjkGfvMYrmAfYFPUVqRbnFaqskZVa6gfy+TnwJR3vZ0RBOMO1TrVnx/h2VOP//Uak mqphz3E6U7hc2TIZSEDOEKHkKfBQVW6COMZLQaPtpqa0Py/q03yVKcRqt/Ci8Z52w/rN58WBxZy HrF9VrgOaL4vJ8hjt9A== X-Authority-Analysis: v=2.4 cv=Q5ziJY2a c=1 sm=1 tr=0 ts=6a6e52cb cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=BDIs8drXFFqd0dwbxQcA:9 a=QEXdDO2ut3YA:10 a=OIgjcC2v60KrkQgK7BGD:22 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-08-01_03,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010162 The CCI hw_params timing values (thigh, tlow, etc.) are expressed in clock ticks and are only valid at the specific CCI clock rate they were calibrated for. Running at the wrong rate causes incorrect I2C timings that may violate the I2C specification. Today the rate is left to the DT (assigned-clock-rates) or the bootloader, which is fragile: the driver owns the hw_params and should own the clock rate too. - Move the msm8953 to reusing the common v2 config. - Turn the timing table into a two-dimensional [mode][rate] - Add the 19.2 MHz Standard/Fast timing sets for the v2 CCI - Promote v2 to the generic common table for all revisions - Actively enforce the required rate. This ordering also addresses Vladimir's point that the clock rate is a property of the mode/timing settings rather than of the CCI revision. the per-mode [mode][rate] table lands first, and rate enforcement is built on top of it. Patches 2/5 and 4/5 are the result of discussions with Vladimir and some code sharing. I would expect him to add a Co-developed-by and corresponding Signed-off-by tag if he agrees that the submitted implementation still matches his original intent. Signed-off-by: Loic Poulain --- Changes in v4: - Rebase on andy/i2c/i2-next (527dd7fb6209) (Andy) - Add 'select PM_OPP' to i2c qcom cci Kconfig (Andy) - Link to v3: https://lore.kernel.org/r/20260729-cci-clk-fix-v3-0-f3c731d1596e@oss.qualcomm.com Changes in v3: - Reorder the series so per-mode clock support comes before rate enforcement. Introduce a [rate][mode] timing table and select the row matching the running clock rate. (Vladimir) - The per-mode patch only validates the running rate (error out on a missing entry), the following patches enforce it. - Split the addition of the v2 19.2 MHz Standard/Fast timings into its own patch, keeping the [rate][mode] conversion a pure refactor. - Drop the "Revert ... Remove unused struct member cci_clk_rate" patch: the per-mode [mode][rate] table replaces cci_clk_rate entirely. - Introduce a common params table (revision agnostic) (Vladimir) - Link to v2: https://lore.kernel.org/r/20260727-cci-clk-fix-v2-0-c3958f28b045@oss.qualcomm.com Changes in v2: - Instead of adding a 19.2 MHz cci_clk_rate for msm8953, switch it to the v2 config (37.5 MHz). The msm8953 table was internally inconsistent (Standard/Fast for 19.2 MHz, Fast+ for 37.5 MHz), so a single rate could not satisfy all modes. msm8953 is the same HW version as msm8996/sdm630, which already use v2. (Vladimir) - Remove the msm8953 fix tag (Vladimir) - Apply the rate via the OPP framework instead of a bare clk_set_rate(), managing the vote across runtime PM. (Konrad) - Link to v1: https://lore.kernel.org/r/20260721-cci-clk-fix-v1-0-5eae78700da8@oss.qualcomm.com --- Loic Poulain (5): i2c: qcom-cci: Switch msm8953 to the CCI v2 timing/rate config i2c: qcom-cci: Support per-mode CCI clock rates i2c: qcom-cci: Add 19.2 MHz timings for the v2 CCI i2c: qcom-cci: Share the timing table across CCI revisions i2c: qcom-cci: Enforce the required CCI clock rate drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-qcom-cci.c | 333 ++++++++++++++++++++++---------------- 2 files changed, 196 insertions(+), 138 deletions(-) --- base-commit: 527dd7fb6209857f8ff4426055b3a418e60faa8b change-id: 20260721-cci-clk-fix-fe145b2acfa7 Best regards, -- Loic Poulain