<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/i2c, branch v6.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-10-01T22:46:42Z</updated>
<entry>
<title>i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe</title>
<updated>2022-10-01T22:46:42Z</updated>
<author>
<name>Zhang Qilong</name>
<email>zhangqilong3@huawei.com</email>
</author>
<published>2022-09-29T14:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2062df704dea47efe16edcaa2316d7b5ecca64f'/>
<id>urn:sha1:e2062df704dea47efe16edcaa2316d7b5ecca64f</id>
<content type='text'>
The pm_runtime_enable will increase power disable depth. Thus a
pairing decrement is needed on the error handling path to keep
it balanced according to context.

Fixes: 17f88151ff190 ("i2c: davinci: Add PM Runtime Support")
Signed-off-by: Zhang Qilong &lt;zhangqilong3@huawei.com&gt;
Reviewed-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mux: harden i2c_mux_alloc() against integer overflows</title>
<updated>2022-09-21T20:12:06Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-09-15T11:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b7af938f4379a884f15713319648a7653497a907'/>
<id>urn:sha1:b7af938f4379a884f15713319648a7653497a907</id>
<content type='text'>
A couple years back we went through the kernel an automatically
converted size calculations to use struct_size() instead.  The
struct_size() calculation is protected against integer overflows.

However it does not make sense to use the result from struct_size()
for additional math operations as that would negate any safeness.

Fixes: 1f3b69b6b939 ("i2c: mux: Use struct_size() in devm_kzalloc()")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Peter Rosin &lt;peda@axentia.se&gt;
Reviewed-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mlxbf: Fix frequency calculation</title>
<updated>2022-09-21T19:43:19Z</updated>
<author>
<name>Asmaa Mnebhi</name>
<email>asmaa@nvidia.com</email>
</author>
<published>2022-09-20T17:47:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37f071ec327b04c83d47637c5e5c2199b39899ca'/>
<id>urn:sha1:37f071ec327b04c83d47637c5e5c2199b39899ca</id>
<content type='text'>
The i2c-mlxbf.c driver is currently broken because there is a bug
in the calculation of the frequency. core_f, core_r and core_od
are components read from hardware registers and are used to
compute the frequency used to compute different timing parameters.
The shifting mechanism used to get core_f, core_r and core_od is
wrong. Use FIELD_GET to mask and shift the bitfields properly.

Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC)
Reviewed-by: Khalil Blaiech &lt;kblaiech@nvidia.com&gt;
Signed-off-by: Asmaa Mnebhi &lt;asmaa@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction()</title>
<updated>2022-09-17T18:13:57Z</updated>
<author>
<name>Asmaa Mnebhi</name>
<email>asmaa@nvidia.com</email>
</author>
<published>2022-09-08T17:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=de24aceb07d426b6f1c59f33889d6a964770547b'/>
<id>urn:sha1:de24aceb07d426b6f1c59f33889d6a964770547b</id>
<content type='text'>
memcpy() is called in a loop while 'operation-&gt;length' upper bound
is not checked and 'data_idx' also increments.

Fixes: b5b5b32081cd206b ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
Reviewed-by: Khalil Blaiech &lt;kblaiech@nvidia.com&gt;
Signed-off-by: Asmaa Mnebhi &lt;asmaa@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mlxbf: incorrect base address passed during io write</title>
<updated>2022-09-17T18:11:21Z</updated>
<author>
<name>Asmaa Mnebhi</name>
<email>asmaa@nvidia.com</email>
</author>
<published>2022-09-08T17:35:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a5be6d1340c0fefcee8a6489cff7fd88a0d5b85'/>
<id>urn:sha1:2a5be6d1340c0fefcee8a6489cff7fd88a0d5b85</id>
<content type='text'>
Correct the base address used during io write.
This bug had no impact over the overall functionality of the read and write
transactions. MLXBF_I2C_CAUSE_OR_CLEAR=0x18 so writing to (smbus-&gt;io + 0x18)
instead of (mst_cause-&gt;ioi + 0x18) actually writes to the sc_low_timeout
register which just sets the timeout value before a read/write aborts.

Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC)
Reviewed-by: Khalil Blaiech &lt;kblaiech@nvidia.com&gt;
Signed-off-by: Asmaa Mnebhi &lt;asmaa@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible</title>
<updated>2022-09-16T19:37:50Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2022-09-12T13:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=085aacaa73163f4b8a89dec24ecb32cfacd34017'/>
<id>urn:sha1:085aacaa73163f4b8a89dec24ecb32cfacd34017</id>
<content type='text'>
pm_runtime_get_sync() returning 1 also means the device is powered. So
resetting the chip registers in .remove() is possible and should be
done.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: d98bdd3a5b50 ("i2c: imx: Make sure to unregister adapter on remove()")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: imx: Make sure to unregister adapter on remove()</title>
<updated>2022-08-21T08:27:33Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2022-07-20T15:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d98bdd3a5b50446d8e010be5b04ce81c4eabf728'/>
<id>urn:sha1:d98bdd3a5b50446d8e010be5b04ce81c4eabf728</id>
<content type='text'>
If for whatever reasons pm_runtime_resume_and_get() fails and .remove() is
exited early, the i2c adapter stays around and the irq still calls its
handler, while the driver data and the register mapping go away. So if
later the i2c adapter is accessed or the irq triggers this results in
havoc accessing freed memory and unmapped registers.

So unregister the software resources even if resume failed, and only skip
the hardware access in that case.

Fixes: 588eb93ea49f ("i2c: imx: add runtime pm support to improve the performance")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "i2c: scmi: Replace open coded device_get_match_data()"</title>
<updated>2022-08-21T08:27:07Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@kernel.org</email>
</author>
<published>2022-08-18T20:31:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3df71d7064cbb19a3ac0e5dc25ece2bbf3a4d9af'/>
<id>urn:sha1:3df71d7064cbb19a3ac0e5dc25ece2bbf3a4d9af</id>
<content type='text'>
This reverts commit 9ae551ded5ba55f96a83cd0811f7ef8c2f329d0c. We got a
regression report, so ensure this machine boots again. We will come back
with a better version hopefully.

Reported-by: Josef Johansson &lt;josef@oderland.se&gt;
Link: https://lore.kernel.org/r/4d2d5b04-0b6c-1cb1-a63f-dc06dfe1b5da@oderland.se
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: move core from strlcpy to strscpy</title>
<updated>2022-08-11T21:02:52Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-08-11T12:08:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b0221d9cd330e3d9c4cb0a257b92af2a6ca2ed0'/>
<id>urn:sha1:0b0221d9cd330e3d9c4cb0a257b92af2a6ca2ed0</id>
<content type='text'>
Follow the advice of the below link and prefer 'strscpy'. Conversion is
easy because no code used the return value. It has been done with a
simple sed invocation.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: move drivers from strlcpy to strscpy</title>
<updated>2022-08-11T21:02:51Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-08-11T07:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ea1558ce149d286eaf2c0800a93b7efa2adda094'/>
<id>urn:sha1:ea1558ce149d286eaf2c0800a93b7efa2adda094</id>
<content type='text'>
Follow the advice of the below link and prefer 'strscpy'. Conversion is
easy because no driver used the return value and has been done with a
simple sed invocation.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
</feed>
