RE: [PATCH 2/3] mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence

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

 



Hi Robin,

Thanks lot for your suggestion. I prefer your fix-up patch to treat PowerPC as a special case.

Hi Adrian and Uffe,

Do you think it is ok? Should I help to re-send that patch to mmc mailing list for reviewing.
Thanks.

Best regards,
Yangbo Lu

> -----Original Message-----
> From: Robin Murphy <robin.murphy@xxxxxxx>
> Sent: Monday, January 20, 2020 9:34 PM
> To: Y.b. Lu <yangbo.lu@xxxxxxx>; Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>; Ulf Hansson
> <ulf.hansson@xxxxxxxxxx>; linux-mmc@xxxxxxxxxxxxxxx; dann frazier
> <dann.frazier@xxxxxxxxxxxxx>; Will Deacon <will.deacon@xxxxxxx>; Nicolin
> Chen <nicoleotsuka@xxxxxxxxx>; Christoph Hellwig <hch@xxxxxx>
> Subject: Re: [PATCH 2/3] mmc: sdhci-of-esdhc: set DMA snooping based on
> DMA coherence
> 
> On 20/01/2020 10:09 am, Y.b. Lu wrote:
> > Hi Russell,
> >
> > Recently I got eSDHC ADMA issue on PowerPC T2080 platform. After
> checking, the issue is related to this patch.
> > This patch was to make eSDHC DMA SNOOP bit set per dma-coherent. That
> resolved issue on LX2160A ARM64 platform.
> > However on T2080, we are facing similar issue again. It didn't have
> dma-coherent in dts.
> > Adding dma-coherent in dts, or reverting the patch could resolve the
> problem.
> 
> Arguably updating the DTS would be the most accurate option, since it
> would be describing the hardware more correctly, however if there are
> reasons for that not being sufficient (e.g. DTBs baked into firmware, or
> worries of confusing some other DT consumer) then something like the
> below seems reasonable (albeit a little crude) IMO.
> 
> Robin.
> 
> ----->8-----
>  From fafad319893b4168fcccc5445543caf876a0be2d Mon Sep 17 00:00:00
> 2001
> Message-Id:
> <fafad319893b4168fcccc5445543caf876a0be2d.1579526755.git.robin.murph
> y@xxxxxxx>
> From: Robin Murphy <robin.murphy@xxxxxxx>
> Date: Mon, 20 Jan 2020 13:11:59 +0000
> Subject: [PATCH] mmc: sdhci-of-esdhc: Restore coherency for PPC platforms
> 
> Historically, not all PPC platforms have supported per-device coherency,
> and some may rely on platform-level assumptions rather than explicitly
> specifying the "dma-coherent" propert in their DT. Although the eSDHC
> driver needs to tie in to per-device coherency to work correctly on
> arm/arm64 platforms, this has apparently caused problems for PPC, so
> restore the previous behaviour there with a special case.
> 
> Fixes: 121bd08b029e ("mmc: sdhci-of-esdhc: set DMA snooping based on
> DMA
> coherence")
> Reported-by: Yangbo Lu <yangbo.lu@xxxxxxx>
> Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
> ---
>   drivers/mmc/host/sdhci-of-esdhc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
> b/drivers/mmc/host/sdhci-of-esdhc.c
> index 500f70a6ee42..a2599368b2bd 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -527,7 +527,8 @@ static int esdhc_of_enable_dma(struct sdhci_host
> *host)
> 
>   	value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
> 
> -	if (of_dma_is_coherent(dev->of_node))
> +	/* Historically, PPC has always assumed coherency here */
> +	if (IS_ENABLED(CONFIG_PPC) || of_dma_is_coherent(dev->of_node))
>   		value |= ESDHC_DMA_SNOOP;
>   	else
>   		value &= ~ESDHC_DMA_SNOOP;
> --
> 2.23.0.dirty




[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