From: Marcin Wojtas <mw@semihalf.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "Marek Behún" <kabel@kernel.org>, "Andrew Lunn" <andrew@lunn.ch>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, gregory.clement@bootlin.com,
sebastian.hesselbarth@gmail.com, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, hch@lst.de, jaz@semihalf.com
Subject: Re: [PATCH] ARM: dts: armada-38x: Mark devices as dma-coherent
Date: Mon, 24 Oct 2022 11:11:12 +0200 [thread overview]
Message-ID: <CAPv3WKeL30nhrFdVTgAhpYUk7v2zR4F9E3NrBrsGvYtFU-mzRA@mail.gmail.com> (raw)
In-Reply-To: <Y1ZEBqrxZ1PSLCU6@shell.armlinux.org.uk>
pon., 24 paź 2022 o 09:51 Russell King (Oracle)
<linux@armlinux.org.uk> napisał(a):
>
> On Mon, Oct 24, 2022 at 08:51:02AM +0200, Marek Behún wrote:
> > > Sure. In such a case the description of 380 variant (single core)
> > > should remain untouched.
> > >
> > > We need to decide what to do with dual-CPU, i.e. Armada 385/388. How about:
> > > - Don't change current behavior, i.e. perform a necessary kernel
> > > configuration in "arm,pl310-cache" driver,
> > > arch/arm/mach-mvebu/coherency.c + &coherencyfab:node in DT
> > > - Satisfy of_dma_is_coherent() by adding `dma-coherent;` in
> > > armada-385.dtsi only (IMO this would describe HW properly)
> > > ?
> >
> > It will describe HW properly, but someone running older kernel compiled
> > with no SMP support will see a performance drop. I wonder how many
> > people do that.
>
> If the kernel is built without SMP support, the page table entries will
> not have the shared bit set, and the system will _not_ be DMA-coherent.
> Having DT mark devices as "dma-coherent" in this case will lead to data
> corruption, because the DMA API will believe them to be DMA-coherent
> when the page tables are not setup for that to work.
>
Thanks, for the explanation. Since we're heavily dependent on what
happens in the kernel we boot, it will be easier to just drop this
patch and keep using the DT as-is.
Best regards,
Marcin
prev parent reply other threads:[~2022-10-24 9:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 23:40 [PATCH] ARM: dts: armada-38x: Mark devices as dma-coherent Marcin Wojtas
2022-10-23 15:04 ` Andrew Lunn
2022-10-23 16:20 ` Russell King (Oracle)
2022-10-23 21:30 ` Marcin Wojtas
2022-10-24 6:51 ` Marek Behún
2022-10-24 7:51 ` Russell King (Oracle)
2022-10-24 9:11 ` Marcin Wojtas [this message]
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=CAPv3WKeL30nhrFdVTgAhpYUk7v2zR4F9E3NrBrsGvYtFU-mzRA@mail.gmail.com \
--to=mw@semihalf.com \
--cc=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=hch@lst.de \
--cc=jaz@semihalf.com \
--cc=kabel@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=robh+dt@kernel.org \
--cc=sebastian.hesselbarth@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).