Attention is currently required from: Aarya, Alexander Goncharov, Nikolai Artemiev, Peter Marheine.
Anastasia Klimchuk has posted comments on this change by Peter Marheine. ( https://review.coreboot.org/c/flashrom/+/82393?usp=email )
Change subject: erasure_layout: Fix get_flash_region bug
......................................................................
Patch Set 14:
(1 comment)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/82393/comment/fecea642_135db866?us… :
PS13, Line 368: for (unsigned int addr = region_start; addr <= region_end; addr += len) {
> I have changed tests, and looked into debugging messages, and now I have a piece of mind that the bu […]
I made CB:82723 to illustrate, the issue repro on head
Now the question is, how urgent the issue is. The memory is erased correctly, but not in an optimal way.
Peter what do you think?
(also for this latest patchset, Jenkins is not adding a comment, but the results are here https://qa.coreboot.org/job/flashrom_gerrit/11678/console)
--
To view, visit https://review.coreboot.org/c/flashrom/+/82393?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: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Gerrit-Change-Number: 82393
Gerrit-PatchSet: 14
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Fri, 31 May 2024 11:55:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/82723?usp=email )
Change subject: [WIP] Erase blocks are selected smaller than expected
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Running this on head, erase blocks are more granular than expected, specifically:
1017 [ RUN ] Erase test case #6
1018 Creating layout ... done
1019 Dummyflasher initialising with param=""... done
1020 Erase test case #6 started.
1021 Eraser called with blockaddr=0xf, blocklen=0x1
1022 read_chip called with start=0xf, len=0x1
1023 Eraser called with blockaddr=0xe, blocklen=0x1
1024 read_chip called with start=0xe, len=0x1
1025 Eraser called with blockaddr=0x6, blocklen=0x2
1026 read_chip called with start=0x6, len=0x2
1027 Eraser called with blockaddr=0xc, blocklen=0x2
1028 read_chip called with start=0xc, len=0x2
1029 Eraser called with blockaddr=0x8, blocklen=0x4
1030 read_chip called with start=0x8, len=0x4
1031 Eraser called with blockaddr=0x2, blocklen=0x2
1032 read_chip called with start=0x2, len=0x2
1033 Eraser called with blockaddr=0x4, blocklen=0x2
1034 read_chip called with start=0x4, len=0x2
1035 Eraser called with blockaddr=0x0, blocklen=0x2
1036 read_chip called with start=0x0, len=0x2
1037 Erase test case #6 returned 0.
1038 Erased chip memory state for Erase test case #6 is CORRECT
1039 Eraseblocks order of invocation for Erase test case #6 is WRONG
1040 Eraseblocks number of invocations for Erase test case #6 is WRONG, expected 4 actual 8
1021 Eraser called with blockaddr=0xf, blocklen=0x1
1023 Eraser called with blockaddr=0xe, blocklen=0x1
-> this could be one eraseblock of size 2
1031 Eraser called with blockaddr=0x2, blocklen=0x2
1033 Eraser called with blockaddr=0x4, blocklen=0x2
-> this could be one eraseblock of size 4
--
To view, visit https://review.coreboot.org/c/flashrom/+/82723?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: I47851d2b6106075111babf8c3535e5394cbbe0f9
Gerrit-Change-Number: 82723
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Fri, 31 May 2024 11:51:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Aarya, Alexander Goncharov, Nikolai Artemiev, Peter Marheine.
Anastasia Klimchuk has posted comments on this change by Peter Marheine. ( https://review.coreboot.org/c/flashrom/+/82393?usp=email )
Change subject: erasure_layout: Fix get_flash_region bug
......................................................................
Patch Set 14:
(2 comments)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/82393/comment/6598daea_c861aedb?us… :
PS13, Line 368: for (unsigned int addr = region_start; addr <= region_end; addr += len) {
> I looked at this loop and got a bit suspicious. […]
I have changed tests, and looked into debugging messages, and now I have a piece of mind that the bug that I suspected is not present :) Happy ending!
However after modifying tests I found something else suspicious: now "Erase protected region test case #3" behaves not as I expect. Specifically, there is a 4byte layout region, outside of protected area. I expect it to be erased by 4byte eraser, instead it is erased by 2b + 2b two erasers. The end state of memory is correct, but the behaviour is not optimal.
Maybe that's a double happy ending, if I found a different bug :D
I uploaded the patchset 14 to have a history of changes, but now I will try to debug "Erase protected region test case #3".
File tests/erase_func_algo.c:
https://review.coreboot.org/c/flashrom/+/82393/comment/4df28d74_823d2acc?us… :
PS13, Line 766:
: #define START_PROTECTED_REGION 8
: #define END_PROTECTED_REGION 15
> This was what I thought in the other comment: have this both in the middle of a chip (5-12, somethin […]
Done (protected region spans bytes 6-13)
--
To view, visit https://review.coreboot.org/c/flashrom/+/82393?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: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Gerrit-Change-Number: 82393
Gerrit-PatchSet: 14
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Fri, 31 May 2024 10:09:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Aarya, Alexander Goncharov, Nikolai Artemiev, Peter Marheine.
Anastasia Klimchuk has uploaded a new patch set (#14) to the change originally created by Peter Marheine. ( https://review.coreboot.org/c/flashrom/+/82393?usp=email )
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: erasure_layout: Fix get_flash_region bug
......................................................................
erasure_layout: Fix get_flash_region bug
When flash regions are protected, erase could incorrectly erase regions
which were meant to be protected by requesting the correct size but
using an erase opcode with coarser granularity than desired (for
instance using a 16-byte erase command while attempting to erase only 8
bytes).
This fixes that by exchanging the nesting of the loops over erase blocks
and flash regions.
Old:
- Select erasefns
- Loop over blocks to erase for each selected erasefn
- Loop over programmer flash regions within erase block
- Erase regions (may fail since selected erasefn will be
too big if flash region is smaller than erase block)
New:
- Loop over programmer flash regions within erase block
- Select erasefns within programer flash region
- Loop over blocks to erase for each selected erasefn
- Erase regions
Eraser selection and erasing has also been factored out into a helper
function to manage nesting depth.
TEST=New test cases pass, whereas some of them fail without the changes
to erasure_layout.c
BUG=https://ticket.coreboot.org/issues/525
Change-Id: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Co-authored-by: Nikolai Artemiev <nartemiev(a)google.com>
Co-authored-by: Anastasia Klimchuk <aklm(a)flashrom.org>
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
---
M erasure_layout.c
M tests/erase_func_algo.c
M tests/tests.c
M tests/tests.h
4 files changed, 495 insertions(+), 96 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/93/82393/14
--
To view, visit https://review.coreboot.org/c/flashrom/+/82393?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic5bf9d0f0e4a94c48d6f6e74e3cb9cccdc7adec9
Gerrit-Change-Number: 82393
Gerrit-PatchSet: 14
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Attention is currently required from: Paul Menzel, ZhiYuanNJ.
Anastasia Klimchuk has posted comments on this change by ZhiYuanNJ. ( https://review.coreboot.org/c/flashrom/+/82193?usp=email )
Change subject: ch347_spi: Add driver support for CH347F packaging
......................................................................
Patch Set 13:
(1 comment)
Patchset:
PS13:
> My SUBMIT button is in an unreachable state, prompting:You don't have permission to submit change 82 […]
Yes, this is normal, there is a limited group of core maintainers who can submit patches. You can read more on our guidelines: https://flashrom.org/dev_guide/development_guide.html#merging-patches
In this case, you are all good, your patch is ready. It will be submitted in few days.
Thank you for your work!
--
To view, visit https://review.coreboot.org/c/flashrom/+/82193?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: I693baf1a0d9dc20757f56fba626b5f5ad20f71dd
Gerrit-Change-Number: 82193
Gerrit-PatchSet: 13
Gerrit-Owner: ZhiYuanNJ
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: ZhiYuanNJ
Gerrit-Comment-Date: Fri, 31 May 2024 02:44:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: ZhiYuanNJ
Attention is currently required from: Paul Menzel.
ZhiYuanNJ has posted comments on this change by ZhiYuanNJ. ( https://review.coreboot.org/c/flashrom/+/82193?usp=email )
Change subject: ch347_spi: Add driver support for CH347F packaging
......................................................................
Patch Set 13:
(1 comment)
Patchset:
PS13:
My SUBMIT button is in an unreachable state, prompting:You don't have permission to submit change 82193
Is this a normal phenomenon?
--
To view, visit https://review.coreboot.org/c/flashrom/+/82193?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: I693baf1a0d9dc20757f56fba626b5f5ad20f71dd
Gerrit-Change-Number: 82193
Gerrit-PatchSet: 13
Gerrit-Owner: ZhiYuanNJ
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Comment-Date: Fri, 31 May 2024 02:29:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Peter Marheine has submitted this change. ( https://review.coreboot.org/c/flashrom/+/82677?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Add clarification to struct flash_region on chipoff_t
......................................................................
Add clarification to struct flash_region on chipoff_t
Although chipoff_t is fairly clearly documented on its own, it seems
fairly frequent that developers will treat the end address of a flash
region as an exclusive upper bound rather than the inclusive one it
should be; for example CB:82496 fixes an incorrect use that affected
multiple sites, and CB:73571 stemmed from a similar cause. Add a
clarifying comment to call attention to this, to help programmers avoid
making similar mistakes in the future.
Change-Id: I80b61a87ca31bd5a116224aadb4e211ee6841e1f
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/82677
Reviewed-by: Hsuan-ting Chen <roccochen(a)google.com>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M include/layout.h
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Anastasia Klimchuk: Looks good to me, approved
build bot (Jenkins): Verified
Hsuan-ting Chen: Looks good to me, but someone else must approve
diff --git a/include/layout.h b/include/layout.h
index 5614bea..d03a15b 100644
--- a/include/layout.h
+++ b/include/layout.h
@@ -37,6 +37,11 @@
struct flash_region {
char *name;
+ /*
+ * Note that because start and end are chipoff_t, end is an inclusive upper
+ * bound: the length of a region is (end - start + 1) bytes and it is
+ * impossible to represent a region with zero length.
+ */
chipoff_t start;
chipoff_t end;
bool read_prot;
--
To view, visit https://review.coreboot.org/c/flashrom/+/82677?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I80b61a87ca31bd5a116224aadb4e211ee6841e1f
Gerrit-Change-Number: 82677
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>