Devicetree
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Han Gao <gaohan@iscas.ac.cn>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen Wang" <unicorn_wang@outlook.com>,
	"Inochi Amaoto" <inochiama@gmail.com>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Zixian Zeng" <sycamoremoon376@gmail.com>,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	sophgo@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, "Han Gao" <rabenda.cn@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] riscv: dts: sophgo: Add dma-coherent to SG2042 PCIe controllers
Date: Tue, 31 Mar 2026 18:57:37 +0100	[thread overview]
Message-ID: <20260331-outlet-molehill-939c0daacd06@spud> (raw)
In-Reply-To: <20260331171248.973014-3-gaohan@iscas.ac.cn>

[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]

On Wed, Apr 01, 2026 at 01:12:48AM +0800, Han Gao wrote:
> SG2042's PCIe root complexes are cache-coherent with the CPU. Mark all
> four PCIe controller nodes (pcie_rc0 through pcie_rc3) as dma-coherent
> so the kernel uses coherent DMA mappings instead of non-coherent bounce
> buffering.

Worth pointing out I guess that this property is needed, despite riscv
being coherent by default, because the whole bus is marked
dma-noncoherent.

> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
> ---
>  arch/riscv/boot/dts/sophgo/sg2042.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> index 9fddf3f0b3b9..3af770549742 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> @@ -417,6 +417,7 @@ pcie_rc0: pcie@7060000000 {
>  			vendor-id = <0x1f1c>;
>  			device-id = <0x2042>;
>  			cdns,no-bar-match-nbits = <48>;
> +			dma-coherent;
>  			msi-parent = <&msi>;
>  			status = "disabled";
>  		};
> @@ -439,6 +440,7 @@ pcie_rc1: pcie@7060800000 {
>  			vendor-id = <0x1f1c>;
>  			device-id = <0x2042>;
>  			cdns,no-bar-match-nbits = <48>;
> +			dma-coherent;
>  			msi-parent = <&msi>;
>  			status = "disabled";
>  		};
> @@ -461,6 +463,7 @@ pcie_rc2: pcie@7062000000 {
>  			vendor-id = <0x1f1c>;
>  			device-id = <0x2042>;
>  			cdns,no-bar-match-nbits = <48>;
> +			dma-coherent;
>  			msi-parent = <&msi>;
>  			status = "disabled";
>  		};
> @@ -483,6 +486,7 @@ pcie_rc3: pcie@7062800000 {
>  			vendor-id = <0x1f1c>;
>  			device-id = <0x2042>;
>  			cdns,no-bar-match-nbits = <48>;
> +			dma-coherent;
>  			msi-parent = <&msi>;
>  			status = "disabled";
>  		};
> -- 
> 2.47.3
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-03-31 17:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 17:12 [PATCH 0/2] riscv: sophgo: sg2042: Enable PCIe DMA coherence Han Gao
2026-03-31 17:12 ` [PATCH 1/2] dt-bindings: pci: sophgo: Add dma-coherent property for SG2042 Han Gao
2026-04-08 14:41   ` Rob Herring (Arm)
2026-03-31 17:12 ` [PATCH 2/2] riscv: dts: sophgo: Add dma-coherent to SG2042 PCIe controllers Han Gao
2026-03-31 17:57   ` Conor Dooley [this message]
2026-04-02  8:43   ` Chen Wang
2026-04-02 10:30     ` Han Gao
2026-05-01 16:49 ` (subset) [PATCH 0/2] riscv: sophgo: sg2042: Enable PCIe DMA coherence Manivannan Sadhasivam
2026-06-01  2:57 ` Inochi Amaoto
2026-06-02  9:21   ` Inochi Amaoto
2026-06-02 22:15     ` Inochi Amaoto

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=20260331-outlet-molehill-939c0daacd06@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gaohan@iscas.ac.cn \
    --cc=inochiama@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rabenda.cn@gmail.com \
    --cc=robh@kernel.org \
    --cc=sophgo@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=sycamoremoon376@gmail.com \
    --cc=unicorn_wang@outlook.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