ANDROID: mmc: Add vendor hooks for sdcard failure diagnostics

For sdcard failure diagnostics, add vendor hooks to monitor the sdcard
bus speed mode change and the sdcard reset failure in the request
recovery handling.

Bug: 303549480
Change-Id: Id40337ffb09a31199335cdb8a273d76618415649
Signed-off-by: Keita Aihara <keita.aihara@sony.com>
This commit is contained in:
Keita Aihara 2023-09-29 10:57:49 +09:00 committed by Todd Kjos
parent f8d3b450e9
commit 977770ec27
4 changed files with 18 additions and 0 deletions

View File

@ -351,3 +351,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_filemap_get_folio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_blk_mq_rw_recovery);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sd_update_bus_speed_mode);

View File

@ -49,6 +49,8 @@
#include <linux/uaccess.h>
#include <trace/hooks/mmc.h>
#include "queue.h"
#include "block.h"
#include "core.h"
@ -1870,6 +1872,7 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req)
err && mmc_blk_reset(md, card->host, type)) {
pr_err("%s: recovery failed!\n", req->q->disk->disk_name);
mqrq->retries = MMC_NO_RETRIES;
trace_android_vh_mmc_blk_mq_rw_recovery(card);
return;
}

View File

@ -21,6 +21,8 @@
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include <trace/hooks/mmc.h>
#include "core.h"
#include "card.h"
#include "host.h"
@ -481,6 +483,8 @@ static void sd_update_bus_speed_mode(struct mmc_card *card)
SD_MODE_UHS_SDR12)) {
card->sd_bus_speed = UHS_SDR12_BUS_SPEED;
}
trace_android_vh_sd_update_bus_speed_mode(card);
}
static int sd_set_bus_speed_mode(struct mmc_card *card, u8 *status)

View File

@ -7,11 +7,20 @@
#define _TRACE_HOOK_MMC_H
#include <trace/hooks/vendor_hooks.h>
struct mmc_host;
struct mmc_card;
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
DECLARE_HOOK(android_vh_mmc_blk_mq_rw_recovery,
TP_PROTO(struct mmc_card *card),
TP_ARGS(card));
DECLARE_HOOK(android_vh_sd_update_bus_speed_mode,
TP_PROTO(struct mmc_card *card),
TP_ARGS(card));
DECLARE_RESTRICTED_HOOK(android_rvh_mmc_suspend,
TP_PROTO(struct mmc_host *host),
TP_ARGS(host), 1);