Skip to content

i2c: mlxbf: Fix master GW corruption

Chris Babroski linux-i2c lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3i2c: mlxbf: Fix master GW corruption from unmasked SMBus flagsdrivers/i2c/busses/i2c-mlxbf.c+2 -20 replies
2/3i2c: mlxbf: Use GENMASK()/FIELD_PREP() for GW fieldsdrivers/i2c/busses/i2c-mlxbf.c+17 -130 replies
3/3i2c: mlxbf: Remove unused slave GW PEC handlingdrivers/i2c/busses/i2c-mlxbf.c+1 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/3] i2c: mlxbf: Fix master GW corruption

This patch series fixes a bug that corrupts the slave address used in read phases and cleans up the code to prevent similar corruption scenarios from occurring in the future.

When the MLXBF_I2C_F_SMBUS_BLOCK and/or MLXBF_I2C_F_SMBUS_PEC flags are set, the flag bitmask values are shifted and written to the master gateway control register instead of the single-bit flag values. This caused slave address corruption in read phases (unlike write phases which use the data_desc[0] slave address value).

Patch 1 fixes this corruption issue by converting the flags to booleans before setting their values in the control register.

Patch 2 converts register field accesses from explicit shifts to BIT()/GENMASK()/FIELD_PREP().

Patch 3 removes an unnecessary register write (dead code).

Chris Babroski (3):
i2c: mlxbf: Fix master GW corruption from unmasked SMBus flags
i2c: mlxbf: Use GENMASK()/FIELD_PREP() for GW fields
i2c: mlxbf: Remove unused slave GW PEC handling

 drivers/i2c/busses/i2c-mlxbf.c | 40 +++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 20 deletions(-)
Signature · 1 line
2.34.1