[BUG] mmc0: Internal clock never stabilised.

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

 



Hey,


*Kernel linux-next 20210305
*


I haven't used mmc for a very long time and I can't say when the regression appeared.



The problem is with this function (drivers/mmc/host/sdhci-pci-o2micro.c):


static void sdhci_o2_enable_internal_clock(struct sdhci_host *host)
{
        ktime_t timeout;
        u16 scratch;
        u32 scratch32;

        /* PLL software reset */
        scratch32 = sdhci_readl(host, O2_PLL_DLL_WDT_CONTROL1);
        scratch32 |= O2_PLL_SOFT_RESET;
        sdhci_writel(host, scratch32, O2_PLL_DLL_WDT_CONTROL1);
        udelay(1);
        scratch32 &= ~(O2_PLL_SOFT_RESET);
        sdhci_writel(host, scratch32, O2_PLL_DLL_WDT_CONTROL1);

        /* PLL force active */
        scratch32 |= O2_PLL_FORCE_ACTIVE;
        sdhci_writel(host, scratch32, O2_PLL_DLL_WDT_CONTROL1);

        /* Wait max 20 ms */
        timeout = ktime_add_ms(ktime_get(), 20);
        while (1) {
                bool timedout = ktime_after(ktime_get(), timeout);

                scratch = sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1);
                if (scratch & O2_PLL_LOCK_STATUS)
                        break;
                if (timedout) {
                        pr_err("%s: Internal clock never stabilised.\n",
                               mmc_hostname(host->mmc));
                        sdhci_dumpregs(host);
                        goto out;
                }
                udelay(10);
        }

        /* Wait for card detect finish */
        udelay(1);
        sdhci_o2_wait_card_detect_stable(host);

out:
        /* Cancel PLL force active */
        scratch32 = sdhci_readl(host, O2_PLL_DLL_WDT_CONTROL1);
        scratch32 &= ~O2_PLL_FORCE_ACTIVE;
        sdhci_writel(host, scratch32, O2_PLL_DLL_WDT_CONTROL1);
}


[  +2,416948] mmc0: Internal clock never stabilised.
[  +0,000006] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[  +0,000008] mmc0: sdhci: Sys addr:  0x00000000 | Version: 0x0000c001
[  +0,000007] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt: 0x00000000
[  +0,000007] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[  +0,000007] mmc0: sdhci: Present:   0x01ff0000 | Host ctl: 0x00000000
[  +0,000007] mmc0: sdhci: Power:     0x0000000f | Blk gap: 0x00000000
[  +0,000007] mmc0: sdhci: Wake-up:   0x00000000 | Clock: 0x00001003
[  +0,000007] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[  +0,000007] mmc0: sdhci: Int enab:  0x00ff0083 | Sig enab: 0x00ff0083
[  +0,000007] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[  +0,000006] mmc0: sdhci: Caps:      0x21e608b2 | Caps_1: 0x00002077
[  +0,000007] mmc0: sdhci: Cmd:       0x00000000 | Max curr: 0x00000064
[  +0,000007] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]: 0x00000000
[  +0,000007] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]: 0x00000000
[  +0,000005] mmc0: sdhci: Host ctl2: 0x00000000
[  +0,000001] mmc0: sdhci: ============================================
[  +0,020025] mmc0: Internal clock never stabilised.
[  +0,000008] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[  +0,000019] mmc0: sdhci: Sys addr:  0x00000000 | Version: 0x0000c001
[  +0,000010] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt: 0x00000000
[  +0,000007] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[  +0,000007] mmc0: sdhci: Present:   0x01ff0000 | Host ctl: 0x00000000
[  +0,000007] mmc0: sdhci: Power:     0x0000000f | Blk gap: 0x00000000
[  +0,000008] mmc0: sdhci: Wake-up:   0x00000000 | Clock: 0x00001003
[  +0,000009] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[  +0,000009] mmc0: sdhci: Int enab:  0x00ff0083 | Sig enab: 0x00ff0083
[  +0,000010] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[  +0,000007] mmc0: sdhci: Caps:      0x21e608b2 | Caps_1: 0x00002077
[  +0,000007] mmc0: sdhci: Cmd:       0x00000000 | Max curr: 0x00000064
[  +0,000007] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]: 0x00000000
[  +0,000007] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]: 0x00000000
[  +0,000004] mmc0: sdhci: Host ctl2: 0x00000000
[  +0,000002] mmc0: sdhci: ============================================
[  +0,144927] mmc0: Internal clock never stabilised.
[  +0,000006] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[  +0,000008] mmc0: sdhci: Sys addr:  0xfffe0058 | Version: 0x0000c001
[  +0,000007] mmc0: sdhci: Blk size:  0x00007040 | Blk cnt: 0x00000001
[  +0,000007] mmc0: sdhci: Argument:  0x80fffff1 | Trn mode: 0x00000013
[  +0,000008] mmc0: sdhci: Present:   0x01ff0000 | Host ctl: 0x00000004
[  +0,000008] mmc0: sdhci: Power:     0x0000000f | Blk gap: 0x00000000
[  +0,000008] mmc0: sdhci: Wake-up:   0x00000000 | Clock: 0x00000003
[  +0,000007] mmc0: sdhci: Timeout:   0x0000000a | Int stat: 0x00000000
[  +0,000006] mmc0: sdhci: Int enab:  0x02ff008b | Sig enab: 0x02ff008b
[  +0,000007] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[  +0,000007] mmc0: sdhci: Caps:      0x21e608b2 | Caps_1: 0x00002077
[  +0,000007] mmc0: sdhci: Cmd:       0x0000063a | Max curr: 0x00000064
[  +0,000018] mmc0: sdhci: Resp[0]:   0x00000900 | Resp[1]: 0x001d6f7f
[  +0,000009] mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]: 0x00400e00
[  +0,000004] mmc0: sdhci: Host ctl2: 0x00000000
[  +0,000002] mmc0: sdhci: ============================================
[  +0,020026] mmc0: Internal clock never stabilised.
[  +0,000005] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[  +0,000008] mmc0: sdhci: Sys addr:  0xfffe0058 | Version: 0x0000c001
[  +0,000007] mmc0: sdhci: Blk size:  0x00007040 | Blk cnt: 0x00000001
[  +0,000007] mmc0: sdhci: Argument:  0x80fffff1 | Trn mode: 0x00000013
[  +0,000007] mmc0: sdhci: Present:   0x01ff0000 | Host ctl: 0x00000004
[  +0,000008] mmc0: sdhci: Power:     0x0000000f | Blk gap: 0x00000000
[  +0,000006] mmc0: sdhci: Wake-up:   0x00000000 | Clock: 0x00000003
[  +0,000008] mmc0: sdhci: Timeout:   0x0000000a | Int stat: 0x00000000
[  +0,000008] mmc0: sdhci: Int enab:  0x02ff008b | Sig enab: 0x02ff008b
[  +0,000007] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[  +0,000008] mmc0: sdhci: Caps:      0x21e608b2 | Caps_1: 0x00002077
[  +0,000047] mmc0: sdhci: Cmd:       0x0000063a | Max curr: 0x00000064
[  +0,000011] mmc0: sdhci: Resp[0]:   0x00000900 | Resp[1]: 0x001d6f7f
[  +0,000012] mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]: 0x00400e00
[  +0,000009] mmc0: sdhci: Host ctl2: 0x00000000
[  +0,000001] mmc0: sdhci: ============================================
[  +0,000136] mmc0: new high speed SDHC card at address 1234

[  +0,000252] mmcblk0: mmc0:1234 SA04G 3.68 GiB

[  +0,015905]  mmcblk0: p1



--
Best regards, Andy Lavr.

 CONFIDENTIAL NOTE

 This email (including any attachments) is intended only for the person or entity to which it is addressed
 and may contain confidential and/or privileged material.  Any review, retransmission, dissemination or other
 use of, or taking of any action in reliance upon, this information by persons or entities other than the
 intended recipient is prohibited. If you received this in error, please notify the sender immediately and
 delete the material completely from your system. E-mail communication cannot be guaranteed to be reliable,
 secure, error-free or virus-free. Accordingly, we cannot accept liability for any damage sustained as a
 result of any virus, error or incompleteness of this e-mail or any failure to deliver promptly or at all
 information exchanged between you and us by this means. If you suspect that this e-mail may have been
 intercepted or amended, please contact the sender. Any views or opinions expressed in this email are solely
 those of the author and do not necessarily represent those of our entity or related/associated entities.




[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