mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
i2c: designware: Disable SMBus interrupts to prevent storms from mis-configured firmware
When probing the I2C master, disable SMBus interrupts to prevent storms caused by broken firmware mis-configuring IC_SMBUS=1; the handler never services them and a mis-configured SMBUS Master extend-clock timeout or SMBUS Slave extend-clock timeout can flood the CPU. Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251021075714.3712-2-guojinhui.liam@bytedance.com
This commit is contained in:
parent
3f124b4ef8
commit
d3429178ee
|
|
@ -78,6 +78,7 @@
|
|||
#define DW_IC_TX_ABRT_SOURCE 0x80
|
||||
#define DW_IC_ENABLE_STATUS 0x9c
|
||||
#define DW_IC_CLR_RESTART_DET 0xa8
|
||||
#define DW_IC_SMBUS_INTR_MASK 0xcc
|
||||
#define DW_IC_COMP_PARAM_1 0xf4
|
||||
#define DW_IC_COMP_VERSION 0xf8
|
||||
#define DW_IC_SDA_HOLD_MIN_VERS 0x3131312A /* "111*" == v1.11* */
|
||||
|
|
|
|||
|
|
@ -220,6 +220,13 @@ static int i2c_dw_init_master(struct dw_i2c_dev *dev)
|
|||
/* Disable the adapter */
|
||||
__i2c_dw_disable(dev);
|
||||
|
||||
/*
|
||||
* Mask SMBus interrupts to block storms from broken
|
||||
* firmware that leaves IC_SMBUS=1; the handler never
|
||||
* services them.
|
||||
*/
|
||||
regmap_write(dev->map, DW_IC_SMBUS_INTR_MASK, 0);
|
||||
|
||||
/* Write standard speed timing parameters */
|
||||
regmap_write(dev->map, DW_IC_SS_SCL_HCNT, dev->ss_hcnt);
|
||||
regmap_write(dev->map, DW_IC_SS_SCL_LCNT, dev->ss_lcnt);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user