mmc: Reduce tuning log output
cover mmc: Reduce tuning log output
From: Wenchao Chen <[email protected]>
During the HS200 Tuning process, a lot of "mmc0: Got data interrupt 0x00200000 even though no data operation was in progress." logs were printed. From the cmd in the log, it is CMD21.
[ 4.547365][ C0] mmc0: Got data interrupt 0x00200000 even though no data operation was in progress. [ 4.564088][ C0] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== [ 4.571213][ C0] mmc0: sdhci: Sys addr: 0x00000001 | Version: 0x00000004 [ 4.578339][ C0] mmc0: sdhci: Blk size: 0x00000080 | Blk cnt: 0x00000000 [ 4.585466][ C0] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 [ 4.592595][ C0] mmc0: sdhci: Present: 0x01f000f0 | Host ctl: 0x00000030 [ 4.599723][ C0] mmc0: sdhci: Power: 0x00000000 | Blk gap: 0x00000000 [ 4.606849][ C0] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007 [ 4.613978][ C0] mmc0: sdhci: Timeout: 0x0000000c | Int stat: 0x00000000 [ 4.621106][ C0] mmc0: sdhci: Int enab: 0x037f000b | Sig enab: 0x037f000b [ 4.628233][ C0] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 4.635360][ C0] mmc0: sdhci: Caps: 0x1e6d0080 | Caps_1: 0x08000007 [ 4.642489][ C0] mmc0: sdhci: Cmd: 0x0000153a | Max curr: 0x000003fc [ 4.649616][ C0] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000900 [ 4.656743][ C0] mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 4.663881][ C0] mmc0: sdhci: Host ctl2: 0x00003005 [ 4.669002][ C0] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000f0200200 [ 4.811901][ C0] mmc0: sdhci: ============================================
.......
[ 4.819456][ C0] mmc0: Got data interrupt 0x00200000 even though no data operation was in progress. [ 4.835111][ C0] mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== [ 4.835116][ C0] mmc0: sdhci: Sys addr: 0x00000001 | Version: 0x00000004 [ 4.870574][ C0] mmc0: sdhci: Blk size: 0x00000080 | Blk cnt: 0x00000000 [ 4.870580][ C0] mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 [ 4.920122][ C0] mmc0: sdhci: Present: 0x01f000f0 | Host ctl: 0x00000030 [ 4.927249][ C0] mmc0: sdhci: Power: 0x00000000 | Blk gap: 0x00000000 [ 4.934377][ C0] mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007 [ 4.941506][ C0] mmc0: sdhci: Timeout: 0x0000000c | Int stat: 0x00000000 [ 4.948631][ C0] mmc0: sdhci: Int enab: 0x037f000b | Sig enab: 0x037f000b [ 4.955759][ C0] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 4.962887][ C0] mmc0: sdhci: Caps: 0x1e6d0080 | Caps_1: 0x08000007 [ 4.970014][ C0] mmc0: sdhci: Cmd: 0x0000153a | Max curr: 0x000003fc [ 4.977143][ C0] mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000900 [ 4.984270][ C0] mmc0: sdhci: Resp[2]: 0x000ls00900 | Resp[3]: 0x00000000 [ 4.991398][ C0] mmc0: sdhci: Host ctl2: 0x00003005 [ 4.996526][ C0] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000f0200200 [ 4.811901][ C0] mmc0: sdhci: ============================================
Wenchao Chen (1):
mmc: sdhci: Fixed too many logs being printed during tuning
drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)
Signature · 1 line
2.17.1
PATCH 1/1 mmc: sdhci: Fixed too many logs being printed during tuning
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci.c +4 -0
@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ; +pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );
Signature · 1 line
2.17.1
Re: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 16 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0
drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3407
Quoted 7 lines
drivers/mmc/host/sdhci.c +4
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ; +
Please use mmc_op_tuning() instead of open-coding this. I also need an ack from Adrian to apply this.
Quoted 6 lines
drivers/mmc/host/sdhci.c +0
-1pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ ); --2.17.1
Kind regards
Uffe
Re: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 21 lines · Ulf Hansson
Quoted 19 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ;
Quoted 7 lines
drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3407
Quoted 4 lines
drivers/mmc/host/sdhci.c +4
-0+ command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ; +Please use
mmc_op_tuning()instead of open-coding this. I also need an ack from Adrian to apply this.
Thank you for your review, I will update the next version.
Quoted 10 lines
Quoted 7 lines
drivers/mmc/host/sdhci.c +0
-1pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ ); --2.17.1
Kind regards
Uffe
Adrian Hunter
maintainerRe: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
In reply to Wenchao ChenQuoted 15 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0
drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3406
Quoted 6 lines
drivers/mmc/host/sdhci.c +3
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ;
Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set host->pending_reset.
Can you elaborate on what is going wrong?
Quoted 4 lines
drivers/mmc/host/sdhci.c +1
-0+pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );
Re: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 28 lines · Adrian Hunter
Quoted 15 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3406
Quoted 6 lines
drivers/mmc/host/sdhci.c +3
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ;Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set
host->pending_reset.
Quoted 2 lines
Can you elaborate on what is going wrong?
Hi adrian
1. In the process of tuning, not all tuning values are good, some tuning values may cause errors, and these errors print too many logs. Of course, we reset the cmdline or dataline on error.
2. use host->pending_reset = true
static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) {
...
if (sdhci_needs_reset(host, mrq))host->pending_reset = true;
...
}
But intmask = 0x00200000
static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) {
...
if (!host->data) {
struct mmc_command *data_cmd = host->data_cmd;
if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { if (intmask & SDHCI_INT_DATA_TIMEOUT) { //#define SDHCI_INT_DATA_TIMEOUT 0x00100000 host->data_cmd = NULL;data_cmd->error = -ETIMEDOUT; sdhci_err_stats_inc(host, CMD_TIMEOUT); __sdhci_finish_mrq(host, data_cmd->mrq);//<= return;
}
if (intmask & SDHCI_INT_DATA_END) { //#define SDHCI_INT_DATA_END 0x00000002
host->data_cmd = NULL;
/*
* Some cards handle busy-end interrupt
* before the command completed, so make
* sure we do things in the proper order.
*/
if (host->cmd == data_cmd)
return;
__sdhci_finish_mrq(host, data_cmd->mrq);//<=
return;
}
}
...
if (host->pending_reset)
return;
pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
mmc_hostname(host->mmc), (unsigned)intmask);
sdhci_err_stats_inc(host, UNEXPECTED_IRQ);sdhci_dumpregs(host);
return;
}
...
}
Quoted 5 lines
Quoted 4 lines
drivers/mmc/host/sdhci.c +1
-0+pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );
Adrian Hunter
maintainerRe: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 81 lines · Wenchao Chen
Quoted 28 lines · Adrian Hunter
Quoted 15 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3406
Quoted 6 lines
drivers/mmc/host/sdhci.c +3
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ;Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set
host->pending_reset.Quoted 2 lines
Can you elaborate on what is going wrong?
Hi adrian
1. In the process of tuning, not all tuning values are good, some tuning values may cause errors, and these errors print too many logs. Of course, we reset the cmdline or dataline on error.
2. usehost->pending_reset= true
static void__sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq){
...
if (sdhci_needs_reset(host, mrq))host->pending_reset= true;
...
}But intmask =
0x00200000
static voidsdhci_data_irq(struct sdhci_host *host, u32 intmask){
...
if (!host->data) {
structmmc_command*data_cmd=host->data_cmd;if (
data_cmd&& (data_cmd->flags&MMC_RSP_BUSY)) { if (intmask &SDHCI_INT_DATA_TIMEOUT) { //#defineSDHCI_INT_DATA_TIMEOUT0x00100000host->data_cmd= NULL;data_cmd->error=-ETIMEDOUT;sdhci_err_stats_inc(host, CMD_TIMEOUT);__sdhci_finish_mrq(host, data_cmd->mrq);//<= return;
}
if (intmask &SDHCI_INT_DATA_END) { //#defineSDHCI_INT_DATA_END0x00000002
host->data_cmd= NULL;
/*
* Some cards handle busy-end interrupt
* before the command completed, so make
* sure we do things in the proper order.
*/
if (host->cmd==data_cmd)
return;
__sdhci_finish_mrq(host, data_cmd->mrq);//<=
return;
}
}
...
if (host->pending_reset)
return;pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
Quoted 8 lines
mmc_hostname(host->mmc), (unsigned)intmask);
sdhci_err_stats_inc(host, UNEXPECTED_IRQ);sdhci_dumpregs(host);return;
}
...
}
Not really following that I'm sorry.
Are you saying you get a data interrupt after he data circuit is reset?
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
drivers/mmc/host/sdhci.c +1
-0+pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );
Re: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 87 lines · Adrian Hunter
Quoted 85 lines · Wenchao Chen
Quoted 28 lines · Adrian Hunter
Quoted 15 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3406
Quoted 6 lines
drivers/mmc/host/sdhci.c +3
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ;Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set
host->pending_reset.Quoted 2 lines
Can you elaborate on what is going wrong?
Hi adrian
1. In the process of tuning, not all tuning values are good, some tuning values may cause errors, and these errors print too many logs. Of course, we reset the cmdline or dataline on error.
2. usehost->pending_reset= true
static void__sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq){
...
if (sdhci_needs_reset(host, mrq))host->pending_reset= true;
...
}But intmask =
0x00200000
static voidsdhci_data_irq(struct sdhci_host *host, u32 intmask){
...
if (!host->data) {
structmmc_command*data_cmd=host->data_cmd;if (
data_cmd&& (data_cmd->flags&MMC_RSP_BUSY)) { if (intmask &SDHCI_INT_DATA_TIMEOUT) { //#defineSDHCI_INT_DATA_TIMEOUT0x00100000host->data_cmd= NULL;data_cmd->error=-ETIMEDOUT;sdhci_err_stats_inc(host, CMD_TIMEOUT);__sdhci_finish_mrq(host, data_cmd->mrq);//<= return;
}
if (intmask &SDHCI_INT_DATA_END) { //#defineSDHCI_INT_DATA_END0x00000002
host->data_cmd= NULL;
/*
* Some cards handle busy-end interrupt
* before the command completed, so make
* sure we do things in the proper order.
*/
if (host->cmd==data_cmd)
return;
__sdhci_finish_mrq(host, data_cmd->mrq);//<=
return;
}
}
...
if (host->pending_reset)
return;pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
mmc_hostname(host->mmc), (unsigned)intmask);
sdhci_err_stats_inc(host, UNEXPECTED_IRQ);sdhci_dumpregs(host);
Quoted 9 lines
Quoted 4 lines
return;
}
...
}Not really following that I'm sorry.
Are you saying you get a data interrupt after he data circuit is reset?
No. During the tuning process, sdhci_data_irq does not skip printing because the interrupt state is 0x00200000 (DATA CRC ERROR).
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
drivers/mmc/host/sdhci.c +1
-0+pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );
Adrian Hunter
maintainerRe: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning
Quoted 93 lines · Wenchao Chen
Quoted 92 lines · Adrian Hunter
Quoted 89 lines · Wenchao Chen
Quoted 28 lines · Adrian Hunter
Quoted 15 lines · Wenchao Chen
From: Wenchao Chen <[email protected]>
During the HS200 tuning process, too many tuning errors are printed in the log.
Signed-off-by Wenchao Chen <[email protected]>--- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/sdhci.c +0
-0drivers/mmc/host/sdhci.c static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · line 3406
Quoted 6 lines
drivers/mmc/host/sdhci.c +3
-0@@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)if (host->pending_reset)return ; + command =SDHCI_GET_CMD (sdhci_readw (host,SDHCI_COMMAND )); +if (command ==MMC_SEND_TUNING_BLOCK || command ==MMC_SEND_TUNING_BLOCK_HS200 ) +return ;Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set
host->pending_reset.Quoted 2 lines
Can you elaborate on what is going wrong?
Hi adrian
1. In the process of tuning, not all tuning values are good, some tuning values may cause errors, and these errors print too many logs. Of course, we reset the cmdline or dataline on error.
2. usehost->pending_reset= true
static void__sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq){
...
if (sdhci_needs_reset(host, mrq))host->pending_reset= true;
...
}But intmask =
0x00200000
static voidsdhci_data_irq(struct sdhci_host *host, u32 intmask){
...
if (!host->data) {
structmmc_command*data_cmd=host->data_cmd;if (
data_cmd&& (data_cmd->flags&MMC_RSP_BUSY)) { if (intmask &SDHCI_INT_DATA_TIMEOUT) { //#defineSDHCI_INT_DATA_TIMEOUT0x00100000host->data_cmd= NULL;data_cmd->error=-ETIMEDOUT;sdhci_err_stats_inc(host, CMD_TIMEOUT);__sdhci_finish_mrq(host, data_cmd->mrq);//<= return;
}
if (intmask &SDHCI_INT_DATA_END) { //#defineSDHCI_INT_DATA_END0x00000002
host->data_cmd= NULL;
/*
* Some cards handle busy-end interrupt
* before the command completed, so make
* sure we do things in the proper order.
*/
if (host->cmd==data_cmd)
return;
__sdhci_finish_mrq(host, data_cmd->mrq);//<=
return;
}
}
...
if (host->pending_reset)
return;pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
mmc_hostname(host->mmc), (unsigned)intmask);
sdhci_err_stats_inc(host, UNEXPECTED_IRQ);sdhci_dumpregs(host);return;
}
...
}
Quoted 7 lines
Quoted 4 lines
Not really following that I'm sorry.
Are you saying you get a data interrupt after he data circuit is reset?
No. During the tuning process,
sdhci_data_irqdoes not skip printing because the interrupt state is0x00200000(DATA CRC ERROR).
Sorry I am still confused. Which driver is this? I was assuming you were using mmc_send_tuning() because the only interrupt enabled for regular SDHCI tuning is SDHCI_INT_DATA_AVAIL (0x00000020).
So are you saying you are getting status 0x00200000 even though the mask is 0x00000020 ?
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
drivers/mmc/host/sdhci.c +1
-0+pr_err ("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n" ,mmc_hostname (host->mmc), (unsigned )intmask);sdhci_err_stats_inc (host,UNEXPECTED_IRQ );