Attention is currently required from: Miklós Márton, Edward O'Callaghan, Angel Pons, Arthur Heymans.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55269 )
Change subject: treewide: Use calloc() where applicable
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Since I am one of reviewers here, what are our plans for this patch? I thought it's all good, but I read all Nico's comments and think that there can be more caveats than I can see...
--
To view, visit https://review.coreboot.org/c/flashrom/+/55269
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id6ef0d6d02c7b63baabc9a0087275cab22a48736
Gerrit-Change-Number: 55269
Gerrit-PatchSet: 2
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Comment-Date: Tue, 27 Jul 2021 01:30:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add tests to erase a chip
......................................................................
Patch Set 3:
(2 comments)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/8973261b_f6f7777a
PS1, Line 42: printf("Unlock chip called\n");
> If you're emulating a chip, I'd also mock and verify locking to increase test coverage
I added chip state which counts how many times unlock was called, and then read/write/erase check that unlock has been called. This is all added for fake chip test.
https://review.coreboot.org/c/flashrom/+/56501/comment/17177d48_13e309c9
PS1, Line 57: char *param_dup = strdup("");
> Hmmm, I guess the `memmove` inside that function changes the haystack. If so... […]
Yes, from my memory it is memmove. I remember spending a while on this when I was writing the very first test, memmove did segfault because it was trying to modify read-only memory. Eventually I added strdup to workaround that.
--
To view, visit https://review.coreboot.org/c/flashrom/+/56501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Gerrit-Change-Number: 56501
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 27 Jul 2021 01:03:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/56501
to look at the new patch set (#3).
Change subject: tests: Add tests to erase a chip
......................................................................
tests: Add tests to erase a chip
Two tests cover the code which parforms do_erase operation.
First one works with fake chip and dummy programmer. Fake chip has all
operations defined, they all log and return 0. Read operation always
initialises buffer with one and the same value.
Second one uses the chip which is closer to the real one, because
read/write/unlock/erase operations are real. The tests takes the
advantage of dummyflasher's capability of emulating a W25Q128.V chip.
BUG=b:181803212
TEST=builds and ninja test
Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M meson.build
A tests/chip.c
M tests/meson.build
M tests/tests.c
M tests/tests.h
A tests/wrap_send_tests.c
A tests/wrap_send_tests.h
7 files changed, 329 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/01/56501/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/56501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Gerrit-Change-Number: 56501
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk, Andrew Bresticker.
johnsonh(a)waymo.com has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56164 )
Change subject: ft2232_spi: Add FTDI search by description.
......................................................................
Patch Set 5:
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/56164/comment/5b388d9a_f3b77c3e
PS4, Line 17: with the same vid/pid/serial number are plugged in, description can still
> Looks like this line is just one char over the limit (72 chars). […]
Done
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/56164/comment/3aff8c9f_5fbd3dee
PS4, Line 504: f = ftdi_usb_open_desc(&ftdic, ft2232_vid, ft2232_type, arg2, arg)
> Just to double-check, basic case when there is only one device and description param is not provided […]
Done, and added a note to the commit description.
--
To view, visit https://review.coreboot.org/c/flashrom/+/56164
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib4be23247995710900175f5f16e38db577ef08fa
Gerrit-Change-Number: 56164
Gerrit-PatchSet: 5
Gerrit-Owner: johnsonh(a)waymo.com
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Andrew Bresticker <abrestic(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Andrew Bresticker <abrestic(a)google.com>
Gerrit-Comment-Date: Mon, 26 Jul 2021 18:55:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, johnsonh(a)waymo.com, Angel Pons, Andrew Bresticker.
Hello build bot (Jenkins), Nico Huber, Angel Pons, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/56164
to look at the new patch set (#5).
Change subject: ft2232_spi: Add FTDI search by description.
......................................................................
ft2232_spi: Add FTDI search by description.
This adds to the search-by-serial functionality with
search-by-description (product string). This is useful when e.g. one has
multiple FTDIs in a system and wants the serial numbers to reflect the
system-level serial number, and the description to reflect the
subcomponent names.
Tested manually by running with both serial and description searches, on
a machine with multiple FTDIs plugged in. Ensured that when two devices
with the same vid/pid/serial number are plugged in, description can
be used to differentiate.
Verifed no-description, no-serial, one FTDI plugged in base case works.
Original version of this code used the original single "arg" char*, but
on further thought, this wasn't worth the readability and functionality
losses. The new version with arg2 gets rid of several lines of code, the
gotos, and adds the ability to filter by both description and serial
simultaneously.
Change-Id: Ib4be23247995710900175f5f16e38db577ef08fa
Signed-off-by: Harry Johnson <johnsonh(a)waymo.com>
---
M ft2232_spi.c
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/56164/5
--
To view, visit https://review.coreboot.org/c/flashrom/+/56164
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib4be23247995710900175f5f16e38db577ef08fa
Gerrit-Change-Number: 56164
Gerrit-PatchSet: 5
Gerrit-Owner: johnsonh(a)waymo.com
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Andrew Bresticker <abrestic(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: johnsonh(a)waymo.com
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Andrew Bresticker <abrestic(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add tests to erase a chip
......................................................................
Patch Set 2:
(2 comments)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/93e4eb1d_ef70eeb1
PS1, Line 42: printf("Unlock chip called\n");
> Currently unlock is optional, which is […]
If you're emulating a chip, I'd also mock and verify locking to increase test coverage
https://review.coreboot.org/c/flashrom/+/56501/comment/1f6947c7_471a372c
PS1, Line 57: char *param_dup = strdup("");
> This only works for the case when param is empty string. […]
Hmmm, I guess the `memmove` inside that function changes the haystack. If so... Eww!
--
To view, visit https://review.coreboot.org/c/flashrom/+/56501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Gerrit-Change-Number: 56501
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Mon, 26 Jul 2021 18:42:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Miklós Márton, Thomas Heijligen, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56103 )
Change subject: spi_master: Use new API to register shutdown function
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS1:
> This is really nice, thank you so much!
Miklos, just checking, maybe you have already tested everything but just forgot to respond here? :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/56103
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib60300f9ddb295a255d5ef3f8da0e07064207140
Gerrit-Change-Number: 56103
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 26 Jul 2021 06:57:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Miklós Márton <martonmiklosqdev(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add tests to erase a chip
......................................................................
Patch Set 2:
(9 comments)
Patchset:
PS2:
The newest test that I have added uses real spi_send_command, however some previous tests are mocking the same function. Means, we have to have two tests executables where one of executables uses real spi_send_command and second one wraps spi_send_command.
I do intent to split this into two patches, but I just wanted to upload this for review to check that we all agree on the overall idea.
Thanks for reviews! I have two cool tests instead of one, because of the great comments from you!
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/ec48827b_ae250329
PS1, Line 26: /*
: * Populate buf with the value used for erase operation, this allows to pass
: * verification checks and also emulates successful erase.
: */
: buf = memset(buf, 0xff, len);
> +1. […]
Andel and Edward, thanks to your great comments, I spent some time with this, and now I have one more test, which is actually using dummyflasher for all chip operations!!! This is 10x more cool, thank you so much!
I still want to keep first test with fake read/write/erase, because they log and also as a foundation for further (later) experiments with various combinations of chip size and layout. Second test has to have it all like real W25Q128.V.
https://review.coreboot.org/c/flashrom/+/56501/comment/60d43c62_6771937e
PS1, Line 42: printf("Unlock chip called\n");
> Even better would be to prevent erases/writes if the chip hasn't been unlocked.
Currently unlock is optional, which is
if (flash->chip->unlock)
flash->chip->unlock(flash);
Or do you mean "prevent erases/writes if unlock function present, but hasn't been invoked"?
https://review.coreboot.org/c/flashrom/+/56501/comment/38ef8d90_09bf9281
PS1, Line 57: char *param_dup = strdup("");
> The second parameter of `programmer_init()` is of `const char *` type. […]
This only works for the case when param is empty string. If it is not empty, it needs to be strdup'ed. I think this is because they way extract_programmer_params works.
https://review.coreboot.org/c/flashrom/+/56501/comment/6f16b1dd_0627fd11
PS1, Line 61: /*
: * Total size less than 16 * 1024 to skip some steps
: * in flashrom.c#prepare_flash_access.
: */
> Is skipping these steps an issue, though? `spi_master_no_4ba_modes()` can only return true for SPI p […]
Now I have two tests, one with small size chip, another with large chip. Yes right, doesn't seem to be any issues.
https://review.coreboot.org/c/flashrom/+/56501/comment/722fb5ee_e9e91cfa
PS1, Line 73: {2 * 1024, 3}
> Huh? This is just three blocks of 2 KiB each. The flash chip size is 8 MiB (`total_size` is in KiB). […]
I corrected chip size and layout size, I think I just got confused that total_size is in KiB. The intention was to have fake chip with small size, covered by layout and covered by erase blocks.
https://review.coreboot.org/c/flashrom/+/56501/comment/4ff203c8_ac8a5c24
PS1, Line 86: 0x00000000
> 0
Done
https://review.coreboot.org/c/flashrom/+/56501/comment/68dfaf9e_6a4f931f
PS1, Line 86: 0x00002000
> chip->total_size * KiB
Done (with -1 because it starts from 0).
https://review.coreboot.org/c/flashrom/+/56501/comment/0bdc5b3e_100912e8
PS1, Line 114: free(param_dup);
> If using a string literal on line 57, this must be removed.
Removed for empty param (still need strdup for non-empty param).
--
To view, visit https://review.coreboot.org/c/flashrom/+/56501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Gerrit-Change-Number: 56501
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 26 Jul 2021 06:54:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/56501
to look at the new patch set (#2).
Change subject: tests: Add tests to erase a chip
......................................................................
tests: Add tests to erase a chip
Two tests cover the code which parforms do_erase operation.
First one works with fake chip and dummy programmer. Fake chip has all
operations defined, they all log and return 0. Read operation always
initialises buffer with one and the same value.
Second one uses the chip which is closer to the real one, because
read/write/unlock/erase operations are real. The tests takes the
advantage of dummyflasher's capability of emulating a W25Q128.V chip.
BUG=b:181803212
TEST=builds and ninja test
Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M meson.build
A tests/chip.c
M tests/meson.build
M tests/tests.c
M tests/tests.h
A tests/wrap_send_tests.c
A tests/wrap_send_tests.h
7 files changed, 308 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/01/56501/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/56501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6f74bfe4e02244d24d6c837cc3d551251e7b4898
Gerrit-Change-Number: 56501
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset