tmp_suning_uos_patched/arch
Alexey Kardashevskiy 87990a60b4 powerpc/iommu: Report the correct most efficient DMA mask for PCI devices
[ Upstream commit 23c216b335d1fbd716076e8263b54a714ea3cf0e ]

According to dma-api.rst, the dma_get_required_mask() helper should return
"the mask that the platform requires to operate efficiently". Which in
the case of PPC64 means the bypass mask and not a mask from an IOMMU table
which is shorter and slower to use due to map/unmap operations (especially
expensive on "pseries").

However the existing implementation ignores the possibility of bypassing
and returns the IOMMU table mask on the pseries platform which makes some
drivers (mpt3sas is one example) choose 32bit DMA even though bypass is
supported. The powernv platform sort of handles it by having a bigger
default window with a mask >=40 but it only works as drivers choose
63/64bit if the required mask is >32 which is rather pointless.

This reintroduces the bypass capability check to let drivers make
a better choice of the DMA mask.

Fixes: f1565c24b5 ("powerpc: use the generic dma_ops_bypass mode")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210930034454.95794-1-aik@ozlabs.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-10-13 10:04:29 +02:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:11:07 +02:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:28:04 +02:00
arm bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 2021-10-13 10:04:28 +02:00
arm64 arm64: dts: ls1028a: add missing CAN nodes 2021-10-13 10:04:27 +02:00
c6x arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
csky csky: syscache: Fixup duplicate cache flush 2021-07-14 16:56:52 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:05:53 +02:00
ia64 mm/page_alloc: fix memory map initialization for descending nodes 2021-07-25 14:36:18 +02:00
m68k m68k: Double cast io functions to unsigned long 2021-09-30 10:11:06 +02:00
microblaze local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
mips bpf, mips: Validate conditional branch offsets 2021-10-06 15:55:51 +02:00
nds32 nds32: fix up stack guard gap 2021-07-28 14:35:46 +02:00
nios2 nios2: fixed broken sys_clone syscall 2021-03-04 11:38:16 +01:00
openrisc openrisc: don't printk() unconditionally 2021-09-18 13:40:13 +02:00
parisc parisc: Use absolute_pointer() to define PAGE0 2021-09-30 10:11:07 +02:00
powerpc powerpc/iommu: Report the correct most efficient DMA mask for PCI devices 2021-10-13 10:04:29 +02:00
riscv riscv: Flush current cpu icache before other cpus 2021-10-13 10:04:24 +02:00
s390 s390/pci_mmio: fully validate the VMA before calling follow_pte() 2021-09-26 14:08:55 +02:00
sh sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:40:56 +02:00
um um: virtio_uml: fix memory leak on init failures 2021-09-26 14:08:57 +02:00
x86 perf/x86: Reset destroy callback on event init failure 2021-10-09 14:40:58 +02:00
xtensa xtensa: call irqchip_init only when CONFIG_USE_OF is selected 2021-10-13 10:04:26 +02:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2021-01-17 14:16:59 +01:00