All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation: document dma device use for mcb
@ 2020-12-18 15:35 Johannes Thumshirn
  2021-01-11 10:19 ` Johannes Thumshirn
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2020-12-18 15:35 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, Johannes Thumshirn, Hannes Duerr

Hannes reported a problem with setting up dma transfers on a mcb device.
The problem boiled down to the use of a wrong 'device' for the dma
functions.

Document how to setup dma transfers for a IP core on a mcb carrier.

Reported-by: Hannes Duerr <Hannes.Duerr@duagon.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 Documentation/driver-api/men-chameleon-bus.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/driver-api/men-chameleon-bus.rst b/Documentation/driver-api/men-chameleon-bus.rst
index 1b1f048aa748..6f0b9ee47595 100644
--- a/Documentation/driver-api/men-chameleon-bus.rst
+++ b/Documentation/driver-api/men-chameleon-bus.rst
@@ -18,6 +18,7 @@ MEN Chameleon Bus
        4.1 The driver structure
        4.2 Probing and attaching
        4.3 Initializing the driver
+       4.4 Using DMA
 
 
 Introduction
@@ -173,3 +174,14 @@ module at the MCB core::
 The module_mcb_driver() macro can be used to reduce the above code::
 
 	module_mcb_driver(foo_driver);
+
+Using DMA
+---------
+
+To make use of the kernel's DMA-API's function, you will need to use the
+carrier device's 'struct device'. Fortunately 'struct mcb_device' embeds a
+pointer (->dma_dev) to the carrier's device for DMA purposes::
+
+        ret = dma_set_mask_and_coherent(&mdev->dma_dev, DMA_BIT_MASK(dma_bits));
+        if (rc)
+                /* Handle errors */
-- 
2.26.2


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

* Re: [PATCH] Documentation: document dma device use for mcb
  2020-12-18 15:35 [PATCH] Documentation: document dma device use for mcb Johannes Thumshirn
@ 2021-01-11 10:19 ` Johannes Thumshirn
  2021-01-11 20:26   ` Jonathan Corbet
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2021-01-11 10:19 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, Hannes Duerr

On 18/12/2020 16:35, Johannes Thumshirn wrote:
> Hannes reported a problem with setting up dma transfers on a mcb device.
> The problem boiled down to the use of a wrong 'device' for the dma
> functions.
> 
> Document how to setup dma transfers for a IP core on a mcb carrier.

Ping?

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

* Re: [PATCH] Documentation: document dma device use for mcb
  2021-01-11 10:19 ` Johannes Thumshirn
@ 2021-01-11 20:26   ` Jonathan Corbet
  2021-01-12 10:25     ` Johannes Thumshirn
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2021-01-11 20:26 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: linux-doc, linux-kernel, Hannes Duerr

On Mon, 11 Jan 2021 10:19:55 +0000
Johannes Thumshirn <Johannes.Thumshirn@wdc.com> wrote:

> On 18/12/2020 16:35, Johannes Thumshirn wrote:
> > Hannes reported a problem with setting up dma transfers on a mcb device.
> > The problem boiled down to the use of a wrong 'device' for the dma
> > functions.
> > 
> > Document how to setup dma transfers for a IP core on a mcb carrier.  
> 
> Ping?

Sorry, I've been distracted by holidays, merge window, network issues, and
generally watching the news in horror.  The patch is applied now, thanks.

jon

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

* Re: [PATCH] Documentation: document dma device use for mcb
  2021-01-11 20:26   ` Jonathan Corbet
@ 2021-01-12 10:25     ` Johannes Thumshirn
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2021-01-12 10:25 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, Hannes Duerr

On 11/01/2021 21:27, Jonathan Corbet wrote:
> Sorry, I've been distracted by holidays, merge window, network issues, and
> generally watching the news in horror.  The patch is applied now, thanks.

Thanks Jon

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

end of thread, other threads:[~2021-01-12 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 15:35 [PATCH] Documentation: document dma device use for mcb Johannes Thumshirn
2021-01-11 10:19 ` Johannes Thumshirn
2021-01-11 20:26   ` Jonathan Corbet
2021-01-12 10:25     ` Johannes Thumshirn

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.