diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2019-02-14 19:06:47 +0100 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-02-20 18:51:19 +0100 |
commit | a69e101ed1169f562fc030a783cd997d3f066b16 (patch) | |
tree | 1d7fb563eec0f10473c72abccc608de7274ff9ff /target | |
parent | 0b373bf4d6a1a7a53e06946972ebb812b4cc2f0f (diff) | |
download | upstream-a69e101ed1169f562fc030a783cd997d3f066b16.tar.gz upstream-a69e101ed1169f562fc030a783cd997d3f066b16.tar.bz2 upstream-a69e101ed1169f562fc030a783cd997d3f066b16.zip |
ipq40xx: speed up ath10k-caldata extraction
Reading and writing to and from flash storage is slow and currently,
the ath10kcal_extract() scripts are even more at an disadvantage
because they use a block size of 1 to be able skip.
This patch reworks the extraction scripts to be much faster and
efficient by reading and writing the calibration data in possibly
one big block.
before: (Tested on a RT-AC58U, which has SPI-NAND).
# time dd if=/dev/ubi0_1 of=/lib/firmware/... bs=1 skip=4096 count=12064
12064+0 records in
12064+0 records out
real 0m 0.28s
user 0m 0.02s
sys 0m 0.24s
after:
# time dd if=/dev/ubi0_1 of=/lib/firmware/... bs=12064 skip=4096 count=1 iflag=skip_bytes
1+0 records in
1+0 records out
real 0m 0.01s
user 0m 0.00s
sys 0m 0.00s
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 59a809e792..21d9063fd4 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -31,7 +31,7 @@ ath10kcal_extract() { [ -n "$mtd" ] || \ ath10kcal_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ ath10kcal_die "failed to extract calibration data from $mtd" } @@ -49,7 +49,7 @@ ath10kcal_ubi_extract() { [ -n "$ubi" ] || \ ath10kcal_die "no UBI volume found for $part" - dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ ath10kcal_die "failed to extract from $ubi" } |