From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Li Chen <me@linux.beauty>
Cc: dmaengine <dmaengine@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: Should dma_map_single take the dma controller or its consumer as an argument?
Date: Wed, 28 Jun 2023 12:02:47 +0100 [thread overview]
Message-ID: <ZJwTV59xRlUBit+N@shell.armlinux.org.uk> (raw)
In-Reply-To: <18901a6cbf0.c9e3e099688173.4166132371304083225@linux.beauty>
On Wed, Jun 28, 2023 at 06:57:35PM +0800, Li Chen wrote:
> Hi all,
>
> I recently encountered an issue where the dma_mask was set in the DMA controller's driver, but the consumer peripheral driver didn't set its own dma_mask.
It should always take the device that is *actually* performing the DMA,
since that is the device that has restrictions on what addresses can be
accessed, etc.
Devices that "consume" the data from a DMA controller don't access
memory - they are merely the targets, and they can't on their own access
host memory. Therefore, their dma mask _should_ be irrelevant.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Li Chen <me@linux.beauty>
Cc: dmaengine <dmaengine@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: Should dma_map_single take the dma controller or its consumer as an argument?
Date: Wed, 28 Jun 2023 12:02:47 +0100 [thread overview]
Message-ID: <ZJwTV59xRlUBit+N@shell.armlinux.org.uk> (raw)
In-Reply-To: <18901a6cbf0.c9e3e099688173.4166132371304083225@linux.beauty>
On Wed, Jun 28, 2023 at 06:57:35PM +0800, Li Chen wrote:
> Hi all,
>
> I recently encountered an issue where the dma_mask was set in the DMA controller's driver, but the consumer peripheral driver didn't set its own dma_mask.
It should always take the device that is *actually* performing the DMA,
since that is the device that has restrictions on what addresses can be
accessed, etc.
Devices that "consume" the data from a DMA controller don't access
memory - they are merely the targets, and they can't on their own access
host memory. Therefore, their dma mask _should_ be irrelevant.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-06-28 11:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 10:57 Should dma_map_single take the dma controller or its consumer as an argument? Li Chen
2023-06-28 10:57 ` Li Chen
2023-06-28 11:02 ` Russell King (Oracle) [this message]
2023-06-28 11:02 ` Russell King (Oracle)
2023-06-28 11:16 ` Li Chen
2023-06-28 11:16 ` Li Chen
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=ZJwTV59xRlUBit+N@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=arnd@arndb.de \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@linux.beauty \
/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.