Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e3a6fc4 authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

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: default avatarRoman Kiryanov <rkir@google.com>
parent 6cdd987d
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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);