Attention is currently required from: Angel Pons, Anastasia Klimchuk.
Hello build bot (Jenkins), Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/52285
to look at the new patch set (#2).
Change subject: linux_spi.c: Refactor singleton states into reentrant pattern
......................................................................
linux_spi.c: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the spi_master data field for the life-time of the driver.
This is one of the steps on the way to move spi_master data
memory management behind the initialisation API, for more
context see other patches under the same topic "register_master_api".
TEST=builds
BUG=b:140394053
Change-Id: I93408c2ca846fca6a1c7eda7180862c51bd48078
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M linux_spi.c
1 file changed, 33 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/85/52285/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/52285
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I93408c2ca846fca6a1c7eda7180862c51bd48078
Gerrit-Change-Number: 52285
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: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Daniel Campello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52362 )
Change subject: cli_classic: Make -r/-w/-v argument optional
......................................................................
Patch Set 1:
(1 comment)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/52362/comment/a038df9e_12a3bd05
PS1, Line 140: static char *get_optional_filename(char *argv[])
> Can you leave a comment on this function what precisely it is expected to do here. […]
The diff is for a different functionality. In chromiumos you can specify a file (current flashrom), not specify a file (my proposed change here) and specify - (not in this change, and implemented by that diff) to used stdin and stdout instead of regular files for the fd.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52362
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I15384b92cb987a6ea1bb4369ef415488b9cf7f41
Gerrit-Change-Number: 52362
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Campello <campello(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: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
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: Thu, 15 Apr 2021 04:13:11 +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: Sam McNally, Nico Huber, Nicola Corna, Paul Menzel, Stefan Reinauer, David Hendricks, Arthur Heymans, Carl-Daniel Hailfinger.
Daniel Campello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/23021 )
Change subject: layout: Add -i <region>[:<file>] support
......................................................................
Patch Set 27:
(1 comment)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/23021/comment/012d23ac_6a9ef86b
PS27, Line 324: free(tempstr);
> Extremely minor and sorry to be a bother, do you mind splitting out this leak fix into a separate pa […]
Not a leak fix... before the string was stored directly on the layout entry... Now I'm strdup it (see layout.c new line 145) so freeing it right after here
--
To view, visit https://review.coreboot.org/c/flashrom/+/23021
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Gerrit-Change-Number: 23021
Gerrit-PatchSet: 27
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-Reviewer: Daniel Campello <campello(a)chromium.org>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nicola Corna <nicola(a)corna.info>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Nicola Corna <nicola(a)corna.info>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-Comment-Date: Thu, 15 Apr 2021 04:10:38 +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: Sam McNally, Nico Huber, Nicola Corna, Paul Menzel, Stefan Reinauer, David Hendricks, Daniel Campello, Arthur Heymans, Carl-Daniel Hailfinger.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/23021 )
Change subject: layout: Add -i <region>[:<file>] support
......................................................................
Patch Set 27: Code-Review+2
(1 comment)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/23021/comment/0bbe6862_17c69124
PS27, Line 324: free(tempstr);
Extremely minor and sorry to be a bother, do you mind splitting out this leak fix into a separate patch?
--
To view, visit https://review.coreboot.org/c/flashrom/+/23021
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Gerrit-Change-Number: 23021
Gerrit-PatchSet: 27
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-Reviewer: Daniel Campello <campello(a)chromium.org>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nicola Corna <nicola(a)corna.info>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Nicola Corna <nicola(a)corna.info>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Attention: Daniel Campello <campello(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-Comment-Date: Thu, 15 Apr 2021 04:05:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Angel Pons, Daniel Campello.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52362 )
Change subject: cli_classic: Make -r/-w/-v argument optional
......................................................................
Patch Set 1: Code-Review+2
(4 comments)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/52362/comment/f3874057_6b03ab9d
PS1, Line 140: static char *get_optional_filename(char *argv[])
Can you leave a comment on this function what precisely it is expected to do here. Longer term as the flashrom team here works on improving unit-test coverage I guess things like this are nice candidates for folks to get started with. Therefore comments help them form the right tests.
I left some comments in flashrom.c with the diff with how the chromiumos tree behaves with the file descriptors when the user doesn't specify them. I was wondering if you can speak to that diff more so that we can close the gap off there once this lands?
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/52362/comment/4beaa0f6_50ea259d
PS1, Line 1351: if ((image = fopen(filename, "rb")) == NULL) {
```
- if (!strncmp(filename, "-", sizeof("-")))
- image = fdopen(STDIN_FILENO, "rb");
- else
- image = fopen(filename, "rb");
- if (image == NULL) {
+ if ((image = fopen(filename, "rb")) == NULL) {
```
https://review.coreboot.org/c/flashrom/+/52362/comment/1f3c9283_663aa16f
PS1, Line 1361:
: if (image_stat.st_size != (intmax_t)size) {
```
- if ((image_stat.st_size != (__off_t)size) &&
- (strncmp(filename, "-", sizeof("-")))) {
+ if (image_stat.st_size != (intmax_t)size) {
```
https://review.coreboot.org/c/flashrom/+/52362/comment/871adb21_c9c6dd74
PS1, Line 1439: if ((image = fopen(filename, "wb")) == NULL) {
```
- if (!strncmp(filename, "-", sizeof("-")))
- image = fdopen(STDOUT_FILENO, "wb");
- else
- image = fopen(filename, "wb");
- if (image == NULL) {
+ if ((image = fopen(filename, "wb")) == NULL) {
```
--
To view, visit https://review.coreboot.org/c/flashrom/+/52362
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I15384b92cb987a6ea1bb4369ef415488b9cf7f41
Gerrit-Change-Number: 52362
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Campello <campello(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: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Daniel Campello <campello(a)chromium.org>
Gerrit-Comment-Date: Thu, 15 Apr 2021 04:01:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52308 )
Change subject: jlink_spi.c: Separate shutdown from failed init cleanup
......................................................................
Patch Set 2:
(1 comment)
File jlink_spi.c:
https://review.coreboot.org/c/flashrom/+/52308/comment/271bf53f_86a27b21
PS1, Line 181: init_ret
> just call this ret and default to failure, that is to say initialise with 1 instead of 0. […]
Default to failure: done. Makes sense, there are a lot of reasons for failure here.
I did not rename because there is one variable called "ret" already (line 206 in the latest patch set). Renaming would produce lots of diffs, maybe I will do this later (not in this patch)?
--
To view, visit https://review.coreboot.org/c/flashrom/+/52308
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71f64ed38154af670d4d28b8c7914d87fbc75679
Gerrit-Change-Number: 52308
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: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Thu, 15 Apr 2021 03:58:01 +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: Angel Pons, Anastasia Klimchuk.
Hello build bot (Jenkins), Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/52308
to look at the new patch set (#2).
Change subject: jlink_spi.c: Separate shutdown from failed init cleanup
......................................................................
jlink_spi.c: Separate shutdown from failed init cleanup
Shutdown function was covering two different jobs here:
1) the actual shutdown which is run at the end of the driver's
lifecycle and 2) cleanup in cases when initialisation failed.
Now, shutdown is only doing its main job (#1), and the driver
itself is doing cleanup when init fails (#2).
The good thing is that now resources are released/closed immediately
in cases when init fails (vs shutdown function which was run at some
point later), and the driver leaves clean space after itself
if init fails.
And very importantly this unlocks API change which plans to move
register_shutdown inside register master API, see this
https://review.coreboot.org/c/flashrom/+/51761
TEST=builds
BUG=b:185191942
Change-Id: I71f64ed38154af670d4d28b8c7914d87fbc75679
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M jlink_spi.c
1 file changed, 30 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/08/52308/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/52308
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71f64ed38154af670d4d28b8c7914d87fbc75679
Gerrit-Change-Number: 52308
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: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/52365 )
Change subject: flashrom.c: Fixup stale FIXME comment when doit() was removed
......................................................................
flashrom.c: Fixup stale FIXME comment when doit() was removed
Once upon a time flashrom had a entry point function called
doit(). Excise the last mention of it here so that we may
never mention it again.
BUG=none
TEST=none
Change-Id: I40d815b7154456c323b4230cd3fed2cc2e8e3641
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M flashrom.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/65/52365/1
diff --git a/flashrom.c b/flashrom.c
index c89abad..056fc57 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -2189,8 +2189,8 @@
return ret;
}
-/* FIXME: This function signature needs to be improved once doit() has a better
- * function signature.
+/* FIXME: This function signature needs to be improved once prepare_flash_access()
+ * has a better function signature.
*/
static int chip_safety_check(const struct flashctx *flash, int force,
int read_it, int write_it, int erase_it, int verify_it)
--
To view, visit https://review.coreboot.org/c/flashrom/+/52365
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I40d815b7154456c323b4230cd3fed2cc2e8e3641
Gerrit-Change-Number: 52365
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/52364 )
Change subject: programmer.h,chipset_enable.c: Make penable cb more descript
......................................................................
programmer.h,chipset_enable.c: Make penable cb more descript
The enable_flash callback function pointer embedded within
the penable struct is used by the chipset_enable entry-point
to dispatch to the correct concrete implementation. The handles
have the canonical form `flash_enable_<chipset-name>()` and
therefore `doit()` is hard to comprehend while groking code
and seeing to what it refers to. It is also a little more
confusing as there use to be another doit() in flashrom
once upon a time.
BUG=none
TEST=builds
Change-Id: I8b3a4ec51ea488c40c20ccafea883f8dea93577d
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M chipset_enable.c
M programmer.h
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/52364/1
diff --git a/chipset_enable.c b/chipset_enable.c
index d5c10c4..fd8bec2 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -2138,7 +2138,7 @@
continue;
}
msg_pinfo("Enabling flash write... ");
- ret = chipset_enables[i].doit(dev, chipset_enables[i].device_name);
+ ret = chipset_enables[i].enable_flash_xxx(dev, chipset_enables[i].device_name);
if (ret == NOT_DONE_YET) {
ret = -2;
msg_pinfo("OK - searching further chips.\n");
diff --git a/programmer.h b/programmer.h
index 29a100b..93540a6 100644
--- a/programmer.h
+++ b/programmer.h
@@ -225,7 +225,7 @@
const enum test_state status;
const char *vendor_name;
const char *device_name;
- int (*doit) (struct pci_dev *dev, const char *name);
+ int (*enable_flash_xxx) (struct pci_dev *dev, const char *name);
};
extern const struct penable chipset_enables[];
--
To view, visit https://review.coreboot.org/c/flashrom/+/52364
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b3a4ec51ea488c40c20ccafea883f8dea93577d
Gerrit-Change-Number: 52364
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange