From mboxrd@z Thu Jan 1 00:00:00 1970 From: James.Bottomley@HansenPartnership.com (James Bottomley) Date: Sat, 02 Jan 2016 12:10:20 -0800 Subject: [Question about DMA] Consistent memory? In-Reply-To: <56881874.4050907@topic.nl> References: <20160102103948.GR8644@n2100.arm.linux.org.uk> <56881874.4050907@topic.nl> Message-ID: <1451765420.2323.6.camel@HansenPartnership.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sat, 2016-01-02 at 19:35 +0100, Mike Looijmans wrote: > On 2-1-2016 11:39, Russell King - ARM Linux wrote: > > On Thu, Dec 31, 2015 at 04:50:54PM +0900, Masahiro Yamada wrote: > > > Hi. > > > > > > I am new to the Linux DMA APIs. > > > > > > First, I started by reading Documentation/DMA-API.txt, > > > but I am confused with the term "consistent memory". > > > > Just read "coherent memory" instead - the documentation confusingly > > uses > > the two terms to refer to the same thing. I think there was a > > patch a > > while back to replace "consistent" with "coherent" in this > > document, > > though I'm not sure what happened to it. > > I wrote that patch. I never got any comments on it, so either I > didn't > post it to the right people, or no one really cares: > http://www.kernelhub.org/?msg=747166&p=2 > > I still think that if the kernel methods all have "coherent" in their > name, we should use the word "coherent" in the documentation as well, > and not confuse people even further. So I'd happily repost that > patch. They don't: the PCI API still uses consistent: asm-generic/pci-dma-compat.h:pci_alloc_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:pci_free_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) linux/pci.h:/* kmem_cache style wrapper around pci_alloc_consistent() */ linux/pci.h:static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) These are named based on the PCI specification. James From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbcABUK0 (ORCPT ); Sat, 2 Jan 2016 15:10:26 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:41042 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbcABUKX (ORCPT ); Sat, 2 Jan 2016 15:10:23 -0500 Message-ID: <1451765420.2323.6.camel@HansenPartnership.com> Subject: Re: [Question about DMA] Consistent memory? From: James Bottomley To: Mike Looijmans , Russell King - ARM Linux , Masahiro Yamada Cc: Lars-Peter Clausen , Vinod Koul , Nicolas Ferre , Linux Kernel Mailing List , Sumit Semwal , dmaengine@vger.kernel.org, Dan Williams , Christoph Hellwig , linux-arm-kernel Date: Sat, 02 Jan 2016 12:10:20 -0800 In-Reply-To: <56881874.4050907@topic.nl> References: <20160102103948.GR8644@n2100.arm.linux.org.uk> <56881874.4050907@topic.nl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2016-01-02 at 19:35 +0100, Mike Looijmans wrote: > On 2-1-2016 11:39, Russell King - ARM Linux wrote: > > On Thu, Dec 31, 2015 at 04:50:54PM +0900, Masahiro Yamada wrote: > > > Hi. > > > > > > I am new to the Linux DMA APIs. > > > > > > First, I started by reading Documentation/DMA-API.txt, > > > but I am confused with the term "consistent memory". > > > > Just read "coherent memory" instead - the documentation confusingly > > uses > > the two terms to refer to the same thing. I think there was a > > patch a > > while back to replace "consistent" with "coherent" in this > > document, > > though I'm not sure what happened to it. > > I wrote that patch. I never got any comments on it, so either I > didn't > post it to the right people, or no one really cares: > http://www.kernelhub.org/?msg=747166&p=2 > > I still think that if the kernel methods all have "coherent" in their > name, we should use the word "coherent" in the documentation as well, > and not confuse people even further. So I'd happily repost that > patch. They don't: the PCI API still uses consistent: asm-generic/pci-dma-compat.h:pci_alloc_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:pci_free_consistent(struct pci_dev *hwdev, size_t size, asm-generic/pci-dma-compat.h:static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) linux/pci.h:/* kmem_cache style wrapper around pci_alloc_consistent() */ linux/pci.h:static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) These are named based on the PCI specification. James