All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Conor Dooley <conor@kernel.org>
Cc: Maxim Kochetkov <fido_max@inbox.ru>,
	Christoph Hellwig <hch@lst.de>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	robh@kernel.org, mpe@ellerman.id.au, aou@eecs.berkeley.edu,
	palmer@dabbelt.com, paul.walmsley@sifive.com
Subject: Re: [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set
Date: Fri, 22 Dec 2023 16:04:17 +0100	[thread overview]
Message-ID: <20231222150417.GA23363@lst.de> (raw)
In-Reply-To: <20231222-outburst-spoiling-75082a7826dd@spud>

On Fri, Dec 22, 2023 at 02:54:19PM +0000, Conor Dooley wrote:
> > of_dma_is_coherent() affects only DT devices. And we can override it with
> > "dma-coherent"/"dma-noncoherent". ACPI devices can specify by
> > "attr == DEV_DMA_COHERENT". But all other devices (platform_device, usb,
> 
> I would have expected that usb devices "inherit" the value from the usb
> controller whose bus they are on. Similarly, platform devices are on a
> bus that should be marked as non-coherent if that is the case.
> Christoph certainly knows better how things operate here however.

usb is not a DMAable devices, you need to use the USB layer helpers
that call the DMA API on the host controller's device.  platform_device
must have a device tree and the dma-noncoherent attribute somewhere in
the hierarchy.

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

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Conor Dooley <conor@kernel.org>
Cc: Maxim Kochetkov <fido_max@inbox.ru>,
	Christoph Hellwig <hch@lst.de>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	robh@kernel.org, mpe@ellerman.id.au, aou@eecs.berkeley.edu,
	palmer@dabbelt.com, paul.walmsley@sifive.com
Subject: Re: [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set
Date: Fri, 22 Dec 2023 16:04:17 +0100	[thread overview]
Message-ID: <20231222150417.GA23363@lst.de> (raw)
In-Reply-To: <20231222-outburst-spoiling-75082a7826dd@spud>

On Fri, Dec 22, 2023 at 02:54:19PM +0000, Conor Dooley wrote:
> > of_dma_is_coherent() affects only DT devices. And we can override it with
> > "dma-coherent"/"dma-noncoherent". ACPI devices can specify by
> > "attr == DEV_DMA_COHERENT". But all other devices (platform_device, usb,
> 
> I would have expected that usb devices "inherit" the value from the usb
> controller whose bus they are on. Similarly, platform devices are on a
> bus that should be marked as non-coherent if that is the case.
> Christoph certainly knows better how things operate here however.

usb is not a DMAable devices, you need to use the USB layer helpers
that call the DMA API on the host controller's device.  platform_device
must have a device tree and the dma-noncoherent attribute somewhere in
the hierarchy.

  reply	other threads:[~2023-12-22 15:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 18:51 [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set Maxim Kochetkov
2023-12-21 18:51 ` Maxim Kochetkov
2023-12-21 20:29 ` Conor Dooley
2023-12-21 20:29   ` Conor Dooley
2023-12-21 22:27   ` Jiaxun Yang
2023-12-21 22:27     ` Jiaxun Yang
2023-12-22  4:14     ` Christoph Hellwig
2023-12-22  4:14       ` Christoph Hellwig
2023-12-22 14:39       ` Maxim Kochetkov
2023-12-22 14:39         ` Maxim Kochetkov
2023-12-22 14:54         ` Conor Dooley
2023-12-22 14:54           ` Conor Dooley
2023-12-22 15:04           ` Christoph Hellwig [this message]
2023-12-22 15:04             ` Christoph Hellwig
2023-12-22 15:38           ` Maxim Kochetkov
2023-12-22 15:38             ` Maxim Kochetkov
2023-12-22 15:45             ` Jiaxun Yang
2023-12-22 15:45               ` Jiaxun Yang
2023-12-22 15:53               ` Maxim Kochetkov
2023-12-22 15:53                 ` Maxim Kochetkov
2023-12-22 16:01                 ` Jiaxun Yang
2023-12-22 16:01                   ` Jiaxun Yang
2023-12-23  4:59                   ` Christoph Hellwig
2023-12-23  4:59                     ` Christoph Hellwig
2023-12-25  6:47                     ` Maxim Kochetkov
2023-12-25  6:47                       ` Maxim Kochetkov

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=20231222150417.GA23363@lst.de \
    --to=hch@lst.de \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=fido_max@inbox.ru \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mpe@ellerman.id.au \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    /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.