From: Chris Babroski <cbabroski@nvidia.com>
To: <andi.shyti@kernel.org>, <linux-i2c@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <cbabroski@nvidia.com>, <davthompson@nvidia.com>
Subject: [PATCH v1 1/3] i2c: mlxbf: Fix master GW corruption from unmasked SMBus flags
Date: Thu, 3 Sep 2026 15:19:59 -0400 [thread overview]
Message-ID: <20260903192001.114263-2-cbabroski@nvidia.com> (raw)
In-Reply-To: <20260903192001.114263-1-cbabroski@nvidia.com>
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. Shifting
and writing the bitmasks can corrupt adjacent bits in the master gateway
control register like the slave address used in read phases.
Convert the SMBus flags to boolean values before setting the master
gateway control register.
Signed-off-by: Chris Babroski <cbabroski@nvidia.com>
---
drivers/i2c/busses/i2c-mlxbf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index 24ccc4546ab8..93fc9f0ba72c 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -740,8 +740,8 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv,
* submitted by the first operation only.
*/
if (op_idx == 0 && flags & MLXBF_I2C_F_SMBUS_OPERATION) {
- block_en = flags & MLXBF_I2C_F_SMBUS_BLOCK;
- pec_en = flags & MLXBF_I2C_F_SMBUS_PEC;
+ block_en = !!(flags & MLXBF_I2C_F_SMBUS_BLOCK);
+ pec_en = !!(flags & MLXBF_I2C_F_SMBUS_PEC);
}
if (flags & MLXBF_I2C_F_WRITE) {
--
2.34.1
next prev parent reply other threads:[~2026-09-03 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 19:19 [PATCH v1 0/3] i2c: mlxbf: Fix master GW corruption Chris Babroski
2026-09-03 19:19 ` Chris Babroski [this message]
2026-09-03 19:20 ` [PATCH v1 2/3] i2c: mlxbf: Use GENMASK()/FIELD_PREP() for GW fields Chris Babroski
2026-09-03 19:20 ` [PATCH v1 3/3] i2c: mlxbf: Remove unused slave GW PEC handling Chris Babroski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903192001.114263-2-cbabroski@nvidia.com \
--to=cbabroski@nvidia.com \
--cc=andi.shyti@kernel.org \
--cc=davthompson@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox