Skip to content

Commit 52b1853

Browse files
committed
Merge tag 'i2c-for-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Improve the detection when to run atomic transfer handlers for kernels with preemption disabled. This removes some false positive splats a number of users were seeing if their driver didn't have support for atomic transfers. Also, fix a typo in the docs while we are here" * tag 'i2c-for-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: core: Fix atomic xfer check for non-preempt config Documentation/i2c: fix spelling error in i2c-address-translators
2 parents 95c8a35 + a3368e1 commit 52b1853

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Documentation/i2c/i2c-address-translators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Transaction:
7171
- Physical I2C transaction on bus A, slave address 0x20
7272
- ATR chip detects transaction on address 0x20, finds it in table,
7373
propagates transaction on bus B with address translated to 0x10,
74-
keeps clock streched on bus A waiting for reply
74+
keeps clock stretched on bus A waiting for reply
7575
- Slave X chip (on bus B) detects transaction at its own physical
7676
address 0x10 and replies normally
7777
- ATR chip stops clock stretching and forwards reply on bus A,

drivers/i2c/i2c-core.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* i2c-core.h - interfaces internal to the I2C framework
44
*/
55

6+
#include <linux/kconfig.h>
67
#include <linux/rwsem.h>
78

89
struct i2c_devinfo {
@@ -29,7 +30,8 @@ int i2c_dev_irq_from_resources(const struct resource *resources,
2930
*/
3031
static inline bool i2c_in_atomic_xfer_mode(void)
3132
{
32-
return system_state > SYSTEM_RUNNING && !preemptible();
33+
return system_state > SYSTEM_RUNNING &&
34+
(IS_ENABLED(CONFIG_PREEMPT_COUNT) ? !preemptible() : irqs_disabled());
3335
}
3436

3537
static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)

0 commit comments

Comments
 (0)