<feed xmlns='http://www.w3.org/2005/Atom'>
<title>laptop-kernel/drivers/i2c, branch master</title>
<subtitle>Linux kernel tree for laptop</subtitle>
<id>https://git.zx2c4.com/laptop-kernel/atom/drivers/i2c?h=master</id>
<link rel='self' href='https://git.zx2c4.com/laptop-kernel/atom/drivers/i2c?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/'/>
<updated>2026-10-15T20:34:34Z</updated>
<entry>
<title>i2c: xiic: restore non-managed runtime PM to fix clk WARN flood</title>
<updated>2026-10-15T20:34:34Z</updated>
<author>
<name>Abdurrahman Hussain</name>
<email>abdurrahman@nexthop.ai</email>
</author>
<published>2026-10-14T23:56:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=d33373c565af9c8a28776af02bd20ba6e5724211'/>
<id>urn:sha1:d33373c565af9c8a28776af02bd20ba6e5724211</id>
<content type='text'>
The devres conversion replaced manual pm_runtime_enable()/disable() with
devm_pm_runtime_set_active_enabled() and dropped the remove-time runtime
PM teardown. The managed release tears runtime PM down in the wrong
order: it calls pm_runtime_dont_use_autosuspend() before
pm_runtime_disable(), i.e. while runtime PM is still enabled, and devres
is LIFO so the devm_clk_get_enabled() release runs afterwards.

At remove(), pm_runtime_put_sync() leaves the device active with the
autosuspend timer armed. Clearing use_autosuspend then makes rpm_idle()
suspend immediately, and xiic_i2c_runtime_suspend() clk_disable()s the
clock. The later devm_clk_get_enabled() release clk_disable_unprepare()s
the already-disabled clock, so clk_core_disable() WARNs ("clkN already
disabled") on every teardown.

Drop the managed helper and restore the non-managed runtime PM setup and
teardown, so runtime PM is enabled once in probe and disabled once in
remove and the clock enable count stays balanced.

Order the remove teardown so runtime PM is disabled before the usage
count is dropped: pm_runtime_disable() followed by pm_runtime_put_noidle()
instead of pm_runtime_put_sync(). Dropping the count first with autosuspend
still enabled arms the autosuspend timer, and a preemption before
pm_runtime_disable() lets it expire, suspend the device and clk_disable()
the clock, which the devm release then disables again - the same WARN.

Restore the non-managed IRQ request as well. The probe error paths now
unwind runtime PM by hand via goto, and a devm-registered handler is only
freed later during devres unwind, so it would stay live across the manual
teardown (and across any future failing step added after it). Request the
IRQ with request_threaded_irq() and free it explicitly in the probe error
path and in remove. The probe error path also clears use_autosuspend, to
match the teardown in remove().

Fixes: 50c63491ff26 ("i2c: xiic: switch to devres managed APIs")
Signed-off-by: Abdurrahman Hussain &lt;abdurrahman@nexthop.ai&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v7.1+
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20261014-i2c-xiic-restore-runtime-pm-teardown-v8-1-40668c270069@nexthop.ai
</content>
</entry>
<entry>
<title>i2c: qcom-cci: Fix HALT_ACK reset request being dropped</title>
<updated>2026-10-13T11:04:09Z</updated>
<author>
<name>Loic Poulain</name>
<email>loic.poulain@oss.qualcomm.com</email>
</author>
<published>2026-10-12T12:54:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=195f3d74b5de98969dc4fad956393bb00787efd1'/>
<id>urn:sha1:195f3d74b5de98969dc4fad956393bb00787efd1</id>
<content type='text'>
A HALT_ACK interrupt indicates that the corresponding I2C master has
entered the halted state and must be reset before further operation.

The M0 and M1 HALT_ACK status bits may be asserted simultaneously in a
single interrupt. However, the interrupt handler currently overwrites
the reset mask when processing each HALT_ACK condition, causing the
first reset request to be lost if both events are reported together.

Accumulate reset requests instead of overwriting them so that both
masters are properly reset when M0 and M1 HALT_ACK events occur in the
same interrupt.

Fixes: e517526195de4 ("i2c: Add Qualcomm CCI I2C driver")
Signed-off-by: Loic Poulain &lt;loic.poulain@oss.qualcomm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.8+
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@oss.qualcomm.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20261012-cci-fixes-v1-1-8cd4eb1fc5f9@oss.qualcomm.com
</content>
</entry>
<entry>
<title>i2c: qcom-geni: Restore the source-clock selection policy</title>
<updated>2026-10-12T22:22:51Z</updated>
<author>
<name>Abel Vesa</name>
<email>abel.vesa@oss.qualcomm.com</email>
</author>
<published>2026-09-28T13:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=8cb5c17be3a2fadc41075d04ce1c24c831546aaf'/>
<id>urn:sha1:8cb5c17be3a2fadc41075d04ce1c24c831546aaf</id>
<content type='text'>
Currently, the source clock lookup prefers 32 MHz whenever that rate is
available, regardless of the rate configured by the platform. Before the
switch to looking up the clock index, the driver used the 32 MHz timing
table only if the current source clock rate was 32 MHz, and the 19.2 MHz
table otherwise.

On X1E80100 CRD, this results in switching the source clock from 19.2 MHz
to 32 MHz, which causes intermittent failures when probing the I2C HID
keyboard. These range from corrupted HID descriptors to failed resets
and transfer timeouts, which also affect the touchpad on the same bus.

Restore the original selection policy: use 32 MHz if already selected,
otherwise request 19.2 MHz. Look up the index for the selected rate and
keep the check that rejects higher-frequency multiples. This retains
the dynamic clock index lookup without preferring 32 MHz on platforms
that previously used 19.2 MHz. Report the requested rate if the lookup
fails.

Fixes: cb97bf3d4f91 ("i2c: qcom-geni: Fix hardcoded clock index in SE_GENI_CLK_SEL")
Assisted-by: LLM
Signed-off-by: Abel Vesa &lt;abel.vesa@oss.qualcomm.com&gt;
Tested-by: Hasty Heat &lt;hastyheat@gmail.com&gt;
Tested-by: Mitchell Augustin &lt;mitchell.augustin@canonical.com&gt;
Reviewed-by: Mitchell Augustin &lt;mitchell.augustin@canonical.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260928-b4-i2c-qcom-geni-preserve-source-clock-v1-1-9aded7552a76@oss.qualcomm.com
</content>
</entry>
<entry>
<title>i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()</title>
<updated>2026-10-12T22:05:33Z</updated>
<author>
<name>Wentao Liang</name>
<email>vulab@iscas.ac.cn</email>
</author>
<published>2026-09-16T07:06:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=aaabefc79b0ff0018e8e3832169bbe359d0551fc'/>
<id>urn:sha1:aaabefc79b0ff0018e8e3832169bbe359d0551fc</id>
<content type='text'>
In wmt_i2c_probe(), i2c-&gt;clk is acquired using of_clk_get(). If any
subsequent operation fails or when the module is unloaded, the clock
reference count is never decremented via clk_put(), leading to a
resource leak.

Switch to devm_clk_get() so that the clock is automatically managed
and released.

Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang &lt;vulab@iscas.ac.cn&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260916070631.1965713-1-vulab@iscas.ac.cn
</content>
</entry>
<entry>
<title>i2c: qcom-geni: release runtime PM reference when set_rate fails</title>
<updated>2026-10-05T10:10:52Z</updated>
<author>
<name>Rahul Pon</name>
<email>theflyingrahul@gmail.com</email>
</author>
<published>2026-09-30T11:16:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=ae8364085574203e7f4ea961921a1c7493bcb6de'/>
<id>urn:sha1:ae8364085574203e7f4ea961921a1c7493bcb6de</id>
<content type='text'>
geni_i2c_xfer() takes a runtime-PM reference with pm_runtime_get_sync()
and then returns directly if the set_rate() callback fails, leaking the
reference and keeping the controller resumed for good. Route that error
through the existing cleanup path, which drops the reference and resets
the transfer state.

Found by code review; compile-tested with arm64 defconfig plus ACPI and
W=1.

Fixes: 10e74f4c5046 ("i2c: qcom-geni: Enable I2C on SA8255p Qualcomm platforms")
Assisted-by: LLM
Signed-off-by: Rahul Pon &lt;theflyingrahul@gmail.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260930111641.1134-1-theflyingrahul@gmail.com
</content>
</entry>
<entry>
<title>i2c: at91: release DMA channels when probe defers</title>
<updated>2026-10-01T11:51:54Z</updated>
<author>
<name>Hongjian Dai</name>
<email>daihongjian@kylinsec.com.cn</email>
</author>
<published>2026-09-29T16:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=c98bf3b86609a18ab16d067280257326e557c636'/>
<id>urn:sha1:c98bf3b86609a18ab16d067280257326e557c636</id>
<content type='text'>
at91_twi_probe_master() can return -EPROBE_DEFER from
at91_init_twi_recovery_info() after at91_twi_configure_dma() has already
claimed the tx/rx DMA channels. at91_twi_probe() then returns without
releasing them, and since dma_request_chan() is not devres-managed the
channels leak on every deferred probe attempt.

Release the channels before deferring the probe.

Fixes: f7eeb1af8537 ("i2c: at91: release DMA channels on remove and probe error")
Assisted-by: LLM
Signed-off-by: Hongjian Dai &lt;daihongjian@kylinsec.com.cn&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/7D85C6CB6BF0A82E+20260929164340.41628-1-daihongjian@kylinsec.com.cn
</content>
</entry>
<entry>
<title>i2c: xiic: don't clobber msg-&gt;len to signal block-read completion</title>
<updated>2026-09-27T23:28:42Z</updated>
<author>
<name>Abdurrahman Hussain</name>
<email>abdurrahman@nexthop.ai</email>
</author>
<published>2026-09-25T00:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=840d8acc87925deb3c75566fde9ca81d2f47f98c'/>
<id>urn:sha1:840d8acc87925deb3c75566fde9ca81d2f47f98c</id>
<content type='text'>
At the end of a SMBus block read the BNB handler force-set
tx_msg-&gt;len = 1 to push xiic_tx_space() to zero so the STATE_DONE
branch would fire. Two problems:

1. tx_msg and rx_msg alias the same i2c_msg struct during a receive
   (see xiic_start_recv), so overwriting tx_msg-&gt;len also changes
   rx_msg-&gt;len. The i2c core's i2c_smbus_check_pec() then reads the
   PEC from the wrong offset -- buf[0] instead of buf[rxmsg_len + 1]
   -- and either mis-validates or returns -EBADMSG.

2. xiic_start_recv sets tx_pos = msg-&gt;len (typically 2 when PEC is
   enabled). xiic_tx_space() is unsigned msg-&gt;len - tx_pos, so
   setting msg-&gt;len = 1 with tx_pos = 2 underflows to 0xFFFFFFFF and
   xiic_tx_space() never compares equal to 0 -- the STATE_DONE check
   falls through to STATE_ERROR, giving -EIO.

Instead, advance tx_pos up to msg-&gt;len. That drives tx_space to 0
without touching msg-&gt;len, preserving the buffer length that
xiic_smbus_block_read_setup() already grew to cover the length byte,
the payload and the optional PEC byte.

Fixes: e4c1ff772e1a ("i2c: xiic: Add smbus_block_read functionality")
Signed-off-by: Abdurrahman Hussain &lt;abdurrahman@nexthop.ai&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.3+
Acked-by: Michal Simek &lt;michal.simek@amd.com&gt;
Reviewed-by: Shubhrajyoti Datta &lt;shubhrajyoti.datta@amd.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260924-i2c-xiic-v7-3-df7e752332ef@nexthop.ai
</content>
</entry>
<entry>
<title>i2c: xiic: defer RX_FULL until all trailing bytes are in FIFO</title>
<updated>2026-09-27T23:28:35Z</updated>
<author>
<name>Abdurrahman Hussain</name>
<email>abdurrahman@nexthop.ai</email>
</author>
<published>2026-09-25T00:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=e6fe3ea04f0113fe4d47c03d76e03805a4768ca7'/>
<id>urn:sha1:e6fe3ea04f0113fe4d47c03d76e03805a4768ca7</id>
<content type='text'>
For the normal path of xiic_smbus_block_read_setup() -- the trailing
bytes all fit in one Rx FIFO fill -- RFD was programmed two below the
byte count, which fires the RX_FULL interrupt while the last byte is
still in flight. xiic_read_rx() then lands in its bytes_rem == 1 branch
and sets NACK on a byte still on the wire, truncating the read.

Without PEC this is harmless: the truncated byte is the dummy one the
caller never looks at. With PEC enabled it is the PEC byte itself, and
i2c_smbus_check_pec() fails the transfer with -EBADMSG.

Raise the threshold by one so RX_FULL fires only once every remaining
byte is already buffered. That routes the drain through
xiic_read_rx()'s bytes_rem == 0 path, which reads everything out and
emits the stop cleanly. The only change for the non-PEC case is that
the controller waits one extra byte-time before servicing the
interrupt.

rfd_set stays inside the 4 bits of XIIC_RFD_REG_OFFSET: this branch is
only reached when rxmsg_len + pec_len &lt;= IIC_RX_FIFO_DEPTH, so the
value is at most IIC_RX_FIFO_DEPTH - 1.

Fixes: e4c1ff772e1a ("i2c: xiic: Add smbus_block_read functionality")
Signed-off-by: Abdurrahman Hussain &lt;abdurrahman@nexthop.ai&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.3+
Acked-by: Michal Simek &lt;michal.simek@amd.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260924-i2c-xiic-v7-2-df7e752332ef@nexthop.ai
</content>
</entry>
<entry>
<title>i2c: xiic: preserve PEC byte length in SMBus block read setup</title>
<updated>2026-09-27T23:28:25Z</updated>
<author>
<name>Abdurrahman Hussain</name>
<email>abdurrahman@nexthop.ai</email>
</author>
<published>2026-09-25T00:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=b7e6df2f52ed5c02838832f53c171a5645f9b376'/>
<id>urn:sha1:b7e6df2f52ed5c02838832f53c171a5645f9b376</id>
<content type='text'>
xiic_smbus_block_read_setup() recalculates i2c-&gt;rx_msg-&gt;len based on the
length byte returned by the device, but historically clobbered the PEC
byte expectation the SMBus core had baked into msg-&gt;len. That dropped
the PEC byte from the caller's buffer on the normal and chunked
receive-fifo branches.

Compute pec_len up-front as (i2c-&gt;rx_msg-&gt;len - 1) -- the trailing bytes
the caller has already accounted for beyond the length byte, 1 when the
SMBus core enabled PEC, and possibly more for an I2C_M_RECV_LEN request
coming from i2c-dev -- and add it to the new length in every branch:

  - chunked: the trailing bytes do not fit in the Rx FIFO, so drain in
    chunks. The guard becomes (rxmsg_len + pec_len &gt; IIC_RX_FIFO_DEPTH)
    rather than rxmsg_len alone, both because pec_len bytes also have to
    fit and because it is what bounds rfd_set in the else branch below
    to the 4 bits of XIIC_RFD_REG_OFFSET.

  - padded (1 + rxmsg_len + pec_len &lt; SMBUS_BLOCK_READ_MIN_LEN): the
    hardware needs at least 3 bytes on the bus to exit the read cleanly
    (the second byte is already being clocked in by the time the ISR
    reads the length byte and is too late to NACK), so we still pad
    rx_msg-&gt;len up to SMBUS_BLOCK_READ_MIN_LEN. The dummy trailing byte
    that gets drained must then be trimmed off before handing the
    message back to the SMBus core; otherwise i2c_smbus_check_pec()
    reads buf[len-1] (= dummy) instead of the real PEC byte at buf[1]
    and rejects every clean zero-length block read with -EBADMSG.

    Record the true valid byte count in a new field
    i2c-&gt;smbus_actual_len and trim rx_msg-&gt;len down to it in
    xiic_smbus_trim_len(), called from both completion sites that clear
    rx_msg: xiic_process()'s RX_FULL branch and xiic_recv_atomic(),
    which drains the FIFO with interrupts off.

    smbus_actual_len is per-receive state, so xiic_start_recv() clears
    it before every receive. Only the padded branch ever sets it, and a
    block read aborted by arbitration loss or a TX error never reaches
    the completion site, so without that clear a stale value would trim
    the length of an unrelated later read.

    The condition is expressed in total bytes rather than the old
    "(rxmsg_len == 1) || (rxmsg_len == 0)" so that a request carrying
    more than one trailing byte does not get padded: padding records a
    length the drain never reaches, which would hand the caller a byte
    that was never received.

  - normal: all trailing bytes fit in one FIFO fill. rfd_set gains
    pec_len for the same reason the length does. Because the padded
    branch above has already taken every case with fewer than
    SMBUS_BLOCK_READ_MIN_LEN total bytes, rxmsg_len + pec_len is at
    least 2 here and the subtraction cannot underflow the u8.

Fixes: e4c1ff772e1a ("i2c: xiic: Add smbus_block_read functionality")
Signed-off-by: Abdurrahman Hussain &lt;abdurrahman@nexthop.ai&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.3+
Acked-by: Michal Simek &lt;michal.simek@amd.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260924-i2c-xiic-v7-1-df7e752332ef@nexthop.ai
</content>
</entry>
<entry>
<title>i2c: qcom-geni: Fix hardcoded clock index in SE_GENI_CLK_SEL</title>
<updated>2026-09-24T20:52:30Z</updated>
<author>
<name>Viken Dadhaniya</name>
<email>viken.dadhaniya@oss.qualcomm.com</email>
</author>
<published>2026-09-21T11:47:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=cb97bf3d4f91453b881acaf8e9f0cc47bb40b604'/>
<id>urn:sha1:cb97bf3d4f91453b881acaf8e9f0cc47bb40b604</id>
<content type='text'>
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")
Signed-off-by: Viken Dadhaniya &lt;viken.dadhaniya@oss.qualcomm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Reviewed-by: Mukesh Kumar Savaliya &lt;mukesh.savaliya@oss.qualcomm.com&gt;
Signed-off-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Link: https://patch.msgid.link/20260921-i2c-fix-se-clk-conf-v2-1-8b5537ceff2d@oss.qualcomm.com
</content>
</entry>
</feed>
