All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Leo Li <leoyang.li@nxp.com>, Ulf Hansson <ulf.hansson@linaro.org>,
	Russell King <rmk+kernel@armlinux.org.uk>
Cc: Mark Rutland <mark.rutland@arm.com>,
	DTML <devicetree@vger.kernel.org>,
	dann frazier <dann.frazier@canonical.com>,
	Will Deacon <will.deacon@arm.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, "Y.b. Lu" <yangbo.lu@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma coherent
Date: Tue, 24 Sep 2019 19:04:35 +0100	[thread overview]
Message-ID: <4cb91a30-ed1b-1fef-58df-fbc46757bd5d@arm.com> (raw)
In-Reply-To: <AM0PR04MB66766AC0807A85B3E5428E028F840@AM0PR04MB6676.eurprd04.prod.outlook.com>

On 24/09/2019 04:41, Leo Li wrote:
> 
> 
>> -----Original Message-----
>> From: Ulf Hansson <ulf.hansson@linaro.org>
>> Sent: Monday, September 23, 2019 4:27 PM
>> To: Russell King <rmk+kernel@armlinux.org.uk>
>> Cc: Robin Murphy <robin.murphy@arm.com>; dann frazier
>> <dann.frazier@canonical.com>; Will Deacon <will.deacon@arm.com>;
>> Nicolin Chen <nicoleotsuka@gmail.com>; Y.b. Lu <yangbo.lu@nxp.com>;
>> Christoph Hellwig <hch@lst.de>; Mark Rutland <mark.rutland@arm.com>;
>> DTML <devicetree@vger.kernel.org>; Leo Li <leoyang.li@nxp.com>; Rob
>> Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>; Linux
>> ARM <linux-arm-kernel@lists.infradead.org>
>> Subject: Re: [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma
>> coherent
>>
>> On Sun, 22 Sep 2019 at 12:29, Russell King <rmk+kernel@armlinux.org.uk>
>> wrote:
>>>
>>> The LX2160A esdhc controllers are setup by the driver to be DMA
>>> coherent, but without marking them as such in DT, Linux thinks they
>>> are not.  This can lead to random sporadic DMA errors, even to the
>>> extent of preventing boot, such as:
>>>
>>> mmc0: ADMA error
>>> mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
>>> mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00002202
>>> mmc0: sdhci: Blk size:  0x00000008 | Blk cnt:  0x00000001
>>> mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
>>> mmc0: sdhci: Present:   0x01f50008 | Host ctl: 0x00000038
>>> mmc0: sdhci: Power:     0x00000003 | Blk gap:  0x00000000
>>> mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x000040d8
>>> mmc0: sdhci: Timeout:   0x00000003 | Int stat: 0x00000001
>>> mmc0: sdhci: Int enab:  0x037f108f | Sig enab: 0x037f108b
>>> mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00002202
>>> mmc0: sdhci: Caps:      0x35fa0000 | Caps_1:   0x0000af00
>>> mmc0: sdhci: Cmd:       0x0000333a | Max curr: 0x00000000
>>> mmc0: sdhci: Resp[0]:   0x00000920 | Resp[1]:  0x001d8a33
>>> mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x3f400e00
>>> mmc0: sdhci: Host ctl2: 0x00000000
>>> mmc0: sdhci: ADMA Err:  0x00000009 | ADMA Ptr: 0x000000236d43820c
>>> mmc0: sdhci: ============================================
>>> mmc0: error -5 whilst initialising SD card
>>>
>>> These are caused by the device's descriptor fetch hitting
>>> speculatively loaded CPU cache lines that the CPU does not see through
>>> the normal, non-cacheable DMA coherent mapping that it uses for
>>> non-coherent devices.
>>>
>>> DT and the device must agree wrt whether the device is DMA coherent or
>>> not.
>>>
>>> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
>>
>> As I am picking up patch1 and patch2 from this series, I can also help out and
>> pick up this one, if that is okay by people?
> 
> There is some concern recently from linux-next maintainer about this causing potential conflicts.  https://lkml.org/lkml/2019/9/15/225

In principle, it should be fine for #2 and #3 to go via separate trees - 
#3 aligns the DT with the existing behaviour of the driver, while #2 
will make the driver behave correctly whichever state the DT is in.

Robin.

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Leo Li <leoyang.li@nxp.com>, Ulf Hansson <ulf.hansson@linaro.org>,
	Russell King <rmk+kernel@armlinux.org.uk>
Cc: Mark Rutland <mark.rutland@arm.com>,
	DTML <devicetree@vger.kernel.org>,
	dann frazier <dann.frazier@canonical.com>,
	Will Deacon <will.deacon@arm.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, "Y.b. Lu" <yangbo.lu@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma coherent
Date: Tue, 24 Sep 2019 19:04:35 +0100	[thread overview]
Message-ID: <4cb91a30-ed1b-1fef-58df-fbc46757bd5d@arm.com> (raw)
In-Reply-To: <AM0PR04MB66766AC0807A85B3E5428E028F840@AM0PR04MB6676.eurprd04.prod.outlook.com>

On 24/09/2019 04:41, Leo Li wrote:
> 
> 
>> -----Original Message-----
>> From: Ulf Hansson <ulf.hansson@linaro.org>
>> Sent: Monday, September 23, 2019 4:27 PM
>> To: Russell King <rmk+kernel@armlinux.org.uk>
>> Cc: Robin Murphy <robin.murphy@arm.com>; dann frazier
>> <dann.frazier@canonical.com>; Will Deacon <will.deacon@arm.com>;
>> Nicolin Chen <nicoleotsuka@gmail.com>; Y.b. Lu <yangbo.lu@nxp.com>;
>> Christoph Hellwig <hch@lst.de>; Mark Rutland <mark.rutland@arm.com>;
>> DTML <devicetree@vger.kernel.org>; Leo Li <leoyang.li@nxp.com>; Rob
>> Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>; Linux
>> ARM <linux-arm-kernel@lists.infradead.org>
>> Subject: Re: [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma
>> coherent
>>
>> On Sun, 22 Sep 2019 at 12:29, Russell King <rmk+kernel@armlinux.org.uk>
>> wrote:
>>>
>>> The LX2160A esdhc controllers are setup by the driver to be DMA
>>> coherent, but without marking them as such in DT, Linux thinks they
>>> are not.  This can lead to random sporadic DMA errors, even to the
>>> extent of preventing boot, such as:
>>>
>>> mmc0: ADMA error
>>> mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
>>> mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00002202
>>> mmc0: sdhci: Blk size:  0x00000008 | Blk cnt:  0x00000001
>>> mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
>>> mmc0: sdhci: Present:   0x01f50008 | Host ctl: 0x00000038
>>> mmc0: sdhci: Power:     0x00000003 | Blk gap:  0x00000000
>>> mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x000040d8
>>> mmc0: sdhci: Timeout:   0x00000003 | Int stat: 0x00000001
>>> mmc0: sdhci: Int enab:  0x037f108f | Sig enab: 0x037f108b
>>> mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00002202
>>> mmc0: sdhci: Caps:      0x35fa0000 | Caps_1:   0x0000af00
>>> mmc0: sdhci: Cmd:       0x0000333a | Max curr: 0x00000000
>>> mmc0: sdhci: Resp[0]:   0x00000920 | Resp[1]:  0x001d8a33
>>> mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x3f400e00
>>> mmc0: sdhci: Host ctl2: 0x00000000
>>> mmc0: sdhci: ADMA Err:  0x00000009 | ADMA Ptr: 0x000000236d43820c
>>> mmc0: sdhci: ============================================
>>> mmc0: error -5 whilst initialising SD card
>>>
>>> These are caused by the device's descriptor fetch hitting
>>> speculatively loaded CPU cache lines that the CPU does not see through
>>> the normal, non-cacheable DMA coherent mapping that it uses for
>>> non-coherent devices.
>>>
>>> DT and the device must agree wrt whether the device is DMA coherent or
>>> not.
>>>
>>> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
>>
>> As I am picking up patch1 and patch2 from this series, I can also help out and
>> pick up this one, if that is okay by people?
> 
> There is some concern recently from linux-next maintainer about this causing potential conflicts.  https://lkml.org/lkml/2019/9/15/225

In principle, it should be fine for #2 and #3 to go via separate trees - 
#3 aligns the DT with the existing behaviour of the driver, while #2 
will make the driver behave correctly whichever state the DT is in.

Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-09-24 18:04 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 [this message]
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
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=4cb91a30-ed1b-1fef-58df-fbc46757bd5d@arm.com \
    --to=robin.murphy@arm.com \
    --cc=dann.frazier@canonical.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=yangbo.lu@nxp.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.