Linux I2C development
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: Robert Foss <rfoss@kernel.org>,
	Andi Shyti <andi.shyti@kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Luca Weiss <luca@lucaweiss.eu>,
	linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] i2c: qcom-cci: Add missing cci_clk_rate for msm8953
Date: Sat, 25 Jul 2026 17:19:37 +0300	[thread overview]
Message-ID: <1f64e023-e5f4-4620-a01f-1cd98faa4ca1@linaro.org> (raw)
In-Reply-To: <CAFEp6-3OKp0XhpNmp-yYwf4r16A=CD5eA-Ts1kk+mFjdCA38RQ@mail.gmail.com>

Hi Loic,

On 7/25/26 16:06, Loic Poulain wrote:
> Hi Vladimir,
> 
> On Sat, Jul 25, 2026 at 10:36 AM Vladimir Zapolskiy
> <vladimir.zapolskiy@linaro.org> wrote:
>>
>> Hi Loic, Luca,
>>
>> On 7/21/26 17:58, Loic Poulain wrote:
>>> The msm8953 CCI data was added after cci_clk_rate was removed from the
>>> driver, so it never got a clock rate entry. The DT assigns 19.2 MHz to
>>> GCC_CAMSS_CCI_CLK and the hw_params values match those of v1/v1.5 which
>>> were also calibrated for 19.2 MHz.
>>>
>>> Fixes: d202341d9b0c ("i2c: qcom-cci: Add msm8953 compatible")
>>> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
>>> ---
>>>    drivers/i2c/busses/i2c-qcom-cci.c | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
>>> index 19e4719f13b29b2cf60e113565b1b63f19d0e669..5f74edde8558382e63e2c3d0fbe19489f325e8ce 100644
>>> --- a/drivers/i2c/busses/i2c-qcom-cci.c
>>> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
>>> @@ -783,6 +783,7 @@ static const struct cci_data cci_msm8953_data = {
>>>                .max_write_len = 11,
>>>                .max_read_len = 12,
>>>        },
>>> +     .cci_clk_rate = 19200000,
>>>        .params[I2C_MODE_STANDARD] = {
>>>                .thigh = 78,
>>>                .tlow = 114,
>>>
>>
>> this simple change is wrong, but commit d202341d9b0c ("i2c: qcom-cci: Add
>> msm8953 compatible") causes it, but please note that the commit d202341d9b0c
>> has no explicit issues per se (if proper frequencies are set in dt), but
>> this particular commit 2/3 breaks the whole picture.
>>
>> Let's see, MSM8953 I2C_MODE_STANDARD/I2C_MODE_FAST settings repeat the ones
>> for v1/v1.5 and 19.2MHz supply clock frequency, but I2C_MODE_FAST_PLUS
>> speed setting very close to v2 parameters and assumes 37.MHz supply clock
>> frequency.
> 
> Good catch, there's a real inconsistency in the table, and it's also
> why configuring the clock rate in DT independently of the timing table
> is fragile (and not even enforced by the bindings).
> 
>> So, at least one clock rate setting for all modes is invalid in this case.
>> Automatically it means the reverted commit 1/3 in the series does not
>> directly lead to the wanted and well-managed data, and the logic in 3/3
>> becomes invalid.
> 
> Agreed on the analysis. To be precise though, this doesn't make things
> worse than they already are upstream, msm8953.dtsi assigns 19.2 MHz,
> and the Standard/Fast rows are identical to v1/v1.5 (calibrated for
> 19.2 MHz), so those two modes are fine today. Only Fast+ is broken
> (without a DT change).
> 
>> I would suggest to grasp the statement above carefully, design a bit
>> better solution, meanwhile postpone applying any commits from the
>> series, especially if a breaking change holds a Fixes tag.
> 
> So if you agree? my short-term plan is submitting a V2 with a
> switching of msm8953 to the CCI v2 params table, so running the CCI
> clock at 37.5 MHz, which is what SDM630/MSM8996 already do (same HW
> version). Moreover 37.5 MHz is supported by the msm8953 CCI RCG, so
> this is a viable single rate that makes all three modes
> self-consistent.

please consider to add .cci_clk_rate property into 'struct hw_params',
since that is its proper and valid place, the rest of the logic can be
build similarly to this series, for instance. Basically that's why
1/3 revert change is not the right step towards a wanted data placement.

Next good (IMO) optimization/improvement might be to describe hardware
programming modes in their own list, and in v1/v1_5/v2/msm8953 cci_data
simply pick the wanted IP programming data up by an index parametrized
by mode speed/clock frequency/hardware revision.

> Longer term, clock scaling (probably OPP-based) could be an elegant
> improvement, but it's a bigger change, also CCI block's masters share
> one clock yet can run in different modes, the per-mode timing/rate
> can't be chosen independently per master.
> 

That's right.

-- 
Best wishes,
Vladimir

  reply	other threads:[~2026-07-25 14:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 14:58 [PATCH 0/3] i2c: qcom-cci: Fix CCI clock rate enforcement Loic Poulain
2026-07-21 14:58 ` [PATCH 1/3] Revert "i2c: qcom-cci: Remove unused struct member cci_clk_rate" Loic Poulain
2026-07-24 22:57   ` Andi Shyti
2026-07-25  5:41     ` Vladimir Zapolskiy
2026-07-25  8:40     ` Vladimir Zapolskiy
2026-07-26 15:08       ` Andi Shyti
2026-07-21 14:58 ` [PATCH 2/3] i2c: qcom-cci: Add missing cci_clk_rate for msm8953 Loic Poulain
2026-07-25  6:42   ` Vladimir Zapolskiy
2026-07-25  8:36   ` Vladimir Zapolskiy
2026-07-25 13:06     ` Loic Poulain
2026-07-25 14:19       ` Vladimir Zapolskiy [this message]
2026-07-21 14:58 ` [PATCH 3/3] i2c: qcom-cci: Fix CCI clock rate enforcement Loic Poulain
2026-07-21 15:07   ` Konrad Dybcio
2026-07-21 15:41     ` Loic Poulain
2026-07-21 17:01       ` Konrad Dybcio
2026-07-23  3:04 ` [PATCH 0/3] " Wenmeng Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f64e023-e5f4-4620-a01f-1cd98faa4ca1@linaro.org \
    --to=vladimir.zapolskiy@linaro.org \
    --cc=andi.shyti@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=luca@lucaweiss.eu \
    --cc=rfoss@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox