Attention is currently required from: Dmitry Zhadinets, Peter Marheine.
Anastasia Klimchuk has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86875?usp=email )
Change subject: libflashrom: Update the API for Logger Callback
......................................................................
Patch Set 7:
(3 comments)
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86875/comment/0a9ecdc3_fa74d55b?us… :
PS7, Line 11: *
in one of your commits: please add yourself here too (and in the header too) :) You are doing a lot of changes to the API
https://review.coreboot.org/c/flashrom/+/86875/comment/1cfacdff_f1abd308?us… :
PS7, Line 75: (unsigned)size+1
in here, you need spaces between +,
`(unsigned)size + 1`
https://review.coreboot.org/c/flashrom/+/86875/comment/60b8ec97_1d5f41b4?us… :
PS7, Line 75: if (((unsigned)size+1) > sizeof(message))
: return -ERANGE;
> Anyway, you are the boss here, and I will do like it is needed
Thank you so much for writing in that much details, this is helpful! I read everything and did lots of thinking about it.
There are few items here:
1) I agree that max length of the message is for flashrom to decide. There was no max limit, but it seems like existing messages fit into 256 chars. So we can introduce the limit, document it, and that what it would be for future.
For this, the remaining part to do it document it in print function, which is in `include/flash.h` currently line 734
It should clearly say that "max message length is 256, and if the message is longer than that",
2) What to do if the message is longer? I think one thing definitely _not_ to do is silently drop the message. But current code returns an error, which is already not silent. (I don't think return value of print is checked anywhere, but it's a different story - the error is returned).
So this needs to be also in documentation: "if the message is longer than limit, the error code ERANGE is returned and message is not printed. For long pieces of information, print should be called multiple times."
3) flashrom_set_loglevel() is a good idea, sorry that I haven't responded yet to that on the mailing list. I will do it after this!
I think it can be in a separate commit. This one is large, and code review took a while already, and it's mentally exhaustive to carry around large commit for a long time.
log level seems like a separate question (adjacent to this, but still), so it can be separate commit.
4) also
> we a bit stuck here
sorry! I know sometimes code review takes a while. I very much respect other people's work. We are almost there!
--
To view, visit https://review.coreboot.org/c/flashrom/+/86875?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: Iea738bd371fa3d69b9cf222c89ee67490d30af39
Gerrit-Change-Number: 86875
Gerrit-PatchSet: 7
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Sat, 29 Mar 2025 08:11:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Peter Marheine.
Dmitry Zhadinets has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86875?usp=email )
Change subject: libflashrom: Update the API for Logger Callback
......................................................................
Patch Set 7:
(1 comment)
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86875/comment/a60be21b_4324a0b3?us… :
PS7, Line 75: if (((unsigned)size+1) > sizeof(message))
: return -ERANGE;
> Honestly, I would add assert here (if the message length is more then something), but there are no a […]
Anyway, you are the boss here, and I will do like it is needed
--
To view, visit https://review.coreboot.org/c/flashrom/+/86875?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: Iea738bd371fa3d69b9cf222c89ee67490d30af39
Gerrit-Change-Number: 86875
Gerrit-PatchSet: 7
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Fri, 28 Mar 2025 17:18:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Peter Marheine.
Dmitry Zhadinets has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86875?usp=email )
Change subject: libflashrom: Update the API for Logger Callback
......................................................................
Patch Set 7:
(1 comment)
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86875/comment/3db70568_f84c6115?us… :
PS7, Line 75: if (((unsigned)size+1) > sizeof(message))
: return -ERANGE;
> A question here: I remember initial comment thread was about fallback to dymanic allocation if messa […]
Honestly, I would add assert here (if the message length is more then something), but there are no asserts in the project and I assume there is a reason for this. The length of the message depends on the abstract developer of flashrom project only. And I assume this developer really wants that flashrom will work faster, eat less memory, API will be useful and so on. This limitation (I mean the small size of the single message from the flashrom) is like an inner contract, a deal between developers. "Do not try to write "War & Peace" in the messages. Brevity is the sister of talent." BTW, really long messages are already generated by flashrom, without '\n' at the end, using a sequence of messages. So, at the moment we do not have such issue then it will be for future addons to the codebase. I tested the length with unittests and by hands. May be there is some server where we can perform full coverage test.
To be faster: I really want to add set_log_level function. Because right now even for any trace messages we will be calling user's callback. We cannot guarantee that everything is good there (some heavy construction can be used even to check necessity to do something). Just imaging crazy case. You are reading the next page of a flash memory and sending DEBUG message to print but he goes to the cloud to get settings about his current log level. You understand how long overall read will be. Even in my gflashrom it is several jump by pointers and a creation of C++ string.
It will be my next commit to the chain but we a bit stuck here.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86875?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: Iea738bd371fa3d69b9cf222c89ee67490d30af39
Gerrit-Change-Number: 86875
Gerrit-PatchSet: 7
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Fri, 28 Mar 2025 16:48:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Dolan Liu, Nikolai Artemiev, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by Dolan Liu. ( https://review.coreboot.org/c/flashrom/+/86348?usp=email )
Change subject: flashchips: Add Macronix MX77U25650FZ4I42
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/86348?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: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Gerrit-Change-Number: 86348
Gerrit-PatchSet: 6
Gerrit-Owner: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 28 Mar 2025 06:05:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Dmitry Zhadinets, Peter Marheine.
Anastasia Klimchuk has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86875?usp=email )
Change subject: libflashrom: Update the API for Logger Callback
......................................................................
Patch Set 7:
(2 comments)
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86875/comment/13485125_4d671307?us… :
PS6, Line 84: if (!log_callback && global_log_callback == format_message_and_invoke_log_callback_v2)
: global_log_callback = NULL;
> *The logic of this condition was to reset log callback v**1** only in the case if it was installed b […]
I wasn't realising at the time of writing the comment that I found a bug :) But I am so happy that I could help.
Thank you for detailed explanation of use case you had in mind, now I understand why you added a test which was mixing v1 and v2 together in one scenario.
Sorry that I asked you to remove the test! Now that I understand, you can add it back - if you want of course. I would still want to keep two granular tests (the ones which are in current patchset already), also no global state. But if you still interested, you can add back the test which sets/resets callbacks using combination of v1 and v2. As you decide.
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86875/comment/87154054_de01e76c?us… :
PS7, Line 75: if (((unsigned)size+1) > sizeof(message))
: return -ERANGE;
A question here: I remember initial comment thread was about fallback to dymanic allocation if message size is above limit. But this code returns an error if the message is above limit, and does not print the message?
--
To view, visit https://review.coreboot.org/c/flashrom/+/86875?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: Iea738bd371fa3d69b9cf222c89ee67490d30af39
Gerrit-Change-Number: 86875
Gerrit-PatchSet: 7
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Fri, 28 Mar 2025 06:04:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Dolan Liu, Nikolai Artemiev, Stefan Reinauer.
DZ has posted comments on this change by Dolan Liu. ( https://review.coreboot.org/c/flashrom/+/86348?usp=email )
Change subject: flashchips: Add Macronix MX77U25650FZ4I42
......................................................................
Patch Set 6: Code-Review+1
(1 comment)
Patchset:
PS2:
> Daniel, sorry to bother you again, would you approve the latest patchset? There were few small chang […]
OK
--
To view, visit https://review.coreboot.org/c/flashrom/+/86348?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: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Gerrit-Change-Number: 86348
Gerrit-PatchSet: 6
Gerrit-Owner: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 28 Mar 2025 05:51:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: DZ <danielzhang(a)mxic.com.cn>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: DZ, Dolan Liu, Nikolai Artemiev, Stefan Reinauer.
Anastasia Klimchuk has posted comments on this change by Dolan Liu. ( https://review.coreboot.org/c/flashrom/+/86348?usp=email )
Change subject: flashchips: Add Macronix MX77U25650FZ4I42
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS2:
> Thank you so much for your help
Daniel, sorry to bother you again, would you approve the latest patchset? There were few small changes since last time you looked, and when new patchset is uploaded all the votes are reset.
Thank you!
--
To view, visit https://review.coreboot.org/c/flashrom/+/86348?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: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Gerrit-Change-Number: 86348
Gerrit-PatchSet: 6
Gerrit-Owner: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Attention: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 28 Mar 2025 05:14:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: DZ <danielzhang(a)mxic.com.cn>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, DZ, Nikolai Artemiev, Stefan Reinauer.
Dolan Liu has posted comments on this change by Dolan Liu. ( https://review.coreboot.org/c/flashrom/+/86348?usp=email )
Change subject: flashchips: Add Macronix MX77U25650FZ4I42
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS4:
> Thanks for updates! Just one more thing: […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/86348?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: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Gerrit-Change-Number: 86348
Gerrit-PatchSet: 5
Gerrit-Owner: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Fri, 28 Mar 2025 03:17:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: DZ, Dolan Liu, Nikolai Artemiev, Stefan Reinauer.
Hello Anastasia Klimchuk, DZ, Nikolai Artemiev, Stefan Reinauer, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/86348?usp=email
to look at the new patch set (#5).
Change subject: flashchips: Add Macronix MX77U25650FZ4I42
......................................................................
flashchips: Add Macronix MX77U25650FZ4I42
Add initial support for Macronix MX77U25650F
Bug=N/A
TEST=build flashrom and read/write/earse on unit works
e.g. command:
flashrom -p raiden_debug_spi:target=AP -w image.bin
flashrom --read -o image.bin
futility update/read
Change-Id: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Signed-off-by: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
---
M flashchips/macronix.c
M include/flashchips.h
2 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/86348/5
--
To view, visit https://review.coreboot.org/c/flashrom/+/86348?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: I7866b2db343f4eb2bc194400ceca099d3af3b87d
Gerrit-Change-Number: 86348
Gerrit-PatchSet: 5
Gerrit-Owner: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: DZ <danielzhang(a)mxic.com.cn>
Gerrit-Attention: Dolan Liu <liuyong5(a)huaqin.corp-partner.google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>