TencentOS-kernel/arch
Alexey Kardashevskiy 03e5341bcd powerpc/dma: Fix dma_map_ops::get_required_mask
commit 437ef802e0adc9f162a95213a3488e8646e5fc03 upstream.

There are 2 problems with it:
  1. "<" vs expected "<<"
  2. the shift number is an IOMMU page number mask, not an address
  mask as the IOMMU page shift is missing.

This did not hit us before f1565c24b596 ("powerpc: use the generic
dma_ops_bypass mode") because we had additional code to handle bypass
mask so this chunk (almost?) never executed.However there were
reports that aacraid does not work with "iommu=nobypass".

After f1565c24b596, aacraid (and probably others which call
dma_get_required_mask() before setting the mask) was unable to enable
64bit DMA and fall back to using IOMMU which was known not to work,
one of the problems is double free of an IOMMU page.

This fixes DMA for aacraid, both with and without "iommu=nobypass" in
the kernel command line. Verified with "stress-ng -d 4".

Fixes: 6a5c7be5e484 ("powerpc: Override dma_get_required_mask by platform hook and ops")
Cc: stable@vger.kernel.org # v3.2+
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200908015106.79661-1-aik@ozlabs.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 16:36:22 +08:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2021-03-16 16:34:34 +08:00
arc ARC: [plat-hsdk]: Switch ethernet phy-mode to rgmii-id 2021-03-16 16:35:59 +08:00
arm ARM: dts: vfxxx: Add syscon compatible with OCOTP 2021-03-16 16:36:08 +08:00
arm64 arm64: bpf: Fix branch offset in JIT 2021-03-16 16:36:18 +08:00
c6x Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
csky csky: Fixup abiv2 syscall_trace break a4 & a5 2021-03-16 16:28:56 +08:00
h8300 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hexagon hexagon: define ioremap_uc 2021-03-16 16:27:29 +08:00
ia64 kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
m68k kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
microblaze Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mips MIPS: SNI: Fix spurious interrupts 2021-03-16 16:36:18 +08:00
nds32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nios2 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openrisc openrisc: Fix cache API compile issue when not inlining 2021-03-16 16:36:13 +08:00
parisc kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
powerpc powerpc/dma: Fix dma_map_ops::get_required_mask 2021-03-16 16:36:22 +08:00
riscv riscv: Add sfence.vma after early page table changes 2021-03-16 16:36:19 +08:00
s390 s390: don't trace preemption in percpu macros 2021-03-16 16:35:26 +08:00
sh sh: landisk: Add missing initialization of sh_io_port_base 2021-03-16 16:34:22 +08:00
sparc scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2021-03-16 16:31:54 +08:00
um um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/ 2021-03-16 16:27:11 +08:00
unicore32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
x86 x86/boot/compressed: Disable relocation relaxation 2021-03-16 16:36:21 +08:00
xtensa xtensa: fix xtensa_pmu_setup prototype 2021-03-16 16:34:03 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00