Re: [PATCH] mmc: sdhci-pci: disable intel voltage switch if unsupported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/10/18 4:40 PM, Anisse Astier wrote:
> On Mon, Oct 22, 2018 at 03:34:24PM +0300, Adrian Hunter wrote:
>> On 22/10/18 12:14 PM, Anisse Astier wrote:
> [snip]
>>> [   16.823947] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
>>> [   16.823956] mmc0: sdhci: Sys addr:  0x00000008 | Version:  0x00001002
>>> [   16.823964] mmc0: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000008
>>> [   16.823971] mmc0: sdhci: Argument:  0x00cf3ff0 | Trn mode: 0x0000003b
>>> [   16.823978] mmc0: sdhci: Present:   0x1fff0001 | Host ctl: 0x0000003d
>>> [   16.823985] mmc0: sdhci: Power:     0x0000000b | Blk gap:  0x00000080
>>> [   16.823992] mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x00000007
>>> [   16.823999] mmc0: sdhci: Timeout:   0x00000006 | Int stat: 0x00000000
>>> [   16.824006] mmc0: sdhci: Int enab:  0x02ff000b | Sig enab: 0x02ff000b
>>> [   16.824013] mmc0: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000000
>>> [   16.824020] mmc0: sdhci: Caps:      0x546ec881 | Caps_1:   0x80000807
>>> [   16.824027] mmc0: sdhci: Cmd:       0x0000123a | Max curr: 0x00000000
>>> [   16.824034] mmc0: sdhci: Resp[0]:   0x00000900 | Resp[1]:  0x00000000
>>> [   16.824041] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000900
>>> [   16.824047] mmc0: sdhci: Host ctl2: 0x0000000d
>>> [   16.824055] mmc0: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x000000016bbf5200
>>> [   16.824058] mmc0: sdhci: ============================================
>>
>> Could be a BIOS issue.  Do you have the most up to date BIOS?
> 
> What makes you think it could be ?

It seems like the host controller just stopped for no apparent reason.

> I have looked into the BIOS. This specific laptop model is a Clevo
> N770GU. It does not have publicly-downloadable BIOS updates. Even it had
> a BIOS fix, shouldn't we also have a best effort fix in Linux for all
> those machines that are never updated ?

It may come to that.

Here are a couple of patches to get a bit more information.  Also, if you
config sdhci as built-in (y instead of m) then we should see a debug message
from the interrupt handler.
>From 12a4a0e83a439577534b4e58888635a1b4efd575 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Date: Mon, 22 Oct 2018 10:09:34 +0300
Subject: [PATCH 1/2] HACK: mmc: sdhci: Add GLK registers to register dump

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
 drivers/mmc/host/sdhci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 99bdae53fa2e..ae87b9474b1b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -56,6 +56,8 @@ static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable);
 
 void sdhci_dumpregs(struct sdhci_host *host)
 {
+	int reg;
+
 	SDHCI_DUMP("============ SDHCI REGISTER DUMP ===========\n");
 
 	SDHCI_DUMP("Sys addr:  0x%08x | Version:  0x%08x\n",
@@ -113,6 +115,12 @@ void sdhci_dumpregs(struct sdhci_host *host)
 		}
 	}
 
+	for (reg = 0x804; reg <= 0x840; reg += 4) {
+		if (reg == 0x80c || reg == 0x3c)
+			continue;
+		SDHCI_DUMP("%#x:     0x%08x\n", reg, sdhci_readl(host, reg));
+	}
+
 	SDHCI_DUMP("============================================\n");
 }
 EXPORT_SYMBOL_GPL(sdhci_dumpregs);
-- 
2.17.1

>From bd40460b73a747a16240c9078cfebbb0b7613ab8 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Date: Mon, 22 Oct 2018 10:57:50 +0300
Subject: [PATCH 2/2] HACK: mmc:sdhci: Dump registers at setup and after tuning

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
 drivers/mmc/host/sdhci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ae87b9474b1b..742f627bc27c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2441,6 +2441,7 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	host->tuning_err = __sdhci_execute_tuning(host, opcode);
 
 	sdhci_end_tuning(host);
+	sdhci_dumpregs(host);
 out:
 	host->flags &= ~SDHCI_HS400_TUNING;
 
@@ -3650,6 +3651,8 @@ int sdhci_setup_host(struct sdhci_host *host)
 
 	sdhci_read_caps(host);
 
+	sdhci_dumpregs(host);
+
 	override_timeout_clk = host->timeout_clk;
 
 	if (host->version > SDHCI_SPEC_420) {
-- 
2.17.1


[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux