dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [RFC 0/3] dmaengine: Support for DMA domain controllers
@ 2019-09-06 14:17 Peter Ujfalusi
  2019-09-06 14:17 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2019-09-06 14:17 UTC (permalink / raw)
  To: vinod.koul, robh+dt; +Cc: dmaengine, linux-kernel, dan.j.williams, devicetree

Hi,

More and more SoC have more than one DMA controller integrated.

If a device needs none slave DMA channel for operation (block copy from/to
memory mapped regions for example) at the moment when they request a channel it
is going to be taken from the first DMA controller which was registered, but
this might be not optimal for the device.

For example on AM654 we have two DMAs: main_udmap and mcu_udmap.
DDR to DDR memcpy is twice as fast on main_udmap compared to mcu_udmap, while
devices on MCU domain (OSPI for example) are more than twice as fast on
mcu_udmap than with main_udmap.

Because of probing order (mcu_udmap is probing first) modules would use
mcu_udmap instead of the better main_udmap. Currently the only solution is to
make a choice and disable the MEM_TO_MEM functionality on one of them which is
not a great solution.

With the introduction of DMA domain controllers we can utilize the best DMA
controller for the job around the SoC without the need to degrade performance.

If the dma-domain-controller is not present in DT or booted w/o DT the none
slave channel request will work as it does today.

The last patch introduces a new dma_domain_request_chan_by_mask() function and
I have a define for dma_request_chan_by_mask() to avoid breaking users of the
dma_request_chan_by_mask, but looking at the kernel we have small amount of
users:
drivers/gpu/drm/vc4/vc4_dsi.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap3isp/isphist.c
drivers/mtd/spi-nor/cadence-quadspi.c
drivers/spi/spi-ti-qspi.c

If it is acceptable we can modify the parameters of dma_request_chan_by_mask()
to include ther device pointer and at the same time change all of the clients
by giving NULL or in case of the last two their dev.

Regards,
Peter
---
Peter Ujfalusi (3):
  dt-bindings: dma: Add documentation for DMA domains
  dmaengine: of_dma: Function to look up the DMA domain of a client
  dmaengine: Support for requesting channels preferring DMA domain
    controller

 .../devicetree/bindings/dma/dma-domain.yaml   | 59 +++++++++++++++++++
 drivers/dma/dmaengine.c                       | 17 ++++--
 drivers/dma/of-dma.c                          | 42 +++++++++++++
 include/linux/dmaengine.h                     |  9 ++-
 include/linux/of_dma.h                        |  7 +++
 5 files changed, 126 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/dma-domain.yaml

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [RFC 0/3] dmaengine: Support for DMA domain controllers
@ 2019-09-06 14:18 Peter Ujfalusi
  2019-09-06 14:18 ` [RFC 2/3] dmaengine: of_dma: Function to look up the DMA domain of a client Peter Ujfalusi
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2019-09-06 14:18 UTC (permalink / raw)
  To: vkoul, robh+dt; +Cc: dmaengine, linux-kernel, dan.j.williams, devicetree

Hi,

More and more SoC have more than one DMA controller integrated.

If a device needs none slave DMA channel for operation (block copy from/to
memory mapped regions for example) at the moment when they request a channel it
is going to be taken from the first DMA controller which was registered, but
this might be not optimal for the device.

For example on AM654 we have two DMAs: main_udmap and mcu_udmap.
DDR to DDR memcpy is twice as fast on main_udmap compared to mcu_udmap, while
devices on MCU domain (OSPI for example) are more than twice as fast on
mcu_udmap than with main_udmap.

Because of probing order (mcu_udmap is probing first) modules would use
mcu_udmap instead of the better main_udmap. Currently the only solution is to
make a choice and disable the MEM_TO_MEM functionality on one of them which is
not a great solution.

With the introduction of DMA domain controllers we can utilize the best DMA
controller for the job around the SoC without the need to degrade performance.

If the dma-domain-controller is not present in DT or booted w/o DT the none
slave channel request will work as it does today.

The last patch introduces a new dma_domain_request_chan_by_mask() function and
I have a define for dma_request_chan_by_mask() to avoid breaking users of the
dma_request_chan_by_mask, but looking at the kernel we have small amount of
users:
drivers/gpu/drm/vc4/vc4_dsi.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap3isp/isphist.c
drivers/mtd/spi-nor/cadence-quadspi.c
drivers/spi/spi-ti-qspi.c

If it is acceptable we can modify the parameters of dma_request_chan_by_mask()
to include ther device pointer and at the same time change all of the clients
by giving NULL or in case of the last two their dev.

Regards,
Peter
---
Peter Ujfalusi (3):
  dt-bindings: dma: Add documentation for DMA domains
  dmaengine: of_dma: Function to look up the DMA domain of a client
  dmaengine: Support for requesting channels preferring DMA domain
    controller

 .../devicetree/bindings/dma/dma-domain.yaml   | 59 +++++++++++++++++++
 drivers/dma/dmaengine.c                       | 17 ++++--
 drivers/dma/of-dma.c                          | 42 +++++++++++++
 include/linux/dmaengine.h                     |  9 ++-
 include/linux/of_dma.h                        |  7 +++
 5 files changed, 126 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/dma-domain.yaml

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 14:17 [RFC 0/3] dmaengine: Support for DMA domain controllers Peter Ujfalusi
2019-09-06 14:17 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi
2019-09-06 14:17 ` [RFC 2/3] dmaengine: of_dma: Function to look up the DMA domain of a client Peter Ujfalusi
2019-09-06 14:17 ` [RFC 3/3] dmaengine: Support for requesting channels preferring DMA domain controller Peter Ujfalusi
2019-09-06 14:18 [RFC 0/3] dmaengine: Support for DMA domain controllers Peter Ujfalusi
2019-09-06 14:18 ` [RFC 2/3] dmaengine: of_dma: Function to look up the DMA domain of a client Peter Ujfalusi
2019-09-08 12:12   ` Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org dmaengine@archiver.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/ public-inbox