summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2018-06-04 18:25:35 -0700
committerRoman Kiryanov <rkir@google.com>2018-06-05 09:42:36 -0700
commit7e3a6fc483350235bf3446492133d60c292d487c (patch)
tree1bdfebf2b8e7c6ec1a2051067ed8776b82c161d6 /drivers/platform
parent6cdd987da8a5b293d83e4cd8b168ad1e3b7bc0a7 (diff)
goldfish: pipe: ANDROID: address must be written as __pa(x), not x
The previous change missed the __pa transformation applied to the address before passing it further. The value also has to be written from the high part first. Bug: 72717639 Change-Id: Id0756ca733f26ced1d74179764116db05ec47bea Signed-off-by: Roman Kiryanov <rkir@google.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/goldfish/goldfish_pipe_v2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/platform/goldfish/goldfish_pipe_v2.c b/drivers/platform/goldfish/goldfish_pipe_v2.c
index a904e66c6641..f0b9b46047be 100644
--- a/drivers/platform/goldfish/goldfish_pipe_v2.c
+++ b/drivers/platform/goldfish/goldfish_pipe_v2.c
@@ -1153,6 +1153,15 @@ static struct miscdevice goldfish_pipe_miscdev = {
.fops = &goldfish_pipe_fops,
};
+
+static void write_pa_addr(void *addr, void __iomem *portl, void __iomem *porth)
+{
+ const unsigned long paddr = __pa(addr);
+
+ writel(paddr >> 32, porth);
+ writel((u32)paddr, portl);
+}
+
static int goldfish_pipe_device_init_v2(struct platform_device *pdev)
{
struct goldfish_pipe_dev *dev = &goldfish_pipe_dev;
@@ -1196,14 +1205,14 @@ static int goldfish_pipe_device_init_v2(struct platform_device *pdev)
dev->buffers = (struct goldfish_pipe_dev_buffers *)page;
/* Send the buffer addresses to the host */
- gf_write_ptr(&dev->buffers->signalled_pipe_buffers,
+ write_pa_addr(&dev->buffers->signalled_pipe_buffers,
dev->base + PIPE_REG_SIGNAL_BUFFER,
dev->base + PIPE_REG_SIGNAL_BUFFER_HIGH);
writel((u32)MAX_SIGNALLED_PIPES,
dev->base + PIPE_REG_SIGNAL_BUFFER_COUNT);
- gf_write_ptr(&dev->buffers->open_command_params,
+ write_pa_addr(&dev->buffers->open_command_params,
dev->base + PIPE_REG_OPEN_BUFFER,
dev->base + PIPE_REG_OPEN_BUFFER_HIGH);