mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-06 00:13:38 -04:00
mmc: core: add random fault injection
This adds support to inject data errors after a completed host transfer. The mmc core will return error even though the host transfer is successful. This simple fault injection proved to be very useful to test the non-blocking error handling in the mmc_blk_issue_rw_rq(). Random faults can also test how the host driver handles pre_req() and post_req() in case of errors. Signed-off-by: Per Forlin <per.forlin@linaro.org> Acked-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
parent
df87ecbf19
commit
1b676f70c1
4 changed files with 82 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <linux/leds.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/fault-inject.h>
|
||||
|
||||
#include <linux/mmc/core.h>
|
||||
#include <linux/mmc/pm.h>
|
||||
|
@ -302,6 +303,10 @@ struct mmc_host {
|
|||
|
||||
struct mmc_async_req *areq; /* active async req */
|
||||
|
||||
#ifdef CONFIG_FAIL_MMC_REQUEST
|
||||
struct fault_attr fail_mmc_request;
|
||||
#endif
|
||||
|
||||
unsigned long private[0] ____cacheline_aligned;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue