Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) 2006-2008 Nokia Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Test random reads, writes and erases on MTD device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Author: Adrian Hunter <ext-adrian.hunter@nokia.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/moduleparam.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/err.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/mtd/mtd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/vmalloc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/random.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include "mtd_test.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) static int dev = -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) module_param(dev, int, S_IRUGO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) MODULE_PARM_DESC(dev, "MTD device number to use");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) static int count = 10000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) module_param(count, int, S_IRUGO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) MODULE_PARM_DESC(count, "Number of operations to do (default is 10000)");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static struct mtd_info *mtd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static unsigned char *writebuf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static unsigned char *readbuf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static unsigned char *bbt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static int *offsets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) static int pgsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static int bufsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static int ebcnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static int pgcnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) static int rand_eb(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	unsigned int eb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) again:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	eb = prandom_u32();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	/* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	eb %= (ebcnt - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (bbt[eb])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		goto again;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	return eb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) static int rand_offs(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	unsigned int offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	offs = prandom_u32();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	offs %= bufsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	return offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) static int rand_len(int offs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	unsigned int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	len = prandom_u32();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	len %= (bufsize - offs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	return len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static int do_read(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	int eb = rand_eb();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	int offs = rand_offs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	int len = rand_len(offs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	loff_t addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	if (bbt[eb + 1]) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		if (offs >= mtd->erasesize)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			offs -= mtd->erasesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		if (offs + len > mtd->erasesize)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			len = mtd->erasesize - offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	addr = (loff_t)eb * mtd->erasesize + offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	return mtdtest_read(mtd, addr, len, readbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) static int do_write(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	int eb = rand_eb(), offs, err, len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	loff_t addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	offs = offsets[eb];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	if (offs >= mtd->erasesize) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		err = mtdtest_erase_eraseblock(mtd, eb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		offs = offsets[eb] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	len = rand_len(offs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	len = ((len + pgsize - 1) / pgsize) * pgsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	if (offs + len > mtd->erasesize) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		if (bbt[eb + 1])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 			len = mtd->erasesize - offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			err = mtdtest_erase_eraseblock(mtd, eb + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 			if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 				return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 			offsets[eb + 1] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	addr = (loff_t)eb * mtd->erasesize + offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	err = mtdtest_write(mtd, addr, len, writebuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	if (unlikely(err))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	offs += len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	while (offs > mtd->erasesize) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		offsets[eb++] = mtd->erasesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		offs -= mtd->erasesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	offsets[eb] = offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) static int do_operation(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	if (prandom_u32() & 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		return do_read();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		return do_write();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static int __init mtd_stresstest_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	int i, op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	uint64_t tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	printk(KERN_INFO "\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	printk(KERN_INFO "=================================================\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	if (dev < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		pr_info("Please specify a valid mtd-device via module parameter\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		pr_crit("CAREFUL: This test wipes all data on the specified MTD device!\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	pr_info("MTD device: %d\n", dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	mtd = get_mtd_device(NULL, dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	if (IS_ERR(mtd)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		err = PTR_ERR(mtd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		pr_err("error: cannot get MTD device\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	if (mtd->writesize == 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		pr_info("not NAND flash, assume page size is 512 "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		       "bytes.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		pgsize = 512;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	} else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		pgsize = mtd->writesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	tmp = mtd->size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	do_div(tmp, mtd->erasesize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	ebcnt = tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	pgcnt = mtd->erasesize / pgsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	pr_info("MTD device size %llu, eraseblock size %u, "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	       "page size %u, count of eraseblocks %u, pages per "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	       "eraseblock %u, OOB size %u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	       (unsigned long long)mtd->size, mtd->erasesize,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	       pgsize, ebcnt, pgcnt, mtd->oobsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	if (ebcnt < 2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		pr_err("error: need at least 2 eraseblocks\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		err = -ENOSPC;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		goto out_put_mtd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	/* Read or write up 2 eraseblocks at a time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	bufsize = mtd->erasesize * 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	err = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	readbuf = vmalloc(bufsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	writebuf = vmalloc(bufsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	offsets = kmalloc_array(ebcnt, sizeof(int), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	if (!readbuf || !writebuf || !offsets)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	for (i = 0; i < ebcnt; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		offsets[i] = mtd->erasesize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	prandom_bytes(writebuf, bufsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	bbt = kzalloc(ebcnt, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	if (!bbt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	/* Do operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	pr_info("doing operations\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	for (op = 0; op < count; op++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		if ((op & 1023) == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 			pr_info("%d operations done\n", op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		err = do_operation();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 		if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 			goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		err = mtdtest_relax();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	pr_info("finished, %d operations done\n", op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	kfree(offsets);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	kfree(bbt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	vfree(writebuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	vfree(readbuf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) out_put_mtd:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	put_mtd_device(mtd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		pr_info("error %d occurred\n", err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	printk(KERN_INFO "=================================================\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) module_init(mtd_stresstest_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) static void __exit mtd_stresstest_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) module_exit(mtd_stresstest_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) MODULE_DESCRIPTION("Stress test module");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) MODULE_AUTHOR("Adrian Hunter");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) MODULE_LICENSE("GPL");