diff options
author | Miodrag Dinic <miodrag.dinic@imgtec.com> | 2017-08-29 16:53:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-31 19:58:45 +0300 |
commit | 7157d2be23da9f8860c69e2b79184a4e02701dad (patch) | |
tree | 2f51051b9f35a0c14ab95cb67cd29ab3b942868c /drivers/tty/pty.c | |
parent | 2296eee704e70dac7fef8ac13f2716e4896dd13e (diff) | |
download | linux-7157d2be23da9f8860c69e2b79184a4e02701dad.tar.xz |
tty: goldfish: Use streaming DMA for r/w operations on Ranchu platforms
Implement tty r/w operations using streaming DMA.
Goldfish tty for Ranchu platforms has been modified to use
streaming DMA mappings for read/write operations. This change
eliminates the need for snooping through the TLB in QEMU using
cpu_get_phys_page_debug() which does not guarantee that it will
return the valid va -> pa mapping.
The streaming DMA mapping is implemented using dma_map_single() per
transfer, while dma_unmap_single() is used for unmapping right after
the DMA transfer.
Using DMA API is the proper way for handling r/w transfers and
makes this driver more portable, thus effectively eliminating
the need for virt_to_page() and page_to_phys() conversions.
This change does not affect the old style Goldfish tty behaviour
which is still used by the Goldfish emulator. Version register has
been added and probed to see which platform is running this driver.
Reading from the new register GOLDFISH_TTY_REG_VERSION using the
Goldfish emulator will return 0 and driver will work with virtual
addresses. Whereas if run on Ranchu it returns 1, and thus DMA is
used.
(Goldfish and Ranchu are code names for the first and the second
generation of virtual boards used by Android emulator.)
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/pty.c')
0 files changed, 0 insertions, 0 deletions