Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54890 )
Change subject: programmer: Introduce default shutdown function
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54890/comment/1489d06d_5cf8caab
PS1, Line 13: lot of par masters that
: will use it in the nearest future.
lets rebase this once we have a few more users rather than too prematurely introducing it. However, good direction.
--
To view, visit https://review.coreboot.org/c/flashrom/+/54890
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b20717ba549e12edffbc5d1643ff064a4f0c517
Gerrit-Change-Number: 54890
Gerrit-PatchSet: 1
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Tue, 25 May 2021 05:00:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/54890 )
Change subject: programmer: Introduce default shutdown function
......................................................................
programmer: Introduce default shutdown function
Default shutdown function is only freeing master data (if data exists)
and not doing anything else.
There is one spi master which can use default shutdown function
(usbblaster, included in this patch), and a lot of par masters that
will use it in the nearest future.
BUG=b:185191942
TEST=builds
Change-Id: I8b20717ba549e12edffbc5d1643ff064a4f0c517
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M flashrom.c
M programmer.h
M usbblaster_spi.c
3 files changed, 9 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/90/54890/1
diff --git a/flashrom.c b/flashrom.c
index 0af5057..069d59a 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -553,6 +553,13 @@
static int check_block_eraser(const struct flashctx *flash, int k, int log);
+int default_shutdown(void *data)
+{
+ if (data)
+ free(data);
+ return 0;
+}
+
/* Register a function to be executed on programmer shutdown.
* The advantage over atexit() is that you can supply a void pointer which will
* be used as parameter to the registered function upon programmer shutdown.
diff --git a/programmer.h b/programmer.h
index 790fcc8..17bfd2f 100644
--- a/programmer.h
+++ b/programmer.h
@@ -612,6 +612,7 @@
extern unsigned long flashbase;
unsigned int count_max_decode_exceedings(const struct flashctx *flash);
char *extract_programmer_param(const char *param_name);
+int default_shutdown(void *data);
/* spi.c */
#define MAX_DATA_UNSPECIFIED 0
diff --git a/usbblaster_spi.c b/usbblaster_spi.c
index 115876e..61edc2e 100644
--- a/usbblaster_spi.c
+++ b/usbblaster_spi.c
@@ -162,12 +162,6 @@
return ret;
}
-static int usbblaster_shutdown(void *data)
-{
- free(data);
- return 0;
-}
-
static const struct spi_master spi_master_usbblaster = {
.max_data_read = 256,
.max_data_write = 256,
@@ -227,7 +221,7 @@
}
usbblaster_data->ftdic = ftdic;
- if (register_shutdown(usbblaster_shutdown, usbblaster_data)) {
+ if (register_shutdown(default_shutdown, usbblaster_data)) {
free(usbblaster_data);
return -1;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/54890
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b20717ba549e12edffbc5d1643ff064a4f0c517
Gerrit-Change-Number: 54890
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c, ene_lpc.c
......................................................................
Patch Set 18:
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/51487/comment/64b18c06_4cdf9bf9
PS6, Line 9: hwaccess_io.h
: because those are needed to test lifecycle of mec1308.c
> I added test for ene_lpc. […]
This is done, marking resolved
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/c77a3e1c_c78ab0f8
PS6, Line 102: return ((port == 0x2e /* MEC1308_SIO_PORT1 */
: || port == 0x4e /* MEC1308_SIO_PORT2 */)
: ? 0x20 /* MEC1308_DEVICE_ID_REG */
: : ((outb_val == 0x84 /* MEC1308_MBX_DATA_START */)
: ? 0xaa /* MEC1308_CMD_PASSTHRU_SUCCESS */
: : 0));
> This is awesome, and it works! Thank you!
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/51487
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3af612defe1af3850dfc1626a208d873e3a3eddc
Gerrit-Change-Number: 51487
Gerrit-PatchSet: 18
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Simon Glass <sjg(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
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: Tue, 25 May 2021 04:05:35 +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: Nico Huber, Namyoon Woo, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54748 )
Change subject: dummyflasher.c: Extract params processing into a separate function
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> Can I do this after the chain submitted? Sure, I will resolve all conflicts, but if I rebase now and […]
I rebased on the top of what is already submitted.
--
To view, visit https://review.coreboot.org/c/flashrom/+/54748
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I04f55f77bb4703f1d88b2191c45a22be3c97bf87
Gerrit-Change-Number: 54748
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: Namyoon Woo <namyoon(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Namyoon Woo <namyoon(a)google.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 25 May 2021 00:25:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
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: Nico Huber, Namyoon Woo, Edward O'Callaghan, Angel Pons.
Hello build bot (Jenkins), Nico Huber, Namyoon Woo, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54748
to look at the new patch set (#2).
Change subject: dummyflasher.c: Extract params processing into a separate function
......................................................................
dummyflasher.c: Extract params processing into a separate function
This makes init function easier to read.
A good side-effect of the change is: 13 error paths of params
processing are not leaking data anymore. All those error paths
return 1 back to init function which frees data.
And there was just one more error path in init function were free(data)
needed to be added.
BUG=b:185191942
TEST=ninja test
Change-Id: I04f55f77bb4703f1d88b2191c45a22be3c97bf87
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M dummyflasher.c
1 file changed, 41 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/54748/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/54748
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I04f55f77bb4703f1d88b2191c45a22be3c97bf87
Gerrit-Change-Number: 54748
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: Namyoon Woo <namyoon(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Namyoon Woo <namyoon(a)google.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54862 )
Change subject: serprog.c: Use braces in both branches of conditional statement
......................................................................
Patch Set 2:
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54862/comment/3b3ae941_c2e4f9ad
PS1, Line 9: According to the style guide.
> Make it a full sentence? […]
Done
File serprog.c:
https://review.coreboot.org/c/flashrom/+/54862/comment/fcb8532d_58e761fe
PS1, Line 876: } else {
> `else` isn't necessary here. I don't really care, though.
oh I see, if branch goes to error anyway. maybe I will return to this later?
--
To view, visit https://review.coreboot.org/c/flashrom/+/54862
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4fdccbd66f0351af98811bf7c2d8e15f0a99d852
Gerrit-Change-Number: 54862
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Comment-Date: Mon, 24 May 2021 23:41:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54862
to look at the new patch set (#2).
Change subject: serprog.c: Use braces in both branches of conditional statement
......................................................................
serprog.c: Use braces in both branches of conditional statement
As per the coding style, if one branch of a conditional statement
needs braces, all other branches need to have braces as well.
BUG=b:185191942
TEST=builds
Change-Id: I4fdccbd66f0351af98811bf7c2d8e15f0a99d852
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M serprog.c
1 file changed, 13 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/62/54862/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/54862
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4fdccbd66f0351af98811bf7c2d8e15f0a99d852
Gerrit-Change-Number: 54862
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset