diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2019-02-19 11:39:45 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-02-23 04:33:51 -0500 |
commit | 63e57b6f191db99ffdd0dc6c7b9ee6b2cf7abb04 (patch) | |
tree | 9a2544d399233f0e601dd5a0b7260be0aa8a9089 /Documentation/i2c | |
parent | 6b9932bc28fd61b83a8cb86bf0de1a86e5c18fa3 (diff) |
i2c: gpio: fault-injector: add 'lose_arbitration' injector
Add a fault injector simulating 'arbitration lost' from multi-master
setups. Read the docs for its usage.
A helper function for future fault injectors using SCL interrupts is
created to achieve this.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'Documentation/i2c')
-rw-r--r-- | Documentation/i2c/gpio-fault-injection | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/i2c/gpio-fault-injection b/Documentation/i2c/gpio-fault-injection index 1a44e3edc0c4..1f1bb96a64bd 100644 --- a/Documentation/i2c/gpio-fault-injection +++ b/Documentation/i2c/gpio-fault-injection | |||
@@ -83,3 +83,28 @@ This is why bus recovery (up to 9 clock pulses) must either check SDA or send | |||
83 | additional STOP conditions to ensure the bus has been released. Otherwise | 83 | additional STOP conditions to ensure the bus has been released. Otherwise |
84 | random data will be written to a device! | 84 | random data will be written to a device! |
85 | 85 | ||
86 | Lost arbitration | ||
87 | ================ | ||
88 | |||
89 | Here, we want to simulate the condition where the master under test loses the | ||
90 | bus arbitration against another master in a multi-master setup. | ||
91 | |||
92 | "lose_arbitration" | ||
93 | ------------------ | ||
94 | |||
95 | This file is write only and you need to write the duration of the arbitration | ||
96 | intereference (in µs, maximum is 100ms). The calling process will then sleep | ||
97 | and wait for the next bus clock. The process is interruptible, though. | ||
98 | |||
99 | Arbitration lost is achieved by waiting for SCL going down by the master under | ||
100 | test and then pulling SDA low for some time. So, the I2C address sent out | ||
101 | should be corrupted and that should be detected properly. That means that the | ||
102 | address sent out should have a lot of '1' bits to be able to detect corruption. | ||
103 | There doesn't need to be a device at this address because arbitration lost | ||
104 | should be detected beforehand. Also note, that SCL going down is monitored | ||
105 | using interrupts, so the interrupt latency might cause the first bits to be not | ||
106 | corrupted. A good starting point for using this fault injector on an otherwise | ||
107 | idle bus is: | ||
108 | |||
109 | # echo 200 > lose_arbitration & | ||
110 | # i2cget -y <bus_to_test> 0x3f | ||