mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] i2c: qcom-cci: Fix CCI clock rate enforcement
@ 2026-07-27  9:21 Loic Poulain
  2026-07-27  9:21 ` [PATCH v2 1/3] i2c: qcom-cci: Switch msm8953 to the CCI v2 timing/rate config Loic Poulain
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Loic Poulain @ 2026-07-27  9:21 UTC (permalink / raw)
  To: Robert Foss, Andi Shyti, Wolfram Sang, Dmitry Baryshkov, Luca Weiss
  Cc: linux-i2c, linux-arm-msm, linux-kernel, vladimir.zapolskiy,
	Loic Poulain, Wenmeng Liu, Konrad Dybcio

The CCI hw_params timing values (thigh, tlow, etc.) are expressed in
clock ticks and were calibrated for a specific CCI clock frequency per
hardware variant (19.2 MHz for v1/v1.5, 37.5 MHz for v2). Running at the
wrong frequency causes incorrect I2C timings that may violate the I2C
specification.

A previous series removed the cci_clk_rate field and the associated
warning from the driver on the grounds that the warning was noisy and
the rate was already set via assigned-clock-rates in the DT. However,
enforcing a clock frequency configuration through DT is fragile and not
the right approach, the driver owns the hw_params and should own the
clock rate too.

This series first fixes the msm8953 timing table, which is internally
inconsistent (Standard/Fast calibrated for 19.2 MHz but Fast+ for
37.5 MHz), by reusing the v2 config (same hardware version as
msm8996/sdm630). It then reverts the removal of cci_clk_rate and
replaces the passive warn-only approach with an active rate enforcement
at probe time. The rate is applied through the OPP framework so that
boards describing an opp table also get the required power-domain and
regulator votes.

Note: Vladimir suggested selecting the CCI clock rate per I2C mode
(Standard/Fast/Fast+) rather than a single per-variant rate. That would
be a much larger change as it requires a table describing all the rates
supported for a given clock, plus proper vote/arbitration management,
since a single CCI clock is shared by multiple masters that may run in
different modes simultaneously. So this is out of scope for this series,
which keeps the simpler per-variant rate.

Signed-off-by: Loic Poulain <loic.poulain@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 (3):
      i2c: qcom-cci: Switch msm8953 to the CCI v2 timing/rate config
      Revert "i2c: qcom-cci: Remove unused struct member cci_clk_rate"
      i2c: qcom-cci: Fix CCI clock rate enforcement

 drivers/i2c/busses/i2c-qcom-cci.c | 100 ++++++++++++++++++++------------------
 1 file changed, 54 insertions(+), 46 deletions(-)
---
base-commit: fce2dfa773ced15f27dd27cd0b482a7473cdcf2a
change-id: 20260721-cci-clk-fix-fe145b2acfa7

Best regards,
-- 
Loic Poulain <loic.poulain@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-07-29 11:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27  9:21 [PATCH v2 0/3] i2c: qcom-cci: Fix CCI clock rate enforcement Loic Poulain
2026-07-27  9:21 ` [PATCH v2 1/3] i2c: qcom-cci: Switch msm8953 to the CCI v2 timing/rate config Loic Poulain
2026-07-27 19:21   ` Vladimir Zapolskiy
2026-07-28  8:20     ` Loic Poulain
2026-07-28  9:38       ` Vladimir Zapolskiy
2026-07-28 10:26         ` Loic Poulain
2026-07-29 11:40           ` Vladimir Zapolskiy
2026-07-27  9:21 ` [PATCH v2 2/3] Revert "i2c: qcom-cci: Remove unused struct member cci_clk_rate" Loic Poulain
2026-07-27  9:21 ` [PATCH v2 3/3] i2c: qcom-cci: Fix CCI clock rate enforcement Loic Poulain
2026-07-27  9:33   ` Mukesh Savaliya
2026-07-27  9:45     ` Loic Poulain
2026-07-27  9:50       ` Mukesh Savaliya
2026-07-28 15:57   ` Vladimir Zapolskiy
2026-07-29 11:35     ` Loic Poulain
2026-07-29 11:51       ` Vladimir Zapolskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®