* [PATCH mtd-utils 0/2] mtd-tests: flash_speed: minor fixes
@ 2025-07-23 11:28 Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 1/2] mtd-tests: flash_speed: really skip destructive tests Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 2/2] mtd-tests: flash_speed: fix error message in read_eraseblock() Gabor Juhos
0 siblings, 2 replies; 3+ messages in thread
From: Gabor Juhos @ 2025-07-23 11:28 UTC (permalink / raw)
To: linux-mtd; +Cc: Gabor Juhos
The series contains two small patches for the flash_speed test.
The first one prevents running destructive tests if those are
not enabled. The second one fixes a presumable copy&paste issue
in an error message.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
Gabor Juhos (2):
mtd-tests: flash_speed: really skip destructive tests
mtd-tests: flash_speed: fix error message in read_eraseblock()
tests/mtd-tests/flash_speed.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 77981a2888c711268b0e7f32af6af159c2288e23
change-id: 20250722-flash_speed-fixes-a1e93dda7781
Best regards,
--
Gabor Juhos <j4g8y7@gmail.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH mtd-utils 1/2] mtd-tests: flash_speed: really skip destructive tests
2025-07-23 11:28 [PATCH mtd-utils 0/2] mtd-tests: flash_speed: minor fixes Gabor Juhos
@ 2025-07-23 11:28 ` Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 2/2] mtd-tests: flash_speed: fix error message in read_eraseblock() Gabor Juhos
1 sibling, 0 replies; 3+ messages in thread
From: Gabor Juhos @ 2025-07-23 11:28 UTC (permalink / raw)
To: linux-mtd; +Cc: Gabor Juhos
Although both the 'multi-block erase' and the 'read-while-write latency'
tests are destructive, but those are executed irregardless of whether
destructive mode is enabled or not.
Change the code to skip these tests if the DESTRUCTIVE flag is not set
to avoid unexpected behaviour.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
tests/mtd-tests/flash_speed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c
index 11f396c597153632432bdbe6f22369b1a4bb8579..ee162891d5c9288ffb9d09eb2c649db027eedcba 100644
--- a/tests/mtd-tests/flash_speed.c
+++ b/tests/mtd-tests/flash_speed.c
@@ -490,7 +490,7 @@ int main(int argc, char **argv)
}
/* Multi-block erase all eraseblocks */
- if (!skip) {
+ if (flags & DESTRUCTIVE && !skip) {
for (k = 1; k < 7; ++k) {
blocks = 1 << k;
printf("Testing %dx multi-block erase speed\n", blocks);
@@ -518,7 +518,7 @@ int main(int argc, char **argv)
/* Write a page and immediately after try to read another page. Report
* the latency difference when performed on different banks (NOR only).
*/
- if (speb >= 0 && mtd.subpage_size == 1) {
+ if (flags & DESTRUCTIVE && speb >= 0 && mtd.subpage_size == 1) {
long rww_duration_w, rww_latency_end;
long rww_duration_rnw, rww_duration_r_end;
bool rww_r_end_first;
--
2.50.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH mtd-utils 2/2] mtd-tests: flash_speed: fix error message in read_eraseblock()
2025-07-23 11:28 [PATCH mtd-utils 0/2] mtd-tests: flash_speed: minor fixes Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 1/2] mtd-tests: flash_speed: really skip destructive tests Gabor Juhos
@ 2025-07-23 11:28 ` Gabor Juhos
1 sibling, 0 replies; 3+ messages in thread
From: Gabor Juhos @ 2025-07-23 11:28 UTC (permalink / raw)
To: linux-mtd; +Cc: Gabor Juhos
Replace 'write' with 'read' in the error message of the read_eraseblock()
function to indicate the correct direction of the operation.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
tests/mtd-tests/flash_speed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c
index ee162891d5c9288ffb9d09eb2c649db027eedcba..3319452194a54124a7f691994b41043fe0413229 100644
--- a/tests/mtd-tests/flash_speed.c
+++ b/tests/mtd-tests/flash_speed.c
@@ -190,7 +190,7 @@ static int read_eraseblock(int ebnum)
{
int err = mtd_read(&mtd, fd, ebnum, 0, iobuf, mtd.eb_size);
if (err)
- fprintf(stderr, "Error writing block %d!\n", ebnum);
+ fprintf(stderr, "Error reading block %d!\n", ebnum);
return err;
}
--
2.50.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-23 11:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 11:28 [PATCH mtd-utils 0/2] mtd-tests: flash_speed: minor fixes Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 1/2] mtd-tests: flash_speed: really skip destructive tests Gabor Juhos
2025-07-23 11:28 ` [PATCH mtd-utils 2/2] mtd-tests: flash_speed: fix error message in read_eraseblock() Gabor Juhos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).