[PATCH v4 3/6] iommu: add iommu_default_dma_mode_get() helper

2019-04-07 Thread Zhen Lei
Add IOMMU_DMA_MODE_IS_LAZY() and IOMMU_DMA_MODE_IS_PASSTHROUGH() to make the code looks cleaner. There is no functional change, just prepare for the following patches. Signed-off-by: Zhen Lei --- drivers/iommu/iommu.c | 12 include/linux/iommu.h | 11 +++ 2 files changed

[PATCH v4 0/6] normalize IOMMU dma mode boot options

2019-04-07 Thread Zhen Lei
or example, to enable/disable "passthrough", ARM64 use iommu.passthrough=1/0, X86 use iommu=pt/nopt, PPC/POWERNV use iommu=nobypass. Zhen Lei (6): iommu: use iommu.dma_mode to replace iommu.passthrough and iommu.strict iommu: keep dma mode build options consistent with cmdline

[PATCH v4 4/6] s390/pci: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
s390_iommu=strict can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 7 --- arch/s390/pci/pci_dma.c | 20 +--- drivers/iommu/Kconfig | 1 + 3 files

[PATCH v4 2/6] iommu: keep dma mode build options consistent with cmdline options

2019-04-07 Thread Zhen Lei
First, add build option IOMMU_DMA_MODE_LAZY, so that we have the opportunity to set lazy mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time, the same to the boot options iommu.dma_mode. Signed-off-by: Zhen Lei

[PATCH v4 6/6] x86/iommu: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
be assigned in quirk_calpella_no_shadow_gtt(). Signed-off-by: Zhen Lei --- arch/ia64/include/asm/iommu.h | 2 -- arch/ia64/kernel/pci-dma.c | 2 -- arch/x86/include/asm/iommu.h| 1 - arch/x86/kernel/pci-dma.c | 20 drivers/iommu/Kconfig | 14

[PATCH v4 1/6] iommu: use iommu.dma_mode to replace iommu.passthrough and iommu.strict

2019-04-07 Thread Zhen Lei
about iommu.passthrough and iommu.strict, because thay can not be coexist. Use iommu.dma_mode to replace them will be better. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 33 - drivers/iommu/Kconfig | 4 +-- drivers/iommu

[PATCH v4 5/6] powernv/iommu: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
iommu=nobypass can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 2 -- arch/powerpc/platforms/powernv/pci-ioda.c | 23 +-- drivers/iommu/Kconfig | 1 + 3 files changed

[PATCH v6 1/1] iommu: enhance IOMMU dma mode build options

2019-04-18 Thread Zhen Lei
. Signed-off-by: Zhen Lei --- arch/ia64/kernel/pci-dma.c| 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- arch/s390/pci/pci_dma.c | 2 +- arch/x86/kernel/pci-dma.c | 7 ++--- drivers/iommu/Kconfig | 44

[PATCH v6 0/1] iommu: enhance IOMMU dma mode build options

2019-04-18 Thread Zhen Lei
use iommu.passthrough=1/0, X86 use iommu=pt/nopt, PPC/POWERNV use iommu=nobypass. Zhen Lei (1): iommu: enhance IOMMU dma mode build options arch/ia64/kernel/pci-dma.c| 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- arch/s390/pci/pci_dma.c | 2 +-

[PATCH v8 1/7] iommu: enhance IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
First, add build option IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 42

[PATCH v8 5/7] iommu/vt-d: add support for IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
The default DMA mode of INTEL IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/intel-iommu.c | 2 +- 2 files changed, 2

[PATCH v8 3/7] s390/pci: add support for IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
The default DMA mode is LAZY on s390, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- arch/s390/pci/pci_dma.c | 2 +- drivers/iommu/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 1

[PATCH v8 7/7] ia64: hide build option IOMMU_DEFAULT_PASSTHROUGH

2019-05-29 Thread Zhen Lei
The DMA mode PASSTHROUGH is not used on ia64. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index f6c030433d38048..f7400e35628dce4 100644 --- a/drivers/iommu/Kconfig +++ b

[PATCH v8 4/7] powernv/iommu: add support for IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
The default DMA mode is PASSTHROUGH on powernv, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- drivers/iommu/Kconfig

[PATCH v8 0/7] iommu: enhance IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
lazy(mapping but defer the IOTLB invalidation), strict. But currently each ARCHs defined their private boot options, different with each other. For example, to enable/disable "passthrough", ARM64 use iommu.passthrough=1/0, X86 use iommu=pt/nopt, PPC/POWERNV use iommu=nobypass. Zhen Lei (7):

[PATCH v8 6/7] iommu/amd: add support for IOMMU default DMA mode build options

2019-05-29 Thread Zhen Lei
The default DMA mode of AMD IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/amd_iommu_init.c | 3 ++- 2 files changed, 3

[PATCH v8 2/7] x86/dma: use IS_ENABLED() to simplify the code

2019-05-29 Thread Zhen Lei
This patch removes the ifdefs around CONFIG_IOMMU_DEFAULT_PASSTHROUGH to improve readablity. Signed-off-by: Zhen Lei --- arch/x86/kernel/pci-dma.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index

[PATCH v9 4/7] powernv/iommu: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode is PASSTHROUGH on powernv, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- drivers/iommu/Kconfig

[PATCH v9 6/7] iommu/amd: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode of AMD IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/amd_iommu_init.c | 2 +- 2 files changed, 2

[PATCH v9 0/7] iommu: enhance IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
ed, there are 3 dma modes: paasthrough(bypass), lazy(mapping but defer the IOTLB invalidation), strict. But currently each ARCHs defined their private boot options, different with each other. For example, to enable/disable "passthrough", ARM64 use iommu.passthrough=1/0, X86 use iommu=pt/nopt, PPC/PO

[PATCH v9 5/7] iommu/vt-d: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode of INTEL IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/intel-iommu.c | 2 +- 2 files changed, 2

[PATCH v9 1/7] iommu: enhance IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
First, add build option IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 44

[PATCH v9 2/7] x86/dma: use IS_ENABLED() to simplify the code

2019-06-13 Thread Zhen Lei
Remove the ifdefs around CONFIG_IOMMU_DEFAULT_PASSTHROUGH to improve readablity. Signed-off-by: Zhen Lei --- arch/x86/kernel/pci-dma.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index dcd272dbd0a9330

[PATCH v9 7/7] ia64: hide build option IOMMU_DEFAULT_PASSTHROUGH

2019-06-13 Thread Zhen Lei
The DMA mode PASSTHROUGH is not used on ia64. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 70741fd73b07785..63506f1cad3d149 100644 --- a/drivers/iommu/Kconfig +++ b

[PATCH v9 3/7] s390/pci: add support for IOMMU default DMA mode build options

2019-06-13 Thread Zhen Lei
The default DMA mode is LAZY on s390, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei Acked-by: Sebastian Ott --- arch/s390/pci/pci_dma.c | 2 +- drivers/iommu/Kconfig | 2 ++ 2 files changed

[PATCH v7 1/1] iommu: enhance IOMMU dma mode build options

2019-05-20 Thread Zhen Lei
. Signed-off-by: Zhen Lei --- arch/ia64/kernel/pci-dma.c| 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- arch/s390/pci/pci_dma.c | 2 +- arch/x86/kernel/pci-dma.c | 7 ++--- drivers/iommu/Kconfig | 44

[PATCH v7 0/1] iommu: enhance IOMMU dma mode build options

2019-05-20 Thread Zhen Lei
, to enable/disable "passthrough", ARM64 use iommu.passthrough=1/0, X86 use iommu=pt/nopt, PPC/POWERNV use iommu=nobypass. Zhen Lei (1): iommu: enhance IOMMU dma mode build options arch/ia64/kernel/pci-dma.c| 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3

[PATCH v5 1/6] iommu: add generic boot option iommu.dma_mode

2019-04-09 Thread Zhen Lei
are confused, such as: iommu.passthrough and iommu.strict, because they are no good to be coexist. So add iommu.dma_mode. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 19 drivers/iommu/iommu.c | 59

[PATCH v5 2/6] iommu: add build options corresponding to iommu.dma_mode

2019-04-09 Thread Zhen Lei
-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 6 ++-- drivers/iommu/Kconfig | 43 + drivers/iommu/iommu.c | 4 ++- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Documentation/admin

[PATCH v5 3/6] iommu: add iommu_default_dma_mode_get/set() helper

2019-04-09 Thread Zhen Lei
Also add IOMMU_DMA_MODE_IS_{STRICT|LAZT|PASSTHROUGH}() to make the code looks cleaner. There is no functional change, just prepare for the following patches. Signed-off-by: Zhen Lei --- drivers/iommu/iommu.c | 18 ++ include/linux/iommu.h | 18 ++ 2 files

[PATCH v5 4/6] s390/pci: add support for generic boot option iommu.dma_mode

2019-04-09 Thread Zhen Lei
s390_iommu=strict is equivalent to iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 6 +++--- arch/s390/pci/pci_dma.c | 14 +++--- drivers/iommu/Kconfig | 1 + 3 files changed, 11

[PATCH v5 0/6] add generic boot option for IOMMU dma mode

2019-04-09 Thread Zhen Lei
ERNV use iommu=nobypass. Zhen Lei (6): iommu: add generic boot option iommu.dma_mode iommu: add build options corresponding to iommu.dma_mode iommu: add iommu_default_dma_mode_get/set() helper s390/pci: add support for generic boot option iommu.dma_mode powernv/iommu: add support

[PATCH v5 6/6] x86/iommu: add support for generic boot option iommu.dma_mode

2019-04-09 Thread Zhen Lei
The following equivalence or replacement relationship exists: iommu=pt <--> iommu.dma_mode=passthrough. iommu=nopt can be replaced with iommu.dma_mode=lazy. intel_iommu=strict <--> iommu.dma_mode=strict. amd_iommu=fullflush <--> iommu.dma_mode=strict. Signed-off-by: Zhen Lei

[PATCH v5 5/6] powernv/iommu: add support for generic boot option iommu.dma_mode

2019-04-09 Thread Zhen Lei
iommu=nobypass can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++--- drivers/iommu/Kconfig | 1 + 3 files changed, 4 insertions(+), 4

[PATCH 1/1] ASoC: fsl: remove unnecessary oom message

2021-06-17 Thread Zhen Lei
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei --- sound/soc/fsl/imx-audmix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/fsl/imx-audmix.c b

[PATCH 1/1] ALSA: aoa: remove unnecessary oom message

2021-06-17 Thread Zhen Lei
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei --- sound/aoa/soundbus/i2sbus/pcm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus

[PATCH 1/1] powerpc/pseries/ras: Delete a redundant condition branch

2021-05-10 Thread Zhen Lei
The statement of the last "if (xxx)" branch is the same as the "else" branch. Delete it to simplify code. No functional change. Signed-off-by: Zhen Lei --- arch/powerpc/platforms/pseries/ras.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/platforms/p

[PATCH 1/1] selftests/powerpc: Remove duplicated header file inclusion

2021-05-17 Thread Zhen Lei
The header file is already included above and can be removed here. Signed-off-by: Zhen Lei --- tools/testing/selftests/powerpc/tm/tm-vmx-unavail.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/powerpc/tm/tm-vmx-unavail.c b/tools/testing/selftests/powerpc/tm/tm-vmx

[PATCH 1/1] powerpc/ps3: Fix error return code in ps3_register_devices()

2021-05-18 Thread Zhen Lei
When call ps3_start_probe_thread() failed, further initialization should be stopped and the returned error code should be propagated. Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- arch/powerpc/platforms/ps3/device-init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc

[PATCH 1/1] powerpc/ps3: Remove a couple of unneeded semicolons

2021-05-08 Thread Zhen Lei
The semicolon immediately following '}' is unneeded. Signed-off-by: Zhen Lei --- arch/powerpc/platforms/ps3/system-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index