Re: [PATCH v2] i2c: qcom-geni: Fix hardcoded clock index in SE_GENI_CLK_SEL
From: Viken Dadhaniya
Date: Mon Sep 21 2026 - 08:04:04 EST
On 9/21/2026 5:17 PM, Viken Dadhaniya wrote:
> qcom_geni_i2c_conf() writes a hardcoded 0 to SE_GENI_CLK_SEL, which
> selects an index from the hardware clock performance table. This always
> picks the first table entry regardless of the actual source clock
> configuration. On platforms where the matching entry is not at index 0,
> the wrong source clock divider is active and the I2C bus runs at an
> incorrect frequency.
>
> Use geni_se_clk_freq_match() in geni_i2c_clk_map_idx() to find the
> performance table index for the source clock (32 MHz or 19.2 MHz). Store
> the resolved index in a new clk_idx field in geni_i2c_dev and write it
> to SE_GENI_CLK_SEL instead of the hardcoded 0.
>
> Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Viken Dadhaniya <viken.dadhaniya@xxxxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Update the comment describing the source-clock frequency requirement
> and the rejection of higher-frequency multiples.
> - Add a blank line before the final return statement, as suggested.
> - Link to v1: https://patch.msgid.link/20260828-i2c-fix-se-clk-conf-v1-1-9adc72308f2d@xxxxxxxxxxxxxxxx
>
> --- b4-submit-tracking ---
> {
> "series": {
> "revision": 2,
> "change-id": "20260807-i2c-fix-se-clk-conf-89f6f92d373a",
> "prefixes": [],
> "presubject": "",
> "history": {
> "v1": [
> "20260828-i2c-fix-se-clk-conf-v1-1-9adc72308f2d@xxxxxxxxxxxxxxxx"
> ]
> }
> }
> }
Please ignore the --- b4-submit-tracking --- block; it is internal b4
metadata accidentally included during the rebase.
> ---
> drivers/i2c/busses/i2c-qcom-geni.c | 38 +++++++++++++++++++++++++++++++++-----
> 1 file changed, 33 insertions(+), 5 deletions(-)
[...]