dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] dmaengine: Support for DMA domain controllers
@ 2019-09-06 14:18 Peter Ujfalusi
  2019-09-06 14:18 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ 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] 20+ messages in thread
* [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
  0 siblings, 1 reply; 20+ 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] 20+ messages in thread

end of thread, other threads:[~2019-09-13 13:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 14:18 [RFC 0/3] dmaengine: Support for DMA domain controllers Peter Ujfalusi
2019-09-06 14:18 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi
2019-09-08  7:47   ` Peter Ujfalusi
2019-09-08 12:10     ` Vinod Koul
2019-09-09  6:30       ` Peter Ujfalusi
2019-09-12 17:03         ` Vinod Koul
2019-09-13  7:21           ` Peter Ujfalusi
2019-09-13 10:36             ` Vinod Koul
2019-09-13 12:19               ` Peter Ujfalusi
2019-09-13 13:33                 ` Vinod Koul
2019-09-08 12:06   ` Vinod Koul
2019-09-09  6:00     ` 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
2019-09-06 14:18 ` [RFC 3/3] dmaengine: Support for requesting channels preferring DMA domain controller Peter Ujfalusi
2019-09-08  7:46   ` Peter Ujfalusi
2019-09-08 12:15   ` Vinod Koul
2019-09-09  5:56     ` Peter Ujfalusi
2019-09-12 16:49       ` Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
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

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).