Attention is currently required from: Nikolai Artemiev.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/53947 )
Change subject: linux_mtd: move global state into programmer data field
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/53947
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5ce6900e4892ed5687cfddb245dfe5461a3e2e84
Gerrit-Change-Number: 53947
Gerrit-PatchSet: 4
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: 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: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Thu, 13 May 2021 00:59:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Peter Marheine.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54147 )
Change subject: libflashrom: clear layout on flashrom_layout_release
......................................................................
Patch Set 1:
(2 comments)
File layout.c:
https://review.coreboot.org/c/flashrom/+/54147/comment/8302fa21_570575b4
PS1, Line 296: layout->entries[i].included = false;
Should this line also move into flashrom_layout_release() ?
https://review.coreboot.org/c/flashrom/+/54147/comment/3fb70b5c_19f1d908
PS1, Line 279: layout_cleanup_args
This function is not cleaning up the layout anymore, only args. Maybe you can rename to `cleanup_layout_args`? or `args_cleanup` ?
--
To view, visit https://review.coreboot.org/c/flashrom/+/54147
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8ba4b356f2a40ccbfd4e91f81af01d5f6a6de515
Gerrit-Change-Number: 54147
Gerrit-PatchSet: 1
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Thu, 13 May 2021 00:18:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Peter Marheine has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/54147 )
Change subject: libflashrom: clear layout on flashrom_layout_release
......................................................................
libflashrom: clear layout on flashrom_layout_release
This changes the behavior of flashrom_layout_release to always clear the
provided layout, even if it is the global layout (as is currently always
the case).
Not clearing it causes confusing behavior where a user may release a
layout and create a new one, but because it's always the global layout
which wasn't cleared there will be stale information in the returned
layout. This can easily lead to writing unexpected flash regions because
the API provides no way to stop including regions, and makes it
effectively impossible to stop including a region without completely
tearing down the library.
Change-Id: I8ba4b356f2a40ccbfd4e91f81af01d5f6a6de515
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
---
M cli_classic.c
M flash.h
M layout.c
3 files changed, 7 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/47/54147/1
diff --git a/cli_classic.c b/cli_classic.c
index 5fd8092..9dcfe71 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -852,7 +852,7 @@
for (i = 0; i < chipcount; i++)
free(flashes[i].chip);
- layout_cleanup(&include_args);
+ layout_cleanup_args(&include_args);
free(filename);
free(fmapfile);
free(referencefile);
diff --git a/flash.h b/flash.h
index dd8e156..fbc3539 100644
--- a/flash.h
+++ b/flash.h
@@ -421,7 +421,7 @@
int register_include_arg(struct layout_include_args **args, const char *arg);
int read_romlayout(const char *name);
int normalize_romentries(const struct flashctx *flash);
-void layout_cleanup(struct layout_include_args **args);
+void layout_cleanup_args(struct layout_include_args **args);
/* spi.c */
struct spi_command {
diff --git a/layout.c b/layout.c
index 4d1dd56..f81e01d 100644
--- a/layout.c
+++ b/layout.c
@@ -276,10 +276,8 @@
return overlap_detected;
}
-void layout_cleanup(struct layout_include_args **args)
+void layout_cleanup_args(struct layout_include_args **args)
{
- struct flashrom_layout *const layout = get_global_layout();
- unsigned int i;
struct layout_include_args *tmp;
while (*args) {
@@ -289,13 +287,6 @@
free(*args);
*args = tmp;
}
-
- for (i = 0; i < layout->num_entries; i++) {
- free(layout->entries[i].name);
- free(layout->entries[i].file);
- layout->entries[i].included = false;
- }
- layout->num_entries = 0;
}
/* Validate and - if needed - normalize layout entries. */
@@ -405,14 +396,16 @@
{
unsigned int i;
- if (!layout || layout == get_global_layout())
+ if (!layout)
return;
for (i = 0; i < layout->num_entries; ++i) {
free(layout->entries[i].name);
free(layout->entries[i].file);
}
- free(layout);
+ layout->num_entries = 0;
+ if (layout != get_global_layout())
+ free(layout);
}
/** @} */ /* end flashrom-layout */
--
To view, visit https://review.coreboot.org/c/flashrom/+/54147
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8ba4b356f2a40ccbfd4e91f81af01d5f6a6de515
Gerrit-Change-Number: 54147
Gerrit-PatchSet: 1
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber.
Hello build bot (Jenkins), Edward O'Callaghan, Angel Pons, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54067
to look at the new patch set (#3).
Change subject: programmer: Make use of new register_spi_master() API
......................................................................
programmer: Make use of new register_spi_master() API
Pass pointers to dynamically allocated data to register_spi_master().
This way we can avoid some mutable globals.
Change-Id: Id7821f1db3284b7b5b3d0abfd878b979c53870a1
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M digilent_spi.c
M dummyflasher.c
M ft2232_spi.c
M it85spi.c
M it87spi.c
M jlink_spi.c
M linux_spi.c
M lspcon_i2c_spi.c
M pickit2_spi.c
M usbblaster_spi.c
M wbsio_spi.c
11 files changed, 22 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/67/54067/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/54067
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id7821f1db3284b7b5b3d0abfd878b979c53870a1
Gerrit-Change-Number: 54067
Gerrit-PatchSet: 3
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: 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-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Edward O'Callaghan.
Hello build bot (Jenkins), Edward O'Callaghan, Angel Pons, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54066
to look at the new patch set (#3).
Change subject: programmer: Smoothen register_spi_master() API
......................................................................
programmer: Smoothen register_spi_master() API
It was impossible to register a const struct spi_master that would
point to dynamically allocated `data`. Fix that so that we won't
have to create more mutable globals.
Change-Id: I0c753b3db050fb87d4bbe2301a7ead854f28456f
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M bitbang_spi.c
M buspirate_spi.c
M ch341a_spi.c
M dediprog.c
M digilent_spi.c
M dummyflasher.c
M ene_lpc.c
M ft2232_spi.c
M ichspi.c
M it85spi.c
M it87spi.c
M jlink_spi.c
M linux_spi.c
M lspcon_i2c_spi.c
M mec1308.c
M mstarddc_spi.c
M ni845x_spi.c
M pickit2_spi.c
M programmer.h
M raiden_debug_spi.c
M realtek_mst_i2c_spi.c
M sb600spi.c
M serprog.c
M spi.c
M stlinkv3_spi.c
M usbblaster_spi.c
M wbsio_spi.c
27 files changed, 33 insertions(+), 31 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/66/54066/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/54066
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0c753b3db050fb87d4bbe2301a7ead854f28456f
Gerrit-Change-Number: 54066
Gerrit-PatchSet: 3
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: 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-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Edward O'Callaghan.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54066 )
Change subject: programmer: Smoothen register_spi_master() API
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> I had the same thought and did right that :)
amazing, thank you! :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/54066
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0c753b3db050fb87d4bbe2301a7ead854f28456f
Gerrit-Change-Number: 54066
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: 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-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Wed, 12 May 2021 23:31:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Anastasia Klimchuk.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54066 )
Change subject: programmer: Smoothen register_spi_master() API
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> Just went through my patches once again, there are three which have +2s, everyone had a look, and no […]
I had the same thought and did right that :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/54066
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0c753b3db050fb87d4bbe2301a7ead854f28456f
Gerrit-Change-Number: 54066
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: 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-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 12 May 2021 23:29:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment