162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#include <linux/mtd/mtd.h> 362306a36Sopenharmony_ci#include <linux/sched/signal.h> 462306a36Sopenharmony_ci 562306a36Sopenharmony_cistatic inline int mtdtest_relax(void) 662306a36Sopenharmony_ci{ 762306a36Sopenharmony_ci cond_resched(); 862306a36Sopenharmony_ci if (signal_pending(current)) { 962306a36Sopenharmony_ci pr_info("aborting test due to pending signal!\n"); 1062306a36Sopenharmony_ci return -EINTR; 1162306a36Sopenharmony_ci } 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci return 0; 1462306a36Sopenharmony_ci} 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciint mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum); 1762306a36Sopenharmony_ciint mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, 1862306a36Sopenharmony_ci unsigned int eb, int ebcnt); 1962306a36Sopenharmony_ciint mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, 2062306a36Sopenharmony_ci unsigned int eb, int ebcnt); 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciint mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf); 2362306a36Sopenharmony_ciint mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size, 2462306a36Sopenharmony_ci const void *buf); 25