Attention is currently required from: Simon Buhrow, Alan Green, Edward O'Callaghan, Anastasia Klimchuk, Samir Ibradžić.
View Change
1 comment:
File ft2232_spi.c:
Patch Set #25, Line 295: 9
I counted 15 (lines 303, 309, 320, 328, 335). […]
I see 6 potential paths, due to the 3 if's but the second may end
the path prematurely with the `continue;`:
- false, false, false: 303, 335 (empty command, actually impossible due to the loop condition)
- false, false, true: 303, 328, 335 (read)
- false, true, *: 303, 320 (empty command with continuation, impossible due to the loop condition)
- true, false, false: 303, 309, 335 (write without continuation)
- true, false, true: 303, 309, 328, 335 (write+read)
- true, true, *: 303, 309, 320 (write with continuation)
Turns out there's actually only 4 paths :) The simple write+read wins
with 4 * 3 == 12 (assert CS#, write, read, de-assert CS#). Overhead
for any continuation would be accounted for in the next iteration.
Now that it's decoded (admittedly, it doesn't look like it), I think
it could get more obvious if the continuation check would be moved
after the regular CS# de-assertion. i.e.
assert cs#
if (write)
write command
if (read)
read command
de-assert cs#
if (!read && possible continuation)
continue
send_buf()
Simon, what do you think? That should make it clear that we always do
- assert - foo - de-assert,
- eventually either continue with the next iteration or call send_buf().
To view, visit change 40477. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
Gerrit-Change-Number: 40477
Gerrit-PatchSet: 25
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Alan Green <avg@google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Samir Ibradžić <sibradzic@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi@google.com>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Alan Green <avg@google.com>
Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Attention: Samir Ibradžić <sibradzic@gmail.com>
Gerrit-Comment-Date: Sun, 18 Apr 2021 23:06:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h@gmx.de>
Comment-In-Reply-To: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: comment