[PATCH v8 04/16] of/numa: remove a duplicated warning

2016-08-31 Thread Zhen Lei
This warning has been printed in of_numa_parse_cpu_nodes before. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index c1bd62c..625b057 100644 --- a

[PATCH v8 09/16] arm64/numa: support HAVE_SETUP_PER_CPU_AREA

2016-08-31 Thread Zhen Lei
To make each percpu area allocated from its local numa node. Without this patch, all percpu areas will be allocated from the node which cpu0 belongs to. Signed-off-by: Zhen Lei --- arch/arm64/Kconfig | 8 arch/arm64/mm/numa.c | 52

[PATCH v8 13/16] arm64/numa: remove the limitation that cpu0 must bind to node0

2016-08-31 Thread Zhen Lei
1. Remove the old binding code. 2. Read the nid of cpu0 from dts. 3. Fallback the nid of cpu0 to 0 when numa=off is set in bootargs. Signed-off-by: Zhen Lei --- arch/arm64/kernel/smp.c | 1 + arch/arm64/mm/numa.c| 16 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff

[PATCH v8 16/16] arm64/numa: define numa_distance as array to simplify code

2016-08-31 Thread Zhen Lei
ction __node_distance quicker than before. Signed-off-by: Zhen Lei --- arch/arm64/include/asm/numa.h | 1 - arch/arm64/mm/numa.c | 74 +++ 2 files changed, 5 insertions(+), 70 deletions(-) diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/includ

[PATCH v8 15/16] Documentation: remove the constraint on the distances of node pairs

2016-08-31 Thread Zhen Lei
At present, the distances must equal in both direction for each node pairs. For example: the distance of node B->A must the same to A->B. But we really don't have to do this. Signed-off-by: Zhen Lei --- Documentation/devicetree/bindings/numa.txt | 12 1 file changed, 8

[PATCH v8 06/16] of_numa: Use of_get_next_parent to simplify code

2016-09-01 Thread Zhen Lei
From: Kefeng Wang Use of_get_next_parent() instead of open-code. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 625b057..0d7459b 100644 --- a/d

[PATCH v8 12/16] arm64/numa: remove some useless code

2016-09-01 Thread Zhen Lei
When the deleted code is executed, only the bit of cpu0 was set on cpu_possible_mask. So that, only set_cpu_numa_node(0, NUMA_NO_NODE); will be executed. And map_cpu_to_node(0, 0) will soon be called. So these code can be safely removed. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 4

[PATCH v8 14/16] of/numa: remove the constraint on the distances of node pairs

2016-09-01 Thread Zhen Lei
n specified, assign it to the other direction. 3. If none of the two direction specified, both are assigned to REMOTE_DISTANCE. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a

[PATCH v8 05/16] arm64/numa: avoid inconsistent information to be printed

2016-09-01 Thread Zhen Lei
numa_init may return error because of numa configuration error. So "No NUMA configuration found" is inaccurate. In fact, specific configuration error information should be immediately printed by the testing branch. Signed-off-by: Zhen Lei --- arch/arm64/kernel/acpi_numa.c | 4 +++-

[PATCH v8 03/16] of/numa: add nid check for memory block

2016-09-01 Thread Zhen Lei
If the numa-id which was configured in memory@ devicetree node is greater than MAX_NUMNODES, we should report a warning. We have done this for cpus and distance-map dt nodes, this patch help them to be consistent. Signed-off-by: Zhen Lei --- drivers/of/of_numa.c | 5 + 1 file changed, 5

[PATCH v8 07/16] of_numa: Use pr_fmt()

2016-09-01 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 0d7459b..f63d4b0d 10064

[PATCH v8 10/16] mm/memblock: add a new function memblock_alloc_near_nid

2016-09-01 Thread Zhen Lei
If HAVE_MEMORYLESS_NODES is selected, and some memoryless numa nodes are actually exist. The percpu variable areas and numa control blocks of that memoryless numa nodes must be allocated from the nearest available node to improve performance. Signed-off-by: Zhen Lei --- include/linux/memblock.h

[PATCH v8 11/16] arm64/numa: support HAVE_MEMORYLESS_NODES

2016-09-01 Thread Zhen Lei
-by: Zhen Lei --- arch/arm64/Kconfig | 4 arch/arm64/mm/numa.c | 11 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 2815af6..3a2b6ed 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -611,6 +611,10

[PATCH v8 00/16] fix some type infos and bugs for arm64/of numa

2016-09-01 Thread Zhen Lei
So that it looks more clear. 3. Rewrote patch 5 because some scenes were not considered before. Kefeng Wang (3): of_numa: Use of_get_next_parent to simplify code of_numa: Use pr_fmt() arm64: numa: Use pr_fmt() Zhen Lei (13): of/numa: remove a duplicated pr_debug information of/numa: fix

[PATCH v8 08/16] arm64: numa: Use pr_fmt()

2016-09-01 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output, and remove duplicated msg of NUMA turned off. Signed-off-by: Kefeng Wang --- arch/arm64/mm/numa.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/

[PATCH v8 02/16] of/numa: fix a memory@ node can only contains one memory block

2016-09-01 Thread Zhen Lei
For a normal memory@ devicetree node, its reg property can contains more memory blocks. Because we don't known how many memory blocks maybe contained, so we try from index=0, increase 1 until error returned(the end). Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c

[PATCH v8 01/16] of/numa: remove a duplicated pr_debug information

2016-09-01 Thread Zhen Lei
This information will be printed in the subfunction numa_add_memblk. They are not the same, but very similar. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index ed5a097

[PATCH v5 14/14] Documentation: remove the constraint on the distances of node pairs

2016-08-08 Thread Zhen Lei
Update documentation. This limit is unneccessary. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- Documentation/devicetree/bindings/numa.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/numa.txt b/Documentation/devicetree/bindings/numa.txt index

[PATCH v5 01/14] of/numa: remove a duplicated pr_debug information

2016-08-08 Thread Zhen Lei
This information will be printed in the subfunction numa_add_memblk. They are not the same, but very similar. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index ed5a097

[PATCH v5 07/14] of_numa: Use pr_fmt()

2016-08-08 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index ed7bd22..019738f 100644 --

[PATCH v5 05/14] arm64/numa: avoid inconsistent information to be printed

2016-08-08 Thread Zhen Lei
numa_init(of_numa_init) may returned error because of numa configuration error. So "No NUMA configuration found" is inaccurate. In fact, specific configuration error information should be immediately printed by the testing branch. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 6

[PATCH v5 04/14] of/numa: remove a duplicated warning

2016-08-08 Thread Zhen Lei
This warning has been printed in of_numa_parse_cpu_nodes before. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 7b3fbdc..3157130 100644 --- a

[PATCH v5 09/14] arm64/numa: support HAVE_SETUP_PER_CPU_AREA

2016-08-08 Thread Zhen Lei
To make each percpu area allocated from its local numa node. Without this patch, all percpu areas will be allocated from the node which cpu0 belongs to. Signed-off-by: Zhen Lei --- arch/arm64/Kconfig | 8 arch/arm64/mm/numa.c | 56

[PATCH v5 03/14] arm64/numa: add nid check for memory block

2016-08-08 Thread Zhen Lei
Use the same tactic to cpu and numa-distance nodes. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index c7fe3ec..2601660 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -141,6

[PATCH v5 00/14] fix some type infos and bugs for arm64/of numa

2016-08-08 Thread Zhen Lei
s://lkml.org/lkml/2016/5/24/679 2. Rewrote of_numa_parse_memory_nodes according to Rob Herring's advice. So that it looks more clear. 3. Rewrote patch 5 because some scenes were not considered before. Kefeng Wang (3): of_numa: Use of_get_next_parent to simplify code of_numa: Use pr_fmt()

[PATCH v5 10/14] arm64/numa: define numa_distance as array to simplify code

2016-08-08 Thread Zhen Lei
ction __node_distance quicker than before. Signed-off-by: Zhen Lei --- arch/arm64/include/asm/numa.h | 1 - arch/arm64/mm/numa.c | 74 +++ 2 files changed, 5 insertions(+), 70 deletions(-) diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/includ

[PATCH v5 13/14] of/numa: remove the constraint on the distances of node pairs

2016-08-08 Thread Zhen Lei
n specified, assign it to the other direction. 3. If none of the two direction specified, both are assigned to REMOTE_DISTANCE. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a

[PATCH v5 08/14] arm64: numa: Use pr_fmt()

2016-08-08 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output, and remove duplicated msg of NUMA turned off. Signed-off-by: Kefeng Wang --- arch/arm64/mm/numa.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/a

[PATCH v5 06/14] of_numa: Use of_get_next_parent to simplify code

2016-08-08 Thread Zhen Lei
From: Kefeng Wang Use of_get_next_parent() instead of open-code. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 3157130..ed7bd22 100644 --- a/d

[PATCH v5 12/14] arm64/numa: remove some useless code

2016-08-08 Thread Zhen Lei
1. Currently only cpu0 set on cpu_possible_mask and percpu areas have not been initialized. 2. No reason to limit cpu0 must belongs to node0. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm

[PATCH v5 02/14] of/numa: fix a memory@ node can only contains one memory block

2016-08-08 Thread Zhen Lei
For a normal memory@ devicetree node, its reg property can contains more memory blocks. Because we don't known how many memory blocks maybe contained, so we try from index=0, increase 1 until error returned(the end). Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c

[PATCH v5 11/14] arm64/numa: support HAVE_MEMORYLESS_NODES

2016-08-08 Thread Zhen Lei
-by: Zhen Lei --- arch/arm64/Kconfig | 4 arch/arm64/kernel/smp.c | 1 + arch/arm64/mm/numa.c| 43 +-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 05c1bf1..5904a62 100644 --- a

[PATCH v7 09/14] arm64/numa: support HAVE_SETUP_PER_CPU_AREA

2016-08-24 Thread Zhen Lei
To make each percpu area allocated from its local numa node. Without this patch, all percpu areas will be allocated from the node which cpu0 belongs to. Signed-off-by: Zhen Lei --- arch/arm64/Kconfig | 8 arch/arm64/mm/numa.c | 55

[PATCH v7 12/14] arm64/numa: remove the limitation that cpu0 must bind to node0

2016-08-24 Thread Zhen Lei
1. Currently only cpu0 set on cpu_possible_mask and percpu areas have not been initialized. 2. No reason to limit cpu0 must belongs to node0. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm64/mm

[PATCH v7 05/14] arm64/numa: avoid inconsistent information to be printed

2016-08-24 Thread Zhen Lei
numa_init(of_numa_init) may returned error because of numa configuration error. So "No NUMA configuration found" is inaccurate. In fact, specific configuration error information should be immediately printed by the testing branch. Signed-off-by: Zhen Lei --- arch/arm64/mm/numa.c | 6

[PATCH v7 10/14] arm64/numa: define numa_distance as array to simplify code

2016-08-24 Thread Zhen Lei
ction __node_distance quicker than before. Signed-off-by: Zhen Lei --- arch/arm64/include/asm/numa.h | 1 - arch/arm64/mm/numa.c | 74 +++ 2 files changed, 5 insertions(+), 70 deletions(-) diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/includ

[PATCH v7 06/14] of_numa: Use of_get_next_parent to simplify code

2016-08-24 Thread Zhen Lei
From: Kefeng Wang Use of_get_next_parent() instead of open-code. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 8723f64..ed103e6 100644 --- a/d

[PATCH v7 07/14] of_numa: Use pr_fmt()

2016-08-24 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output. Signed-off-by: Kefeng Wang Acked-by: Rob Herring --- drivers/of/of_numa.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index ed103e6..1234b4a 100644

[PATCH v7 08/14] arm64: numa: Use pr_fmt()

2016-08-24 Thread Zhen Lei
From: Kefeng Wang Use pr_fmt to prefix kernel output, and remove duplicated msg of NUMA turned off. Signed-off-by: Kefeng Wang --- arch/arm64/mm/numa.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm

[PATCH v7 13/14] of/numa: remove the constraint on the distances of node pairs

2016-08-24 Thread Zhen Lei
n specified, assign it to the other direction. 3. If none of the two direction specified, both are assigned to REMOTE_DISTANCE. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a

[PATCH v7 14/14] Documentation: remove the constraint on the distances of node pairs

2016-08-24 Thread Zhen Lei
Update documentation. This limit is unneccessary. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- Documentation/devicetree/bindings/numa.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/numa.txt b/Documentation/devicetree/bindings/numa.txt index

[PATCH v7 01/14] of/numa: remove a duplicated pr_debug information

2016-08-24 Thread Zhen Lei
This information will be printed in the subfunction numa_add_memblk. They are not the same, but very similar. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index ed5a097

[PATCH v7 03/14] arm64/numa: add nid check for memory block

2016-08-24 Thread Zhen Lei
Use the same tactic to cpu and numa-distance nodes. Signed-off-by: Zhen Lei --- drivers/of/of_numa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 7b3fbdc..afaeb9c 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -75,6

[PATCH v7 04/14] of/numa: remove a duplicated warning

2016-08-24 Thread Zhen Lei
This warning has been printed in of_numa_parse_cpu_nodes before. Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index afaeb9c..8723f64 100644 --- a

[PATCH v7 11/14] arm64/numa: support HAVE_MEMORYLESS_NODES

2016-08-24 Thread Zhen Lei
-by: Zhen Lei --- arch/arm64/Kconfig | 4 arch/arm64/kernel/smp.c | 1 + arch/arm64/mm/numa.c| 43 +-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 2815af6..3a2b6ed 100644 --- a

[PATCH v7 02/14] of/numa: fix a memory@ node can only contains one memory block

2016-08-24 Thread Zhen Lei
For a normal memory@ devicetree node, its reg property can contains more memory blocks. Because we don't known how many memory blocks maybe contained, so we try from index=0, increase 1 until error returned(the end). Signed-off-by: Zhen Lei Acked-by: Rob Herring --- drivers/of/of_numa.c

[PATCH v7 00/14] fix some type infos and bugs for arm64/of numa

2016-08-24 Thread Zhen Lei
plify code of_numa: Use pr_fmt() arm64: numa: Use pr_fmt() Zhen Lei (11): of/numa: remove a duplicated pr_debug information of/numa: fix a memory@ node can only contains one memory block arm64/numa: add nid check for memory block of/numa: remove a duplicated warning arm64/numa: avoid

[PATCH 1/1] iommu/arm-smmu-v3: replace writel with writel_relaxed in queue_inc_prod

2017-06-20 Thread Zhen Lei
This function is protected by spinlock, and the latter will do memory barrier implicitly. So that we can safely use writel_relaxed. In fact, the dmb operation will lengthen the time protected by lock, which indirectly increase the locking confliction in the stress scene. Signed-off-by: Zhen Lei

[PATCH 1/1] mm: only dispaly online cpus of the numa node

2017-06-20 Thread Zhen Lei
documentation and numactl manual have not described it clear. I sent a mail to ask for help, and Michal Hocko replied that he preferred to print online cpus because it doesn't really make much sense to bind anything on offline nodes. Signed-off-by: Zhen Lei --- drivers/base/node.c | 6

[PATCH 1/1] mm: fix type information of memoryless node

2015-08-29 Thread Zhen Lei
For a memoryless node, the output of get_pfn_range_for_nid are all zero. It will display mem from 0 to -1. Signed-off-by: Zhen Lei --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5b5240b..5839f31 100644 --- a/mm

[PATCH v4 4/5] iommu/arm-smmu: to backward compatible with probe non-deferral

2015-10-15 Thread Zhen Lei
This patch eliminate the strong dependence on Laurent's series(to support probe deferral). That means, no matter whether Laurent's series upstreamed or not, the smmu-v3 driver will always work well. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 20 ++

[PATCH v4 2/5] iommu/arm-smmu: rename __arm_smmu_get_pci_sid

2015-10-15 Thread Zhen Lei
Remove the word "pci", to make this function can also be used by non-pci devices. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 3a54af

[PATCH v4 5/5] iommu/arm-smmu: describe the limitation of #iommu-cells

2015-10-15 Thread Zhen Lei
Only support #iommu-cells = <1>. Signed-off-by: Zhen Lei --- Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt

[PATCH v4 0/5] iommu/arm-smmu: add support for non-pci devices

2015-10-15 Thread Zhen Lei
t probe deferral. patch 7/9 according to Robin Murphy's suggestion, remove global variable arm_smmu_devices, thanks. patch 9/9 add support for a master with multiple stream IDs. Zhen Lei (5): iommu/arm-smmu: to support probe deferral iommu/arm-smmu: rename __arm_smmu_get_pci_sid iommu/

[PATCH v4 3/5] iommu/arm-smmu: add support for non-pci devices

2015-10-15 Thread Zhen Lei
This patch support a master with multiple stream IDs, but doesn't support a master behinds more than one SMMUs. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 40 ++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/iomm

[PATCH v4 1/5] iommu/arm-smmu: to support probe deferral

2015-10-15 Thread Zhen Lei
*/ if (!root->archdata.iommu) return -ENODEV; __arm_smmu_add_pci_device(pdev, root->archdata.iommu); Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 110 +--- 1 file changed, 83 insertions(+), 27 deletions(-) diff --g

[PATCH 1/1] kasan: fix shadow_size calculation error in kasan_module_alloc

2018-06-22 Thread Zhen Lei
virtual address 0f97b000 .. Call trace: [] __asan_storeN+0x174/0x1a8 [] memset+0x24/0x48 [] layout_and_allocate+0xcd8/0x1800 [] load_module+0x190/0x23e8 [] SyS_finit_module+0x148/0x180 Signed-off-by: Zhen Lei --- mm/kasan/kasan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH v5 1/5] iommu/arm-smmu-v3: fix the implementation of flush_iotlb_all hook

2018-08-14 Thread Zhen Lei
.flush_iotlb_all can not just wait for previous tlbi operations to be completed, but should also invalid all TLBs of the related domain. Signed-off-by: Zhen Lei Reviewed-by: Robin Murphy --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH 1/1] uprobe: fix comment of uprobe_apply()

2024-08-20 Thread Zhen Lei
Depending on the argument 'add', uprobe_apply() may be registering or unregistering a probe. The current comment misses the description of the registration. Signed-off-by: Zhen Lei --- kernel/events/uprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ker

[PATCH 0/3] debugobjects: Add hlist_cut_number() and use it to optimize code

2024-09-04 Thread Zhen Lei
Zhen Lei (3): list: add hlist_cut_number() list: test: Add a test for hlist_cut_number() debugobjects: Use hlist_cut_number() to optimize performance and improve readability include/linux/list.h | 44 + lib/debugobjects.c | 115

[PATCH 1/3] list: add hlist_cut_number()

2024-09-04 Thread Zhen Lei
longer split and then spliced into the new list one by one, this also enhances readability. Signed-off-by: Zhen Lei --- include/linux/list.h | 44 1 file changed, 44 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index

[PATCH 2/3] list: test: Add a test for hlist_cut_number()

2024-09-04 Thread Zhen Lei
Test cases cover all possible situations: 1. The cut number is invalid: zero or negative 2. Partially cut. 3. Cut all. 4. The cut number is greater than the number of nodes in the old list. 5. The old list is empty. Signed-off-by: Zhen Lei --- lib/list-test.c | 51

[PATCH 3/3] debugobjects: Use hlist_cut_number() to optimize performance and improve readability

2024-09-04 Thread Zhen Lei
hlist_cut_number() in __free_object(), the result is obviously positive, the check of the return value is omitted. Signed-off-by: Zhen Lei --- lib/debugobjects.c | 115 +++-- 1 file changed, 48 insertions(+), 67 deletions(-) diff --git a/lib/debugobjects.c b/lib

[PATCH 1/1] ide: remove unused local variable 'sitre'

2021-04-07 Thread Zhen Lei
Hulk Robot Signed-off-by: Zhen Lei --- drivers/ide/piix.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c index a671cead6ae72b7..b512d2dc9108cf6 100644 --- a/drivers/ide/piix.c +++ b/drivers/ide/piix.c @@ -143,13 +143,11 @@ static void piix_set_dma_mode(

[PATCH 1/1] agp: remove unused local variable 'current_size'

2021-04-07 Thread Zhen Lei
Fixes the following W=1 kernel build warning: drivers/char/agp/via-agp.c: In function ‘via_configure_agp3’: drivers/char/agp/via-agp.c:131:28: warning: variable ‘current_size’ set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/char/agp

[PATCH 3/3] scsi: mptfusion: Fix error return code of mptctl_hp_hostinfo()

2021-04-07 Thread Zhen Lei
Ensure that all "goto out" error branches return correct error codes. Currently, always returns 0. Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/message/fusion/mptctl.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drive

[PATCH 2/3] scsi: mptfusion: Remove unused local variable 'port'

2021-04-07 Thread Zhen Lei
Fixes the following W=1 kernel build warning: drivers/message/fusion/mptctl.c: In function ‘mptctl_gettargetinfo drivers/message/fusion/mptctl.c:1372:7: warning: variable ‘port’ set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/message

[PATCH 0/3] scsi: mptfusion: Clear the warnings indicating that the variable is not used

2021-04-07 Thread Zhen Lei
:8: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable] 2337 | int retval; |^~ Zhen Lei (3): scsi: mptfusion: Remove unused local variable 'time_count' scsi: mptfusion: Remove unused local variable 'port' scsi: mptfusion: Fix

[PATCH 1/3] scsi: mptfusion: Remove unused local variable 'time_count'

2021-04-07 Thread Zhen Lei
error handling.") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/message/fusion/mptctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index 24aebad60366..0a9321239e76 100644 --- a/drivers/message/fusio

[PATCH 1/1] lib/lzo: remove unused local variable 'level'

2021-04-08 Thread Zhen Lei
Hulk Robot Signed-off-by: Zhen Lei --- lib/decompress_unlzo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c index 1f439a622076c10..64c1358500ce4e9 100644 --- a/lib/decompress_unlzo.c +++ b/lib/decompress_unlzo.c @@ -43,7 +43,6

[PATCH 1/1] irqchip/gicv3-its: remove GITS_BASER_TYPE_CPU base on latest specification

2015-04-02 Thread Zhen Lei
Acutally, "Interrupt Collections" and "Physical Processors" is the same thing. Signed-off-by: Zhen Lei --- drivers/irqchip/irq-gic-v3-its.c | 2 +- include/linux/irqchip/arm-gic-v3.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchi

[PATCH 1/3] irqchip/gicv3-its: Adjust the implementation of its_alloc_tables

2015-04-07 Thread Zhen Lei
irst time, the value of local variable "psz" will drop to 4K, but we have not reinitialize it again in the loop. So, further process 16K read-only "Page Size" will report error. In this patch, detect all the read-only fields first. So that, no need to try over and over again

[PATCH 3/3] irqchip/gicv3-its: treat type reserved as 0x0

2015-04-07 Thread Zhen Lei
1. We don't known how many memory needed by type reserved. It's good to take no care about it. 2. Remove unused macro definition and name of type reserved. Signed-off-by: Zhen Lei --- drivers/irqchip/irq-gic-v3-its.c | 19 +++ include/linux/irqchip/arm-gic-v3.h |

[PATCH 2/3] irqchip/gicv3-its: remove GITS_BASER_TYPE_CPU base on latest spec

2015-04-07 Thread Zhen Lei
In the latest specification(version 24.0), clause 5.12.13 GITS_BASERn. The meaning of value=0x3 in "Type" field was revised to reserved. As below: 0x3. Reserved. In the early versions(like 19.0), it defined as below: 0x3. Physical Processors. Signed-off-by: Zhen Lei --- drivers/irqch

[PATCH 1/1] irqchip/gicv3: remove duplicated parameter testing

2015-03-31 Thread Zhen Lei
Test hardware irq number from small to large, and add a blank above each comment. To make it more clear. Signed-off-by: Zhen Lei --- drivers/irqchip/irq-gic-v3.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip

[PATCH 1/1] iommu/dma: fix trival coding style mistake

2018-05-22 Thread Zhen Lei
No functional changes. Signed-off-by: Zhen Lei --- drivers/iommu/dma-iommu.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index ddcbbdb..4e885f7 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu

[PATCH 1/1] ocfs2: eliminate a misreported warning

2018-04-25 Thread Zhen Lei
1:17: warning: array subscript is below array bounds [-Warray-bounds] hist->fc_chunks[index]++; ^ fs/ocfs2/ioctl.c:411:17: warning: array subscript is below array bounds [-Warray-bounds] Signed-off-by: Zhen Lei --- fs/ocfs2/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH v4 0/2] perf/smmuv3: Don't reserve the PMCG register spaces

2021-01-30 Thread Zhen Lei
sources when the SMMUv3 driver has reserved the conflict resources before. Instead, the PMCG driver only performs devm_ioremap() to ensure that it can work properly. Zhen Lei (2): perf/smmuv3: Don't reserve the PMCG register spaces iommu/arm-smmu-v3: Reserving the entire SMMU register space dr

[PATCH v4 1/2] perf/smmuv3: Don't reserve the PMCG register spaces

2021-01-30 Thread Zhen Lei
register space. When both the SMMU and PMCG drivers reserve their own resources, a resource conflict occurs. To avoid this conflict, don't reserve the PMCG regions. Suggested-by: Robin Murphy Signed-off-by: Zhen Lei --- drivers/perf/arm_smmuv3_pmu.c | 25 +++-- 1 file ch

[PATCH v4 2/2] iommu/arm-smmu-v3: Reserving the entire SMMU register space

2021-01-30 Thread Zhen Lei
ng on SMMU_IDR6.CMDQ_CONTROL_PAGE_LOG2NUMQ. Processing its resource reservation to avoid resource conflict with PMCG is a bit more complicated. Therefore, the resources of the PMCG are not reserved, and the entire SMMU resources are reserved. Signed-off-by: Zhen Lei --- drivers/iommu/arm/arm-smmu-v3/arm

[PATCH v6 0/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller

2021-01-31 Thread Zhen Lei
igned long by adding a middle-tier function. For example: -static void l2c220_inv_range(unsigned long start, unsigned long end) +static void __l2c220_inv_range(unsigned long start, unsigned long end) { ... } +static void l2c220_inv_range(phys_addr_t start, phys_addr_t end) +{ + __l2c220_inv_range(

[PATCH v6 1/4] ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks

2021-01-31 Thread Zhen Lei
Note that the outercache functions have been doing this cast before this patch. So now, the cast is just moved into the outercache hook functions. No functional change. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- arch/arm/include/asm/outercache.h | 6 ++-- arch/arm/mm/cache-feroceo

[PATCH v6 4/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller

2021-01-31 Thread Zhen Lei
range, the upper 30 bits of the physical address are recorded in registers L3_MAINT_START and L3_MAINT_END, and ignore the lower 6 bits cacheline offset. Signed-off-by: Zhen Lei --- arch/arm/mm/Kconfig| 10 ++ arch/arm/mm/Makefile | 1 + arch/arm/mm/cache-kunpeng-l3.c

[PATCH v6 2/4] ARM: hisi: add support for Kunpeng50x SoC

2021-01-31 Thread Zhen Lei
Enable support for the Hisilicon Kunpeng506 and Kunpeng509 SoC. Signed-off-by: Zhen Lei --- arch/arm/mach-hisi/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig index 2e980f834a6aa1b..a004eac24b243af 100644 --- a/arch/arm

[PATCH v6 3/4] dt-bindings: arm: hisilicon: Add binding for Kunpeng L3 cache controller

2021-01-31 Thread Zhen Lei
Add devicetree binding for Hisilicon Kunpeng L3 cache controller. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- .../arm/hisilicon/kunpeng-l3cache.yaml| 40 +++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/hisilicon

[PATCH v5 1/1] perf/smmuv3: Don't reserve the PMCG register spaces

2021-02-01 Thread Zhen Lei
register space. When both the SMMU and PMCG drivers reserve their own resources, a resource conflict occurs. To avoid this conflict, don't reserve the PMCG regions. Suggested-by: Robin Murphy Signed-off-by: Zhen Lei Reviewed-by: Robin Murphy --- drivers/perf/arm_smmuv3_pmu.c

[PATCH v5 0/1] perf/smmuv3: Don't reserve the PMCG register spaces

2021-02-01 Thread Zhen Lei
s: If the PMCG register resources are located in the 64KB Page0 of the SMMU, the PMCG driver does not reserve the conflict resources when the SMMUv3 driver has reserved the conflict resources before. Instead, the PMCG driver only performs devm_ioremap() to ensure that it can work properly. Zhen Lei

[PATCH v7 1/4] ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks

2021-02-01 Thread Zhen Lei
Note that the outercache functions have been doing this cast before this patch. So now, the cast is just moved into the outercache hook functions. No functional change. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- arch/arm/include/asm/outercache.h | 6 ++-- arch/arm/mm/cache-feroceo

[PATCH v7 0/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller

2021-02-01 Thread Zhen Lei
d) +static void __l2c220_inv_range(unsigned long start, unsigned long end) { ... } +static void l2c220_inv_range(phys_addr_t start, phys_addr_t end) +{ + __l2c220_inv_range(start, end); +} Zhen Lei (4): ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks ARM: hisi: add

[PATCH v7 2/4] ARM: hisi: add support for Kunpeng50x SoC

2021-02-01 Thread Zhen Lei
Enable support for the Hisilicon Kunpeng506 and Kunpeng509 SoC. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- arch/arm/mach-hisi/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig index 2e980f834a6aa1b

[PATCH v7 4/4] ARM: Add support for Hisilicon Kunpeng L3 cache controller

2021-02-01 Thread Zhen Lei
range, the upper 30 bits of the physical address are recorded in registers L3_MAINT_START and L3_MAINT_END, and ignore the lower 6 bits cacheline offset. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- arch/arm/mm/Kconfig| 10 ++ arch/arm/mm/Makefile | 1 + arch

[PATCH v7 3/4] dt-bindings: arm: hisilicon: Add binding for Kunpeng L3 cache controller

2021-02-01 Thread Zhen Lei
Add devicetree binding for Hisilicon Kunpeng L3 cache controller. Signed-off-by: Zhen Lei Reviewed-by: Arnd Bergmann --- .../arm/hisilicon/kunpeng-l3cache.yaml| 40 +++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/hisilicon

[PATCH v3 4/7] libnvdimm: reduce an unnecessary if branch in nd_region_create()

2020-08-19 Thread Zhen Lei
comes the same to 1). So the above code snippet can be reduced to one statement: nd_region->flush = ndr_desc->flush; No functional change. Signed-off-by: Zhen Lei --- drivers/nvdimm/region_devs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvd

[PATCH v3 5/7] libnvdimm: reduce an unnecessary if branch in nd_region_activate()

2020-08-19 Thread Zhen Lei
zeof(void *); } Obviously, the above code snippet can be reduced to one statement: flush_data_size += (nvdimm->num_flush + 1) * sizeof(void *); No functional change. Signed-off-by: Zhen Lei --- drivers/nvdimm/region_devs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dr

[PATCH v3 6/7] libnvdimm: make sure EXPORT_SYMBOL_GPL(nvdimm_flush) close to its function

2020-08-19 Thread Zhen Lei
Move EXPORT_SYMBOL_GPL(nvdimm_flush) close to nvdimm_flush(), currently it's near to generic_nvdimm_flush(). Signed-off-by: Zhen Lei --- drivers/nvdimm/region_devs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_d

[PATCH v3 7/7] libnvdimm: slightly simplify available_slots_show()

2020-08-19 Thread Zhen Lei
The type of "nfree" is u32, so "nfree - 1" can only be overflowed when "nfree" is zero. Replace "if (nfree - 1 > nfree)" with "if (nfree == 0)" seems more clear. And remove the assignment "nfree = 0", no need for it. Signed-off-

[PATCH v3 0/7] bugfix and optimize for drivers/nvdimm

2020-08-19 Thread Zhen Lei
;bus_desc.provider_name, because strdup() maybe failed. Patch 3 is a trivial source code optimization. Zhen Lei (7): libnvdimm: fix memory leaks in of_pmem.c libnvdimm: add sanity check for provider_name in of_pmem_region_probe() libnvdimm: simplify walk_to_nvdimm_bus() libnvdimm: redu

[PATCH v3 1/7] libnvdimm: fix memory leaks in of_pmem.c

2020-08-19 Thread Zhen Lei
Currently, in the last error path of of_pmem_region_probe() and in of_pmem_region_remove(), free the memory allocated by kstrdup() is missing. Add kfree(priv->bus_desc.provider_name) to fix it. Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed

[PATCH v3 2/7] libnvdimm: add sanity check for provider_name in of_pmem_region_probe()

2020-08-19 Thread Zhen Lei
kstrdup() may return NULL because of no memory, check it. Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed-off-by: Zhen Lei --- drivers/nvdimm/of_pmem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvdimm/of_pmem.c b/driv

[PATCH v3 3/7] libnvdimm: simplify walk_to_nvdimm_bus()

2020-08-19 Thread Zhen Lei
Return as soon as nvdimm_bus device has been found, make us no need to check "dev" or "!dev" in subsequent code. No functional change. Signed-off-by: Zhen Lei --- drivers/nvdimm/bus.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/nv

  1   2   3   4   5   6   7   >