Loading drivers/mmc/host/sdhci.c +14 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <linux/mmc/slot-gpio.h> #include <linux/mmc/sdio.h> #include <trace/events/mmc.h> #include "sdhci.h" #define DRIVER_NAME "sdhci" Loading Loading @@ -700,6 +702,9 @@ static void sdhci_adma_table_post(struct sdhci_host *host, void *align; char *buffer; unsigned long flags; u32 command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); trace_mmc_adma_table_post(command, data->sg_len); if (data->flags & MMC_DATA_READ) { bool has_unaligned = false; Loading Loading @@ -930,6 +935,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; } else if (host->flags & SDHCI_USE_ADMA) { trace_mmc_adma_table_pre(cmd->opcode, data->sg_len); sdhci_adma_table_pre(host, data, sg_cnt); sdhci_writel(host, host->adma_addr, SDHCI_ADMA_ADDRESS); Loading Loading @@ -1257,6 +1263,7 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if (cmd->data) host->data_start_time = ktime_get(); trace_mmc_cmd_rw_start(cmd->opcode, cmd->arg, cmd->flags); sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); } EXPORT_SYMBOL_GPL(sdhci_send_command); Loading Loading @@ -2769,6 +2776,9 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) return; } trace_mmc_cmd_rw_end(host->cmd->opcode, intmask, sdhci_readl(host, SDHCI_RESPONSE)); if (intmask & (SDHCI_INT_TIMEOUT | SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX | SDHCI_INT_AUTO_CMD_ERR)) { Loading Loading @@ -2854,9 +2864,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) u32 command; bool pr_msg = false; command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); trace_mmc_data_rw_end(command, intmask); /* CMD19 generates _only_ Buffer Read Ready interrupt */ if (intmask & SDHCI_INT_DATA_AVAIL) { command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) { host->tuning_done = 1; Loading Loading @@ -2918,8 +2930,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) else if (intmask & SDHCI_INT_DATA_END_BIT) host->data->error = -EILSEQ; else if ((intmask & SDHCI_INT_DATA_CRC) && SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) != MMC_BUS_TEST_R) (command != MMC_BUS_TEST_R)) host->data->error = -EILSEQ; else if (intmask & SDHCI_INT_ADMA_ERROR) { pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); Loading include/trace/events/mmc.h +71 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,77 @@ TRACE_EVENT(mmc_request_done, __entry->hold_retune, __entry->retune_period) ); TRACE_EVENT(mmc_cmd_rw_start, TP_PROTO(unsigned int cmd, unsigned int arg, unsigned int flags), TP_ARGS(cmd, arg, flags), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, arg) __field(unsigned int, flags) ), TP_fast_assign( __entry->cmd = cmd; __entry->arg = arg; __entry->flags = flags; ), TP_printk("cmd=%u,arg=0x%08x,flags=0x%08x", __entry->cmd, __entry->arg, __entry->flags) ); TRACE_EVENT(mmc_cmd_rw_end, TP_PROTO(unsigned int cmd, unsigned int status, unsigned int resp), TP_ARGS(cmd, status, resp), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, status) __field(unsigned int, resp) ), TP_fast_assign( __entry->cmd = cmd; __entry->status = status; __entry->resp = resp; ), TP_printk("cmd=%u,int_status=0x%08x,response=0x%08x", __entry->cmd, __entry->status, __entry->resp) ); TRACE_EVENT(mmc_data_rw_end, TP_PROTO(unsigned int cmd, unsigned int status), TP_ARGS(cmd, status), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, status) ), TP_fast_assign( __entry->cmd = cmd; __entry->status = status; ), TP_printk("cmd=%u,int_status=0x%08x", __entry->cmd, __entry->status) ); DECLARE_EVENT_CLASS(mmc_adma_class, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, len) ), TP_fast_assign( __entry->cmd = cmd; __entry->len = len; ), TP_printk("cmd=%u,sg_len=0x%08x", __entry->cmd, __entry->len) ); DEFINE_EVENT(mmc_adma_class, mmc_adma_table_pre, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len)); DEFINE_EVENT(mmc_adma_class, mmc_adma_table_post, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len)); #endif /* _TRACE_MMC_H */ /* This part must be outside protection */ Loading Loading
drivers/mmc/host/sdhci.c +14 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <linux/mmc/slot-gpio.h> #include <linux/mmc/sdio.h> #include <trace/events/mmc.h> #include "sdhci.h" #define DRIVER_NAME "sdhci" Loading Loading @@ -700,6 +702,9 @@ static void sdhci_adma_table_post(struct sdhci_host *host, void *align; char *buffer; unsigned long flags; u32 command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); trace_mmc_adma_table_post(command, data->sg_len); if (data->flags & MMC_DATA_READ) { bool has_unaligned = false; Loading Loading @@ -930,6 +935,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; } else if (host->flags & SDHCI_USE_ADMA) { trace_mmc_adma_table_pre(cmd->opcode, data->sg_len); sdhci_adma_table_pre(host, data, sg_cnt); sdhci_writel(host, host->adma_addr, SDHCI_ADMA_ADDRESS); Loading Loading @@ -1257,6 +1263,7 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if (cmd->data) host->data_start_time = ktime_get(); trace_mmc_cmd_rw_start(cmd->opcode, cmd->arg, cmd->flags); sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); } EXPORT_SYMBOL_GPL(sdhci_send_command); Loading Loading @@ -2769,6 +2776,9 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) return; } trace_mmc_cmd_rw_end(host->cmd->opcode, intmask, sdhci_readl(host, SDHCI_RESPONSE)); if (intmask & (SDHCI_INT_TIMEOUT | SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX | SDHCI_INT_AUTO_CMD_ERR)) { Loading Loading @@ -2854,9 +2864,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) u32 command; bool pr_msg = false; command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); trace_mmc_data_rw_end(command, intmask); /* CMD19 generates _only_ Buffer Read Ready interrupt */ if (intmask & SDHCI_INT_DATA_AVAIL) { command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) { host->tuning_done = 1; Loading Loading @@ -2918,8 +2930,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) else if (intmask & SDHCI_INT_DATA_END_BIT) host->data->error = -EILSEQ; else if ((intmask & SDHCI_INT_DATA_CRC) && SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)) != MMC_BUS_TEST_R) (command != MMC_BUS_TEST_R)) host->data->error = -EILSEQ; else if (intmask & SDHCI_INT_ADMA_ERROR) { pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); Loading
include/trace/events/mmc.h +71 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,77 @@ TRACE_EVENT(mmc_request_done, __entry->hold_retune, __entry->retune_period) ); TRACE_EVENT(mmc_cmd_rw_start, TP_PROTO(unsigned int cmd, unsigned int arg, unsigned int flags), TP_ARGS(cmd, arg, flags), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, arg) __field(unsigned int, flags) ), TP_fast_assign( __entry->cmd = cmd; __entry->arg = arg; __entry->flags = flags; ), TP_printk("cmd=%u,arg=0x%08x,flags=0x%08x", __entry->cmd, __entry->arg, __entry->flags) ); TRACE_EVENT(mmc_cmd_rw_end, TP_PROTO(unsigned int cmd, unsigned int status, unsigned int resp), TP_ARGS(cmd, status, resp), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, status) __field(unsigned int, resp) ), TP_fast_assign( __entry->cmd = cmd; __entry->status = status; __entry->resp = resp; ), TP_printk("cmd=%u,int_status=0x%08x,response=0x%08x", __entry->cmd, __entry->status, __entry->resp) ); TRACE_EVENT(mmc_data_rw_end, TP_PROTO(unsigned int cmd, unsigned int status), TP_ARGS(cmd, status), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, status) ), TP_fast_assign( __entry->cmd = cmd; __entry->status = status; ), TP_printk("cmd=%u,int_status=0x%08x", __entry->cmd, __entry->status) ); DECLARE_EVENT_CLASS(mmc_adma_class, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len), TP_STRUCT__entry( __field(unsigned int, cmd) __field(unsigned int, len) ), TP_fast_assign( __entry->cmd = cmd; __entry->len = len; ), TP_printk("cmd=%u,sg_len=0x%08x", __entry->cmd, __entry->len) ); DEFINE_EVENT(mmc_adma_class, mmc_adma_table_pre, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len)); DEFINE_EVENT(mmc_adma_class, mmc_adma_table_post, TP_PROTO(unsigned int cmd, unsigned int len), TP_ARGS(cmd, len)); #endif /* _TRACE_MMC_H */ /* This part must be outside protection */ Loading