i2c-imc-skylake: harden the checks for the v4 respin

All of this came out of a self-review of v3 plus one robot report; none
of it changes what the driver supports.

The read-back check required the whole command word to come back as
written, and the interference check on the driven channel compared
against the pre-transfer word.  Both implicitly demanded that every
undocumented bit of the command register reads as zero, which held on
the test system but is not something to assume across steppings.
Compare only the bits this driver produces, with the post-write
read-back as the baseline for the driven channel; GO clearing remains
the single permitted difference.

Read the result before the interference check, not after, so the check
also covers the window in which the data latch is read.

Re-run the TSOD-polling check on resume and keep the adapters suspended
if firmware enabled polling across suspend; the probe-time refusal
cannot see that, and the S3 observation in the cover letter is exactly
this scenario.

Stop before writing a saved command word back if the config read that
fetched it had already failed.

Rename the register accessors: the command register is CMD and the data
latch DATA.  v3 called the command register DATA and the data latch
CTRL, which read backwards.

Cast ~COMMAND_OUR_BITS to u32 in the interference check.  BIT() and
GENMASK() are unsigned long, so the complement was computed in 64 bits
and truncated on assignment; the truncated value was already correct,
this only silences a clang W=1 -Wconstant-conversion warning.
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

The Kconfig help and the .rst now say that PCI ID 8086:2085 also
matches Skylake-SP / Cascade Lake-SP servers, where a BMC is far more
likely to own the engine, and the .rst states plainly that jc42 itself
has not been run here, only the transactions it needs.
This commit is contained in:
Simone
2026-07-29 10:45:53 +02:00
parent a2ae4512d8
commit 7bac49b4f6
3 changed files with 133 additions and 71 deletions
+5 -2
View File
@@ -19,8 +19,11 @@ config I2C_IMC_SKYLAKE
refuses to bind unless the allow_unsafe_access module parameter
is enabled. See Documentation/i2c/busses/i2c-imc-skylake.rst.
If unsure, say N. This driver is only useful on Intel X299 desktop
/ HEDT systems with the Skylake-X or Cascade Lake-X CPU.
If unsure, say N. This driver is aimed at Intel X299 desktop /
HEDT systems with a Skylake-X or Cascade Lake-X CPU. The same PCI
ID appears on Skylake-SP / Cascade Lake-SP servers, where a BMC is
far more likely to be using the engine already; the driver applies
the same checks there, but saying N is even more advisable.
This driver can also be built as a module. If so, the module
will be called i2c-imc-skylake.