All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Y.b. Lu" <yangbo.lu@nxp.com>
To: Robin Murphy <robin.murphy@arm.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	dann frazier <dann.frazier@canonical.com>,
	Will Deacon <will.deacon@arm.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Christoph Hellwig <hch@lst.de>, Leo Li <leoyang.li@nxp.com>
Subject: RE: [PATCH 2/3] mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence
Date: Wed, 5 Feb 2020 05:56:21 +0000	[thread overview]
Message-ID: <AM7PR04MB6885C2B7186DE54E97C6E38BF8020@AM7PR04MB6885.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <50fe98f2-9ee6-c0fb-d246-e3d6b4b2cec5@arm.com>

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@arm.com>
> Sent: Monday, January 20, 2020 9:34 PM
> To: Y.b. Lu <yangbo.lu@nxp.com>; Russell King <rmk+kernel@armlinux.org.uk>
> Cc: Adrian Hunter <adrian.hunter@intel.com>; Ulf Hansson
> <ulf.hansson@linaro.org>; linux-mmc@vger.kernel.org; dann frazier
> <dann.frazier@canonical.com>; Will Deacon <will.deacon@arm.com>; Nicolin
> Chen <nicoleotsuka@gmail.com>; Christoph Hellwig <hch@lst.de>
> 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@arm.com>
> From: Robin Murphy <robin.murphy@arm.com>
> 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@nxp.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>   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

  reply	other threads:[~2020-02-05  5:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-22 10:23 [PATCH 0/3] Fix sdhci-of-esdhc DMA coherency Russell King - ARM Linux admin
2019-09-22 10:23 ` Russell King - ARM Linux admin
2019-09-22 10:27 ` [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma coherent Russell King
2019-09-22 10:27   ` Russell King
2019-09-23 16:00   ` Li Yang
2019-09-23 16:00     ` Li Yang
2019-09-23 21:26   ` Ulf Hansson
2019-09-23 21:26     ` Ulf Hansson
2019-09-24  3:41     ` Leo Li
2019-09-24  3:41       ` Leo Li
2019-09-24 18:04       ` Robin Murphy
2019-09-24 18:04         ` Robin Murphy
2019-09-27 18:35         ` Ulf Hansson
2019-09-27 18:35           ` Ulf Hansson
2019-10-07 12:42   ` Shawn Guo
2019-10-07 12:42     ` Shawn Guo
     [not found] ` <E1iBz50-0008Mc-8K@rmk-PC.armlinux.org.uk>
2020-01-20 10:09   ` [PATCH 2/3] mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence Y.b. Lu
2020-01-20 10:20     ` Russell King - ARM Linux admin
2020-01-20 13:34     ` Robin Murphy
2020-02-05  5:56       ` Y.b. Lu [this message]
2020-02-05  7:56         ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM7PR04MB6885C2B7186DE54E97C6E38BF8020@AM7PR04MB6885.eurprd04.prod.outlook.com \
    --to=yangbo.lu@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=dann.frazier@canonical.com \
    --cc=hch@lst.de \
    --cc=leoyang.li@nxp.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    --cc=ulf.hansson@linaro.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.