Attention is currently required from: Simon Buhrow, Nico Huber, Thomas Heijligen, Paul Menzel, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65879 )
Change subject: flashrom.c:Add function to get a flattened view of the chip erase blocks
......................................................................
Patch Set 54:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/65879/comment/7c59cb72_2957dd84
PS41, Line 1237:
: struct erase_layout *create_erase_layout(struct flashctx *const flashctx);
:
> Done
well done!
--
To view, visit https://review.coreboot.org/c/flashrom/+/65879
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iafe78de00daa55f7114bd4ce09465dd88074ece4
Gerrit-Change-Number: 65879
Gerrit-PatchSet: 54
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 07:29:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71119 )
Change subject: flashrom.c: Add switch for legacy impl of erasure path
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS6:
You can keep this early in your series, we should keep your patches flowing in as we get though each part instead of a all or nothing and them hanging in review forever.
Thanks for working so hard on this erasure optimisation stuff!
--
To view, visit https://review.coreboot.org/c/flashrom/+/71119
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5660db0067c1c799dcb5c8e83b4a4826b236442
Gerrit-Change-Number: 71119
Gerrit-PatchSet: 6
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 07:28:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Simon Buhrow, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65844 )
Change subject: flashrom.c:Add a function to get list of sectors that need erasing
......................................................................
Patch Set 73: Code-Review+2
(6 comments)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/65844/comment/10acfaa5_736a3d05
PS73, Line 127: void *
`void *` in type system speak is mostly like putting on a blind-fold and jumping between a large canyon hoping you will arrive on the other side safely.
These contents buffers are byte array's on the heap, use the correct type of `uint8_t`.
https://review.coreboot.org/c/flashrom/+/65844/comment/4eda0de4_5f8081d4
PS73, Line 127: region_start
`rstart` and Doxygen.
https://review.coreboot.org/c/flashrom/+/65844/comment/460a9985_2047f4bf
PS73, Line 127: region_end
`rend` and Doxygen.
https://review.coreboot.org/c/flashrom/+/65844/comment/6412aab7_4c1e4220
PS73, Line 127: struct flashctx *flashctx,
by convention, keep the `flashctx` as the first argument to the function, it helps keep the code-base more consistent for one reason of a few.
like wrap the function definition.
https://review.coreboot.org/c/flashrom/+/65844/comment/65363ac0_60541c38
PS73, Line 127: function_index
`findex` and in the Doxygen comment you can say "function index".
https://review.coreboot.org/c/flashrom/+/65844/comment/81e7ac06_e23e463a
PS73, Line 130: function_index == 0
`!foo` is canonical for the 0 or NULL case.
--
To view, visit https://review.coreboot.org/c/flashrom/+/65844
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic57ca1cca3d1646543f6b5939ba9c35db8d08256
Gerrit-Change-Number: 65844
Gerrit-PatchSet: 73
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 07:26:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65642 )
Change subject: flashrom.c:Add function to align region to sector boundaries
......................................................................
Patch Set 74: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/65642
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I215ea4986aa23360fc65ff761f4e49c6069160ac
Gerrit-Change-Number: 65642
Gerrit-PatchSet: 74
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 07:20:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Simon Buhrow, Nico Huber, Thomas Heijligen, Paul Menzel, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65879 )
Change subject: flashrom.c:Add function to get a flattened view of the chip erase blocks
......................................................................
Patch Set 54:
(9 comments)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/65879/comment/75da22dc_7cc888bb
PS54, Line 26: if (layout) {
rewrite your function like this:
```
if (!layout)
return;
for (unsigned int i = 0; i < erasefn_count; i++) {
free(layout[i].layout_list);
}
free(layout);
```
https://review.coreboot.org/c/flashrom/+/65879/comment/9aad4e8a_84f60ab1
PS54, Line 34: )
The signature of this function should be,
```
unsigned int create_erase_layout(struct flashctx *const flashctx,
struct erase_layout **elayout)
{
```
ret is <0 on error, =0 on no erasefn_count's or >0 with no. of erasefn_count's.
https://review.coreboot.org/c/flashrom/+/65879/comment/4479918a_b8c1a4b2
PS54, Line 34: create_erase_layout
with the comments below I am expecting a few static functions that should be relatively small and this function will stitch them together.
https://review.coreboot.org/c/flashrom/+/65879/comment/80303a73_0fb8a18e
PS54, Line 48: ;
\n
https://review.coreboot.org/c/flashrom/+/65879/comment/b7f4e7a5_9f0b45e8
PS54, Line 54: int j = 0;
: while(addr < chip->total_size * 1024) {
ok `j` is shadowed below. Rewrite this while-loop construct as a `for` loop construct as:
```
for (unsigned i = 0; addr < chip->total_size * 1024; i++) {
const struct eraseblock *block = &chip->block_erasers[eraser_idx].eraseblocks[i];
block_count += block->count;
addr += block->size * block->count;
}
```
to avoid shadowing or scope to a helper function.
* The key message I am communicating here is minimum scope.
The other secondary message I am pealing back at is how these loops can become infinite or undefined.
https://review.coreboot.org/c/flashrom/+/65879/comment/8df0ae7e_206596a2
PS54, Line 55: (
> trivial: `e (`
Ack
https://review.coreboot.org/c/flashrom/+/65879/comment/59ca8312_cfe70e94
PS54, Line 62: (struct eraseblock_data *)malloc
use `calloc()`.
Is the construction of `layout[layout_idx].layout_list` on the heap it's own function? It would make digesting how deep these loops are tractable as to maintain this code.
https://review.coreboot.org/c/flashrom/+/65879/comment/4ac13ba1_a5da5a8f
PS54, Line 86: (layout[layout_idx-1].layout_list[sub_block_index].start_addr >= start_addr &&
: layout[layout_idx-1].layout_list[sub_block_index].end_addr <= end_addr &&
: sub_block_index < layout[layout_idx-1].block_count)
in this new function made out of this `if`-block turn this wild predicate into a intermediate with a name.
https://review.coreboot.org/c/flashrom/+/65879/comment/fff59680_94925c32
PS54, Line 84: if (layout_idx > 0) {
: layout[layout_idx].layout_list[block_num].first_sub_block_index = sub_block_index;
: while (layout[layout_idx-1].layout_list[sub_block_index].start_addr >= start_addr &&
: layout[layout_idx-1].layout_list[sub_block_index].end_addr <= end_addr &&
: sub_block_index < layout[layout_idx-1].block_count) {
: sub_block_index++;
: }
: layout[layout_idx].layout_list[block_num].last_sub_block_index = sub_block_index - 1;
: }
looks like another function with a base case of `layout_idx == 0 => return`.
--
To view, visit https://review.coreboot.org/c/flashrom/+/65879
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iafe78de00daa55f7114bd4ce09465dd88074ece4
Gerrit-Change-Number: 65879
Gerrit-PatchSet: 54
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 07:19:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Simon Buhrow, Thomas Heijligen, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71174 )
Change subject: flash.h: Make functions global that will be used for new erase algorithm
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/71174
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7ee7e208948337b88467935fd2861b5f9ad6af9d
Gerrit-Change-Number: 71174
Gerrit-PatchSet: 2
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 06:47:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Aarya.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71119 )
Change subject: flashrom.c: Add switch for legacy impl of erasure path
......................................................................
Patch Set 6: Code-Review+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/71119
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5660db0067c1c799dcb5c8e83b4a4826b236442
Gerrit-Change-Number: 71119
Gerrit-PatchSet: 6
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Fri, 23 Dec 2022 06:45:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Simon Buhrow, Nico Huber, Aarya, Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66104 )
Change subject: flashrom.c: Add wrapper function to use the erase algorithm
......................................................................
Patch Set 91:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/66104/comment/2006480e_70b1a7f0
PS78, Line 6:
: flashrom.c: Add wrapper function to use the erase algorithm
:
: Add a function to call the erase algorithm.
> commit message is unrelated to content.
Doxygen and squash.
--
To view, visit https://review.coreboot.org/c/flashrom/+/66104
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I29e3f2bd796759794184b125741a5abaac6f3ce8
Gerrit-Change-Number: 66104
Gerrit-PatchSet: 91
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Fri, 23 Dec 2022 03:36:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment