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/+/54042 )
Change subject: stlinkv3_spi.c: Refactor singleton states into reentrant pattern
......................................................................
Patch Set 2:
(4 comments)
File stlinkv3_spi.c:
https://review.coreboot.org/c/flashrom/+/54042/comment/c6ac430c_2d3abdac
PS1, Line 451: const
> I've tried to fix this for good in CB:54066.
Yes that was a good idea! Pars and opaques left to be submitted, and all tree will be covered.
https://review.coreboot.org/c/flashrom/+/54042/comment/c712ffcc_af484b1c
PS1, Line 351: struct stlinkv3_spi_data *stlinkv3_data = flash->mst->spi.data;
> Adding a pointer for the handle would reduce some boilerplate below […]
Yes, true, and this is the second time you give me this advice, thank you for patience. I need to remember to use this approach for future.
https://review.coreboot.org/c/flashrom/+/54042/comment/8e36c769_90a1f15f
PS1, Line 528: return -1;
> yeah, it's easy to fix
I didn't switch the order, but error paths should look better now after CB:54190.
https://review.coreboot.org/c/flashrom/+/54042/comment/fb65e8dc_2e8bc800
PS1, Line 533: stlinkv3_spi_open(sck_freq_kHz, stlinkv3_handle
> I did an attempt to fix error paths cleanup in CB:54190 […]
I rebased on the top of CB:54190, ready for review, should look better than before. Thanks for helping me!
--
To view, visit https://review.coreboot.org/c/flashrom/+/54042
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id044661b864b506028720ea809bc524f0640469f
Gerrit-Change-Number: 54042
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
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: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Wed, 19 May 2021 04:55:34 +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: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Miklós Márton, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54043
to look at the new patch set (#2).
Change subject: stlinkv3_spi.c: Drop stlinkv3_ prefix for spi data struct member
......................................................................
stlinkv3_spi.c: Drop stlinkv3_ prefix for spi data struct member
The name of the struct already contains stlinkv3_ prefix, so prefix
doesn't need to be repeated in members name.
BUG=b:185191942
TEST=builds
Change-Id: Ibddac9371ab8f08276d499642a9bdd6dbecea0ca
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M stlinkv3_spi.c
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/43/54043/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/54043
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibddac9371ab8f08276d499642a9bdd6dbecea0ca
Gerrit-Change-Number: 54043
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
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
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Hello build bot (Jenkins), Nico Huber, Miklós Márton, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/54042
to look at the new patch set (#2).
Change subject: stlinkv3_spi.c: Refactor singleton states into reentrant pattern
......................................................................
stlinkv3_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".
BUG=b:185191942
TEST=builds
Change-Id: Id044661b864b506028720ea809bc524f0640469f
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M stlinkv3_spi.c
1 file changed, 66 insertions(+), 29 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/42/54042/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/54042
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id044661b864b506028720ea809bc524f0640469f
Gerrit-Change-Number: 54042
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
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: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Sam McNally has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54356 )
Change subject: dummyflasher.c: Use BUS_NONSPI where appropriate
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/54356
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I368e8865c446d9b9ffd580c90eac034850dd53d8
Gerrit-Change-Number: 54356
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 19 May 2021 03:54:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/54190 )
Change subject: stlinkv3_spi.c: Clean up properly on all init error paths
......................................................................
stlinkv3_spi.c: Clean up properly on all init error paths
If register_spi_master() fails, going to init exit cleanup is not
needed because at that point shutdown function has already been
registered and it does the job.
BUG=b:185191942
TEST=builds
Change-Id: I9fabf48068635593bc86006c9642d8569eee8447
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/54190
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec(a)chromium.org>
Reviewed-by: Miklós Márton <martonmiklosqdev(a)gmail.com>
---
M stlinkv3_spi.c
1 file changed, 15 insertions(+), 7 deletions(-)
Approvals:
build bot (Jenkins): Verified
Miklós Márton: Looks good to me, but someone else must approve
Edward O'Callaghan: Looks good to me, approved
diff --git a/stlinkv3_spi.c b/stlinkv3_spi.c
index 7712ec2..100a94b 100644
--- a/stlinkv3_spi.c
+++ b/stlinkv3_spi.c
@@ -464,6 +464,7 @@
char *speed_str = NULL;
char *serialno = NULL;
char *endptr = NULL;
+ int ret = 1;
libusb_init(&usb_ctx);
if (!usb_ctx) {
@@ -485,7 +486,7 @@
else
msg_perr("Could not find any connected STLINK-V3\n");
free(serialno);
- goto err_exit;
+ goto init_err_exit;
}
free(serialno);
@@ -498,23 +499,30 @@
msg_perr("Please pass the parameter "
"with a simple non-zero number in kHz\n");
free(speed_str);
- return -1;
+ ret = -1;
+ goto init_err_exit;
}
free(speed_str);
}
if (stlinkv3_spi_open(sck_freq_kHz))
- goto err_exit;
+ goto init_err_exit;
if (register_shutdown(stlinkv3_spi_shutdown, NULL))
- goto err_exit;
+ goto init_err_cleanup_exit;
if (register_spi_master(&spi_programmer_stlinkv3, NULL))
- goto err_exit;
+ return 1; /* shutdown function does cleanup */
return 0;
-err_exit:
- libusb_exit(usb_ctx);
+init_err_cleanup_exit:
+ stlinkv3_spi_shutdown(NULL);
return 1;
+
+init_err_exit:
+ if (stlinkv3_handle)
+ libusb_close(stlinkv3_handle);
+ libusb_exit(usb_ctx);
+ return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/54190
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9fabf48068635593bc86006c9642d8569eee8447
Gerrit-Change-Number: 54190
Gerrit-PatchSet: 4
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/54368 )
Change subject: meson.build: Fix cmocka to be optional at configure-time
......................................................................
meson.build: Fix cmocka to be optional at configure-time
While building with meson, however without libcmocka
available, attempts are made to fetch a copy to build via
the wrap mechanism. However in hermetic build enviroments
this causes hard failure as the dependency declaration of
cmocka is not optional. Fix this to ensure flashrom can build
hermetically in images without libcmocka available.
BUG=none
BRANCH=none
TEST=`
$ mkdir build && cd build/
$ meson --wrap-mode=nodownload --wrap-mode=nofallback ../
$ ninja test # validate configs, builds and no tests are run.
--
$ sudo apt install libcmocka-dev
$ mkdir build && cd build/
$ meson --wrap-mode=nodownload --wrap-mode=nofallback ../
$ ninja test # validate configs, builds and tests are run.
`
Change-Id: Ib59f4dacc14be9b02334ca59b348c19e22963367
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/54368
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M meson.build
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Angel Pons: Looks good to me, approved
Anastasia Klimchuk: Looks good to me, but someone else must approve
diff --git a/meson.build b/meson.build
index 368820c..81d63a9 100644
--- a/meson.build
+++ b/meson.build
@@ -462,7 +462,8 @@
# unit-test framework
cmocka_dep = dependency(
'cmocka',
- fallback: ['cmocka', 'cmocka_dep']
+ fallback: ['cmocka', 'cmocka_dep'],
+ required: false
)
flashrom_test_dep = declare_dependency(
include_directories : include_directories('.'),
@@ -481,4 +482,6 @@
],
)
-subdir('tests')
+if cmocka_dep.found()
+ subdir('tests')
+endif
--
To view, visit https://review.coreboot.org/c/flashrom/+/54368
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib59f4dacc14be9b02334ca59b348c19e22963367
Gerrit-Change-Number: 54368
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
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: Sam McNally <sammc(a)google.com>
Gerrit-MessageType: merged
Attention is currently required from: Sam McNally, Nico Huber, Angel Pons, Arthur Heymans.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54429 )
Change subject: Fix up handling of IFD chipsets
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> Anastasia, Could be a place to target for a unit-test?
yes agree!
--
To view, visit https://review.coreboot.org/c/flashrom/+/54429
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4f4b31ecf91c432a2e82a92e274cb91ac166e635
Gerrit-Change-Number: 54429
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Comment-Date: Tue, 18 May 2021 03:58:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment