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>
This commit is contained in:
Roman Kiryanov 2018-06-04 18:25:35 -07:00 committed by Amit Pundir
parent 95948c923c
commit aa6ef14126

View File

@ -1150,6 +1150,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;
@ -1193,14 +1202,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);