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

Commit 710224fa authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Linus Torvalds
Browse files

arm: fix "arm: fix pci_set_consistent_dma_mask for dmabounce devices"



This fixes the regression caused by the commit 6fee48cd
("dma-mapping: arm: use generic pci_set_dma_mask and
pci_set_consistent_dma_mask").

ARM needs to clip the dma coherent mask for dmabounce devices. This
restores the old trick.

Note that strictly speaking, the DMA API doesn't allow architectures to do
such but I'm not sure it's worth adding the new API to set the dma mask
that allows architectures to clip it.

Reported-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c227e690
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -271,6 +271,14 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
		((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
}

int dma_set_coherent_mask(struct device *dev, u64 mask)
{
	if (mask >= PHYS_OFFSET + SZ_64M - 1)
		return 0;

	return -EIO;
}

int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
{
	it8152_io.start = IT8152_IO_BASE + 0x12000;
+8 −0
Original line number Diff line number Diff line
@@ -503,6 +503,14 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys)
	return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
}

int dma_set_coherent_mask(struct device *dev, u64 mask)
{
	if (mask >= SZ_64M - 1)
		return 0;

	return -EIO;
}

EXPORT_SYMBOL(ixp4xx_pci_read);
EXPORT_SYMBOL(ixp4xx_pci_write);
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
#define PCIBIOS_MAX_MEM		0x4BFFFFFF
#endif

#define ARCH_HAS_DMA_SET_COHERENT_MASK

#define pcibios_assign_all_busses()	1

/* Register locations and bits */
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ extern unsigned long get_clock_tick_rate(void);
#define PCIBIOS_MIN_IO		0
#define PCIBIOS_MIN_MEM		0
#define pcibios_assign_all_busses()	1
#define ARCH_HAS_DMA_SET_COHERENT_MASK
#endif


#endif  /* _ASM_ARCH_HARDWARE_H */
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H

#include <mach/hardware.h>

#define IO_SPACE_LIMIT 0xffffffff

/*
Loading