Attention is currently required from: Brian Norris, Hsuan-ting Chen, Nikolai Artemiev.

Brian Norris uploaded patch set #2 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+2 by Hsuan-ting Chen, Code-Review+2 by Nikolai Artemiev, Verified+1 by build bot (Jenkins)

linux_mtd: Provide no-op delay implementation

Flashrom has several magic programmer_delay() calls scattered throughout
its codebase (see cli_classic.s/main() and
flashrom.c/flashrom_image_write(), at least). These delays are
superfluous for the linux_mtd programmer, because it's an opaque
programmer in which all protocol details are handled by the kernel
driver.

Stub out the delay function, so we don't waste up to 1.1 seconds of
needless delay time, depending on the operation and CLI vs libflashrom
usage.

BUG=b:325539928
TEST=`elogtool add 0xa7` on a linux_mtd system (such as a Mediatek
Chromebook):
Time improvement - reduces from ~1.5s wall clock to about 0.4s
CPU usage: -90%, as most of the CPU cycles (before this change) are
spent in needless magic-delay busy loops

Change-Id: I3ac69d3fd7cfc689c5b32c130d044516ed846c29
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
M linux_mtd.c
1 file changed, 9 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/71/80771/2

To view, visit change 80771. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I3ac69d3fd7cfc689c5b32c130d044516ed846c29
Gerrit-Change-Number: 80771
Gerrit-PatchSet: 2
Gerrit-Owner: Brian Norris <briannorris@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen@google.com>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Attention: Brian Norris <briannorris@chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen@google.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev@google.com>
Gerrit-MessageType: newpatchset