From: Christoph Hellwig <hch@lst.de>
To: Huacai Chen <chenhc@lemote.com>
Cc: James Hogan <jhogan@kernel.org>, Christoph Hellwig <hch@lst.de>,
Ralf Baechle <ralf@linux-mips.org>,
"Steven J . Hill" <Steven.Hill@cavium.com>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>,
Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
Jayachandran C <jchandra@broadcom.com>
Subject: Re: [PATCH 2/2] MIPS: Loongson64: Add cache_sync to loongson_dma_map_ops
Date: Fri, 26 Jan 2018 08:56:12 +0100 [thread overview]
Message-ID: <20180126075612.GD2356@lst.de> (raw)
In-Reply-To: <CAAhV-H7i8PZtn7JMgzCW3nseH-rwtcc_H6_9n+pOE4DU5i1KAg@mail.gmail.com>
On Thu, Jan 25, 2018 at 04:44:36PM +0800, Huacai Chen wrote:
> Yes, kmalloc()'d memory with the appropriate GFP_DMA flags can be
You should never use GFP_DMA in kmalloc calls in new code.
> synced using the dma_map_*() and dma_unmap_*() functions. So,
> loongson_dma_map_page()/loongson_dma_unmap_page() (which is the
> backend of dma_map_*() and dma_unmap_*()) should call dma_cache_sync()
> for non-coherent devices, right?
No, it should call the internal dma sync for device/cpu calls, as already
explained by James. Note that for 4.17 or 4.18 I plan to extent
the dma-direct work to not dma coherent systems, so we'll get an
explicit and document ABI for those across platforms. That is if
I can pull it off as it doesn't seem entirely trivial.
prev parent reply other threads:[~2018-01-26 7:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 8:35 [PATCH 2/2] MIPS: Loongson64: Add cache_sync to loongson_dma_map_ops Huacai Chen
2018-01-24 14:02 ` James Hogan
2018-01-24 14:11 ` Christoph Hellwig
2018-01-24 15:03 ` James Hogan
2018-01-24 15:29 ` Christoph Hellwig
2018-01-25 7:09 ` Huacai Chen
2018-01-25 7:55 ` James Hogan
2018-01-25 8:44 ` Huacai Chen
2018-01-25 10:54 ` James Hogan
2018-01-25 11:04 ` Huacai Chen
2018-01-25 12:31 ` James Hogan
2018-01-26 7:56 ` Christoph Hellwig [this message]
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=20180126075612.GD2356@lst.de \
--to=hch@lst.de \
--cc=Steven.Hill@cavium.com \
--cc=chenhc@lemote.com \
--cc=jchandra@broadcom.com \
--cc=jhogan@kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox