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:
@@ -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.
|
||||
|
||||
@@ -8,6 +8,10 @@ Supported adapters:
|
||||
* Intel Skylake-X / Cascade Lake-X integrated memory controller (iMC)
|
||||
SMBus engine, PCU function 8086:2085 (socket LGA 2066, platform X299)
|
||||
|
||||
The same PCI ID appears on Skylake-SP / Cascade Lake-SP servers. The driver
|
||||
behaves identically there, but on server boards a BMC is far more likely to be
|
||||
using the engine already; read the next section twice before opting in.
|
||||
|
||||
Author: Simone Chifari <[email protected]>
|
||||
|
||||
|
||||
@@ -66,10 +70,14 @@ Per transfer:
|
||||
* the previous command state of both channels is saved, the TSOD-active
|
||||
state is cleared for the duration of the transfer, and both are restored
|
||||
afterwards;
|
||||
* after each transfer the command registers are compared against what the
|
||||
driver left in them. A difference means another master used the engine,
|
||||
and the transfer is failed with ``-EAGAIN`` rather than reported as
|
||||
successful.
|
||||
* the command word is read back and must be the one just written, in the
|
||||
bits the driver produces; two identical consecutive commands are the
|
||||
one case this cannot cover, because bit 29 cannot serve as a nonce -
|
||||
the engine errors out any command with it clear;
|
||||
* the result is read, and only then are the command registers compared
|
||||
against what the driver left in them. A difference means another master
|
||||
used the engine, and the transfer is failed with ``-EAGAIN`` rather than
|
||||
reported as successful.
|
||||
|
||||
The last check is what makes an unarbitrated system detectable: if the log
|
||||
shows
|
||||
@@ -79,6 +87,11 @@ shows
|
||||
then firmware is using the engine and the driver should not be loaded on that
|
||||
system.
|
||||
|
||||
The TSOD-polling check runs again on resume from suspend, because firmware
|
||||
can enable the polling across a sleep state. If it did, the adapters stay
|
||||
suspended and transfers fail with ``-ESHUTDOWN`` instead of racing the memory
|
||||
controller.
|
||||
|
||||
|
||||
Config space access
|
||||
-------------------
|
||||
|
||||
Reference in New Issue
Block a user