Re: Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

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

 



On Sat, Oct 05, 2019 at 12:45:29AM +0200, Christian Zigotzky wrote:
> Hello,
> 
> The onboard SD card of the Cyrus+ PowerPC board (A-EON AmigaOne X5000) [1]
> doesn't work anymore after the 'mmc-v5.4-2' updates [2].

Hi Christian,

Please can you help us understand what is going on with your setup.
Obviously, your board wants the SDHCI controller to be DMA coherent,
but I guess that DT on your platform does not specify the
"dma-coherent" property.  Can you confirm that?

If that's the case, the question is what we do about that - do we add
it (and wait for further reports?)

The only alternative I can see is that we split ARM usage from PowerPC
usage of this driver; it seems PowerPC can get away with being more
lenient wrt DT DMA coherency correctness than the ARM architecture.

Thanks.

> 
> Error messages:
> 
> [   12.118148] mmc0: SDHCI controller on ffe114000.sdhc [ffe114000.sdhc]
> using ADMA
> [   12.232869] mmc0: ADMA error: 0x02000000
> [   12.237977] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
> [   12.243137] mmc0: sdhci: Sys addr:  0x00000000 | Version: 0x00001301
> [   12.248307] mmc0: sdhci: Blk size:  0x00000008 | Blk cnt: 0x00000001
> [   12.253448] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
> [   12.258530] mmc0: sdhci: Present:   0x01fd020a | Host ctl: 0x00000030
> [   12.263572] mmc0: sdhci: Power:     0x00000002 | Blk gap: 0x00000000
> [   12.268574] mmc0: sdhci: Wake-up:   0x00000000 | Clock: 0x000020f8
> [   12.273535] mmc0: sdhci: Timeout:   0x00000003 | Int stat: 0x00000001
> [   12.278461] mmc0: sdhci: Int enab:  0x037f008f | Sig enab: 0x037f008b
> [   12.283339] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00001301
> [   12.288198] mmc0: sdhci: Caps:      0x05fa0000 | Caps_1: 0x00000000
> [   12.293032] mmc0: sdhci: Cmd:       0x0000333a | Max curr: 0x00000000
> [   12.297861] mmc0: sdhci: Resp[0]:   0x00000920 | Resp[1]: 0x001dd533
> [   12.302615] mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]: 0x3f400e00
> [   12.307312] mmc0: sdhci: Host ctl2: 0x00000000
> [   12.311940] mmc0: sdhci: ADMA Err:  0x00000009 | ADMA Ptr: 0x7e04f208
> [   12.316573] mmc0: sdhci: ============================================
> [   12.321204] mmc0: sdhci: 7e04f200: DMA 0xfc000000, LEN 0x0008, Attr=0x23
> [   12.326022] mmc0: error -5 whilst initialising SD card
> [   12.507466] mmc0: invalid bus width
> [   12.512154] mmc0: error -22 whilst initialising SD card
> [   12.683457] mmc0: invalid bus width
> [   12.688968] mmc0: error -22 whilst initialising SD card
> [   12.774281] mmc0: invalid bus width
> [   12.779910] mmc0: error -22 whilst initialising SD card
> 
> -------------------------
> 
> I have found the issue in the DMA changes of the 'mmc-v5.4-2' updates. It's
> the commit "121bd08b029e03404c451bb237729cdff76eafed (mmc: sdhci-of-esdhc:
> set DMA snooping based on DMA coherence)" [3].
> 
> Please find attached a patch. This patch solves the issue.
> 
> dmesg output after compiling with the attached patch:
> 
> [   12.117149] mmc0: SDHCI controller on ffe114000.sdhc [ffe114000.sdhc]
> using ADMA
> [   12.208646] mmc0: new high speed SDHC card at address 59b4
> [   12.230808] mmcblk0: mmc0:59b4 USD   3.73 GiB
> 
> -------------------------
> 
> Please check the commit "121bd08b029e03404c451bb237729cdff76eafed" [3].
> 
> Thanks,
> Christian
> 
> 
> [1] https://www.amigaos.net/hardware/133/amigaone-x5000 and
> http://wiki.amiga.org/index.php?title=X5000
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.4-rc1&id=c710364f78afdef8c2ed07556d0743c5a30ed429
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=121bd08b029e03404c451bb237729cdff76eafed
> 

> diff -rupN a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> --- a/drivers/mmc/host/sdhci-of-esdhc.c	2019-10-04 12:40:23.736729250 +0200
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c	2019-10-04 12:40:46.476869118 +0200
> @@ -495,12 +495,7 @@ static int esdhc_of_enable_dma(struct sd
>  		dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40));
>  
>  	value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
> -
> -	if (of_dma_is_coherent(dev->of_node))
> -		value |= ESDHC_DMA_SNOOP;
> -	else
> -		value &= ~ESDHC_DMA_SNOOP;
> -
> +	value |= ESDHC_DMA_SNOOP;
>  	sdhci_writel(host, value, ESDHC_DMA_SYSCTL);
>  	return 0;
>  }
> 


-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up



[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