Bill XIE has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/84614?usp=email )
Change subject: erasure_layout: Erase larger block only when all sub-block need erase
......................................................................
erasure_layout: Erase larger block only when all sub-block need erase
A larger (not the smallest) erase block used to get erased when half
of sub-blocks it contains need erase, which has at least 2 issues:
1. The rest half of sub-blocks that do not need erase are also erased,
introducing some erase overheads.
2. More severely, since this logic only selects a block and delects
its sub-blocks when half of sub-blocks need erase, but this logic
does not deselect "double sub-blocks (sub-blocks of sub-block)" not
reach the limit under this block, the logic may cause duplicated
erase. For example, if a erase block (often the largest one
corresponding to the whole chip) has half of its sub-blocks and
some incontiguous double sub-blocks needing erase, these double
sub-blocks will end up being erased twice, introducing even more
erase overheads than whole-chip erase.
The older behavior of flashrom before adding erasure_layout.c, when no
communicational error occurs, will neither erase blocks that do not
need erase, nor cause duplicated erase. Higher efficiency should be
achieved without introducing extra erase overheads, by allowing
combining contiguous small erase blocks only when they can
coincidently form a larger erase block.
Change-Id: I9e10749186e395da67ec80e296119f33c3f83122
Signed-off-by: persmule <persmule(a)hardenedlinux.org>
---
M erasure_layout.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/14/84614/1
diff --git a/erasure_layout.c b/erasure_layout.c
index c3a415b..56841ab 100644
--- a/erasure_layout.c
+++ b/erasure_layout.c
@@ -228,7 +228,7 @@
}
const int total_blocks = sub_block_end - sub_block_start + 1;
- if (count && count > total_blocks/2) {
+ if (count == total_blocks) {
if (ll->start_addr >= rstart && ll->end_addr <= rend) {
for (int j = sub_block_start; j <= sub_block_end; j++)
layout[findex - 1].layout_list[j].selected = false;
--
To view, visit https://review.coreboot.org/c/flashrom/+/84614?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I9e10749186e395da67ec80e296119f33c3f83122
Gerrit-Change-Number: 84614
Gerrit-PatchSet: 1
Gerrit-Owner: Bill XIE <persmule(a)hardenedlinux.org>
Attention is currently required from: Balázs Vinarz, Keith Hui, Nico Huber.
Anastasia Klimchuk has posted comments on this change by Nico Huber. ( https://review.coreboot.org/c/flashrom/+/23053?usp=email )
Change subject: Fwd: Software info for Willem/EZOflash
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS2:
> have the user specify the protocol via programmer options
If this is fine for the user, this is a good option. Would the user know which protocol they need? For example, if you were the user?
dummyflasher.c can initialise more than one bus, and the desired option is set via programmer param. dummyflasher is an emulator-programmer, but it will do as an example how to init one bus or the other depending on the param.
Also, this can be done step-by-step, doesn't have to be in one commit. First commit adds programmer and support for spi. Second commit can add programmer param, and more options (parallel). If default option stays the same (default what happens without param provided), this should be fine.
Adding new programmer will be a large commit already, and lots of work, I think planning multiple commits will help.
File meson.build:
https://review.coreboot.org/c/flashrom/+/23053/comment/071e5f0a_231e3b68?us… :
PS2, Line 500:
> we might need to use the ezo here as well to maintain consistency, but that wouldn't mention that th […]
yes, let's use `ezo`
it seems it can be made to work with not only SPI
--
To view, visit https://review.coreboot.org/c/flashrom/+/23053?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Idc4d98593076c80fd1d6ac4596940d1d7977343c
Gerrit-Change-Number: 23053
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Balázs Vinarz <vinibali1(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-CC: Keith Hui <buurin(a)gmail.com>
Gerrit-CC: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Balázs Vinarz <vinibali1(a)gmail.com>
Gerrit-Attention: Keith Hui <buurin(a)gmail.com>
Gerrit-Comment-Date: Tue, 01 Oct 2024 05:26:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Balázs Vinarz <vinibali1(a)gmail.com>
Comment-In-Reply-To: Keith Hui <buurin(a)gmail.com>