Attention is currently required from: Felix Singer, Thomas Heijligen, Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66659 )
Change subject: flashrom.c: Remove programmer_param global state
......................................................................
Patch Set 13:
(1 comment)
Patchset:
PS12:
> The last build of this patch from Jenkins did not run unit tests, if you could run them locally that […]
rebased on merged chain and recent unit-test coverage with improved commit message.
--
To view, visit https://review.coreboot.org/c/flashrom/+/66659
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I778609e370e44ad2b63b8baa4984ac03ff4124d8
Gerrit-Change-Number: 66659
Gerrit-PatchSet: 13
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 07 Sep 2022 11:43:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/67401 )
Change subject: flashrom.c: Deconflate bad cfg validation from param residue check
......................................................................
flashrom.c: Deconflate bad cfg validation from param residue check
In practice the programmer's init() entry point fails either
as a result of a bad configuration early or bad initalisation
late. While the param residue check is an othogonal issue and
therefore deconflate the two checks.
Change-Id: I0fba6bbbe4b685b210d1cba17e7b5815c5c01a45
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M flashrom.c
1 file changed, 27 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/01/67401/1
diff --git a/flashrom.c b/flashrom.c
index 6c38e62..e124e71 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -124,26 +124,6 @@
return rc;
}
-static int get_param_residue(const char *prog_params, int ret)
-{
- if (prog_params && strlen(prog_params)) {
- if (ret != 0) {
- /* It is quite possible that any unhandled programmer parameter would have been valid,
- * but an error in actual programmer init happened before the parameter was evaluated.
- */
- msg_pwarn("Unhandled programmer parameters (possibly due to another failure): %s\n", prog_params);
- } else {
- /* Actual programmer init was successful, but the user specified an invalid or unusable
- * (for the current programmer configuration) parameter.
- */
- msg_perr("Unhandled programmer parameters: %s\n", prog_params);
- msg_perr("Aborting.\n");
- ret = ERROR_FATAL;
- }
- }
- return ret;
-}
-
int programmer_init(const struct programmer_entry *prog, const char *param)
{
if (prog == NULL) {
@@ -169,7 +149,18 @@
msg_pdbg("Initializing %s programmer\n", prog->name);
const struct programmer_cfg cfg = { .params = strdup(param) };
int ret = prog->init(&cfg);
- ret = get_param_residue(cfg.params, ret);
+ if (ret != 0) {
+ msg_pwarn("Invalid programmer configuration or initalisation.\n");
+ goto bad_init;
+ }
+ if (cfg.params && strlen(cfg.params)) {
+ msg_perr("Unhandled programmer parameters: %s\n", cfg.params);
+ msg_perr("Aborting.\n");
+ ret = ERROR_FATAL;
+ goto bad_init;
+ }
+
+bad_init:
free(cfg.params);
return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/67401
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0fba6bbbe4b685b210d1cba17e7b5815c5c01a45
Gerrit-Change-Number: 67401
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Felix Singer, Thomas Heijligen, Edward O'Callaghan.
Hello Felix Singer, build bot (Jenkins), Thomas Heijligen, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/66659
to look at the new patch set (#13).
Change subject: flashrom.c: Remove programmer_param global state
......................................................................
flashrom.c: Remove programmer_param global state
By leveraging the programmer_cfg state machine passed
into programmer init() entry-points we may now directly
pass programmer parameterisation values and thus rid
ourseleves of the singleton pattern around programmer_param.
Change-Id: I778609e370e44ad2b63b8baa4984ac03ff4124d8
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M flashrom.c
1 file changed, 42 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/59/66659/13
--
To view, visit https://review.coreboot.org/c/flashrom/+/66659
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I778609e370e44ad2b63b8baa4984ac03ff4124d8
Gerrit-Change-Number: 66659
Gerrit-PatchSet: 13
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newpatchset
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/67072 )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: usb_device.c: release the usb interface on shutdown
......................................................................
usb_device.c: release the usb interface on shutdown
Following the libusb documentaion:
`You should release all claimed interfaces before closing a device
handle.`
https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html
libusb_release_interface()
Change-Id: If916574314cd86fad3429065a11707da0a809e0d
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67072
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec(a)chromium.org>
---
M usb_device.c
1 file changed, 24 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Edward O'Callaghan: Looks good to me, approved
diff --git a/usb_device.c b/usb_device.c
index b23b204..b3c966c 100644
--- a/usb_device.c
+++ b/usb_device.c
@@ -381,8 +381,11 @@
{
struct usb_device *next = device->next;
- if (device->handle != NULL)
+ if (device->handle != NULL) {
+ libusb_release_interface(device->handle,
+ device->interface_descriptor->bInterfaceNumber);
libusb_close(device->handle);
+ }
/*
* This unref balances the ref added in the add_device function.
--
To view, visit https://review.coreboot.org/c/flashrom/+/67072
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If916574314cd86fad3429065a11707da0a809e0d
Gerrit-Change-Number: 67072
Gerrit-PatchSet: 5
Gerrit-Owner: Thomas Heijligen <src(a)posteo.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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/67071 )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: ch341a_spi: detach/attach kernel driver explicitly
......................................................................
ch341a_spi: detach/attach kernel driver explicitly
Use `libusb_detach_kernel_driver` and `libusb_attach_kernel_driver`
instead of `libusb_auto_detach_kernel_driver` to be compatible with
older libusb versions without changing the behavior.
TEST=Build with libusb >= 1.0.9
Read spi flash with ch341a programmer on linux
Change-Id: Ia649722e64cc97c6b689dd3b764e5c9145959f92
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67071
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec(a)chromium.org>
---
M ch341a_spi.c
1 file changed, 26 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Edward O'Callaghan: Looks good to me, approved
diff --git a/ch341a_spi.c b/ch341a_spi.c
index 78b9cee..48c6420 100644
--- a/ch341a_spi.c
+++ b/ch341a_spi.c
@@ -398,6 +398,7 @@
transfer_ins[i] = NULL;
}
libusb_release_interface(handle, 0);
+ libusb_attach_kernel_driver(handle, 0);
libusb_close(handle);
libusb_exit(NULL);
handle = NULL;
@@ -448,11 +449,10 @@
return -1;
}
- ret = libusb_set_auto_detach_kernel_driver(handle, 1);
- if (ret != 0) {
- msg_pwarn("Platform does not support detaching of USB kernel drivers.\n"
- "If an unsupported driver is active, claiming the interface may fail.\n");
- }
+ ret = libusb_detach_kernel_driver(handle, 0);
+ if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND)
+ msg_pwarn("Cannot detach the existing USB driver. Claiming the interface may fail. %s\n",
+ libusb_error_name(ret));
ret = libusb_claim_interface(handle, 0);
if (ret != 0) {
@@ -514,6 +514,7 @@
release_interface:
libusb_release_interface(handle, 0);
close_handle:
+ libusb_attach_kernel_driver(handle, 0);
libusb_close(handle);
handle = NULL;
return -1;
--
To view, visit https://review.coreboot.org/c/flashrom/+/67071
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia649722e64cc97c6b689dd3b764e5c9145959f92
Gerrit-Change-Number: 67071
Gerrit-PatchSet: 5
Gerrit-Owner: Thomas Heijligen <src(a)posteo.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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Felix Singer, Edward O'Callaghan, Anastasia Klimchuk.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66862 )
Change subject: Documentation: Add build instructions for meson
......................................................................
Patch Set 6:
(2 comments)
File Documentation/building.md:
https://review.coreboot.org/c/flashrom/+/66862/comment/78df0bbe_39c7dbb7
PS5, Line 31: meson build -D<your_options>
> I was confused at first, because meson has `configure` command, which is not the same as build, and […]
I've changed `build` to `builddir`. And added a comment to clarify it.
https://review.coreboot.org/c/flashrom/+/66862/comment/565aa368_6e807df0
PS5, Line 47: tests
> Should this be `test` (not `tests`) ? I always run `ninja test` command.
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/66862
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3476f17fa274cd71e3e0e84f791d547d08165ecb
Gerrit-Change-Number: 66862
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
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-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 07 Sep 2022 11:26:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Edward O'Callaghan.
Hello build bot (Jenkins), Edward O'Callaghan, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/66862
to look at the new patch set (#6).
Change subject: Documentation: Add build instructions for meson
......................................................................
Documentation: Add build instructions for meson
Change-Id: I3476f17fa274cd71e3e0e84f791d547d08165ecb
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
A Documentation/building.md
1 file changed, 137 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/62/66862/6
--
To view, visit https://review.coreboot.org/c/flashrom/+/66862
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3476f17fa274cd71e3e0e84f791d547d08165ecb
Gerrit-Change-Number: 66862
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
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-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Felix Singer.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66879 )
Change subject: 82802ab.c: Retype appropriate variables with bool
......................................................................
Patch Set 11:
(1 comment)
File 82802ab.c:
https://review.coreboot.org/c/flashrom/+/66879/comment/77c830e0_9788bfa2
PS11, Line 25: #include <stdbool.h>
> Anything to do here? Or can this comment be marked as resolved?
Would be good to discuss it. IMHO, I'd like to avoid including basic type headers (stdbool, stdint, stddef...) in every file, but include one header like coreboot's types.h
Marking as resolved as this should be addressed in a follow-up.
--
To view, visit https://review.coreboot.org/c/flashrom/+/66879
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5dfd9ed4856c37dd70706b2dd71fbb9a8acbdf4c
Gerrit-Change-Number: 66879
Gerrit-PatchSet: 11
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Comment-Date: Wed, 07 Sep 2022 11:12:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felix Singer <felixsinger(a)posteo.net>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment