[PATCH 04/13] MIPS: consolidate mem_init() for NUMA machines

2025-03-08 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" 

Both MIPS systems that support numa (loongsoon3 and sgi-ip27) have
identical mem_init() for NUMA case.

Move that into arch/mips/mm/init.c and drop duplicate per-machine
definitions.

Signed-off-by: Mike Rapoport (Microsoft) 
---
 arch/mips/loongson64/numa.c  | 7 ---
 arch/mips/mm/init.c  | 7 +++
 arch/mips/sgi-ip27/ip27-memory.c | 9 -
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
index 8388400d052f..95d5f553ce19 100644
--- a/arch/mips/loongson64/numa.c
+++ b/arch/mips/loongson64/numa.c
@@ -164,13 +164,6 @@ void __init paging_init(void)
free_area_init(zones_size);
 }
 
-void __init mem_init(void)
-{
-   high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
-   memblock_free_all();
-   setup_zero_pages(); /* This comes from node 0 */
-}
-
 /* All PCI device belongs to logical Node-0 */
 int pcibus_to_node(struct pci_bus *bus)
 {
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 4583d1a2a73e..3db6082c611e 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -482,6 +482,13 @@ void __init mem_init(void)
0x8000 - 4, KCORE_TEXT);
 #endif
 }
+#else  /* CONFIG_NUMA */
+void __init mem_init(void)
+{
+   high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
+   memblock_free_all();
+   setup_zero_pages(); /* This comes from node 0 */
+}
 #endif /* !CONFIG_NUMA */
 
 void free_init_pages(const char *what, unsigned long begin, unsigned long end)
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index 1963313f55d8..2b3e46e2e607 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -406,8 +406,6 @@ void __init prom_meminit(void)
}
 }
 
-extern void setup_zero_pages(void);
-
 void __init paging_init(void)
 {
unsigned long zones_size[MAX_NR_ZONES] = {0, };
@@ -416,10 +414,3 @@ void __init paging_init(void)
zones_size[ZONE_NORMAL] = max_low_pfn;
free_area_init(zones_size);
 }
-
-void __init mem_init(void)
-{
-   high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
-   memblock_free_all();
-   setup_zero_pages(); /* This comes from node 0 */
-}
-- 
2.47.2




[powerpc:next-test] BUILD SUCCESS ff99d5b6a246715f2257123cdf6c4a29cb33aa78

2025-03-08 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
next-test
branch HEAD: ff99d5b6a246715f2257123cdf6c4a29cb33aa78  powerpc/perf: Fix 
ref-counting on the PMU 'vpa_pmu'

elapsed time: 1451m

configs tested: 79
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alphaallyesconfiggcc-14.2.0
arc  allmodconfiggcc-13.2.0
arc  allyesconfiggcc-13.2.0
arc   randconfig-001-20250308gcc-13.2.0
arc   randconfig-002-20250308gcc-13.2.0
arm  allmodconfiggcc-14.2.0
arm   randconfig-001-20250308gcc-14.2.0
arm   randconfig-002-20250308gcc-14.2.0
arm   randconfig-003-20250308gcc-14.2.0
arm   randconfig-004-20250308gcc-14.2.0
arm64 randconfig-001-20250308gcc-14.2.0
arm64 randconfig-002-20250308gcc-14.2.0
arm64 randconfig-003-20250308clang-16
arm64 randconfig-004-20250308gcc-14.2.0
csky  randconfig-001-20250308gcc-14.2.0
csky  randconfig-002-20250308gcc-14.2.0
hexagon  allmodconfigclang-21
hexagon  allyesconfigclang-18
hexagon   randconfig-001-20250308clang-19
hexagon   randconfig-002-20250308clang-21
i386  allnoconfiggcc-12
i386buildonly-randconfig-001-20250308gcc-12
i386buildonly-randconfig-002-20250308gcc-11
i386buildonly-randconfig-003-20250308clang-19
i386buildonly-randconfig-004-20250308clang-19
i386buildonly-randconfig-005-20250308clang-19
i386buildonly-randconfig-006-20250308gcc-12
loongarch randconfig-001-20250308gcc-14.2.0
loongarch randconfig-002-20250308gcc-14.2.0
m68k  allnoconfiggcc-14.2.0
microblazeallnoconfiggcc-14.2.0
mips  allnoconfiggcc-14.2.0
nios2 allnoconfiggcc-14.2.0
nios2 randconfig-001-20250308gcc-14.2.0
nios2 randconfig-002-20250308gcc-14.2.0
openrisc  allnoconfiggcc-14.2.0
pariscallnoconfiggcc-14.2.0
pariscrandconfig-001-20250308gcc-14.2.0
pariscrandconfig-002-20250308gcc-14.2.0
powerpc   allnoconfiggcc-14.2.0
powerpc   randconfig-001-20250308clang-18
powerpc   randconfig-002-20250308gcc-14.2.0
powerpc   randconfig-003-20250308gcc-14.2.0
powerpc64 randconfig-001-20250308gcc-14.2.0
powerpc64 randconfig-002-20250308gcc-14.2.0
powerpc64 randconfig-003-20250308clang-21
riscv allnoconfiggcc-14.2.0
riscv randconfig-001-20250308clang-21
riscv randconfig-002-20250308gcc-14.2.0
s390 allmodconfigclang-19
s390  allnoconfigclang-15
s390 allyesconfiggcc-14.2.0
s390  randconfig-001-20250308clang-19
s390  randconfig-002-20250308clang-17
sh   allmodconfiggcc-14.2.0
shallnoconfiggcc-14.2.0
sh   allyesconfiggcc-14.2.0
shrandconfig-001-20250308gcc-14.2.0
shrandconfig-002-20250308gcc-14.2.0
sparcallmodconfiggcc-14.2.0
sparc allnoconfiggcc-14.2.0
sparc randconfig-001-20250308gcc-14.2.0
sparc randconfig-002-20250308gcc-14.2.0
sparc64   randconfig-001-20250308gcc-14.2.0
sparc64   randconfig-002-20250308gcc-14.2.0
umallnoconfigclang-18
umrandconfig-001-20250308gcc-12
umrandconfig-002-20250308gcc-12
x86_64allnoconfigclang-19
x86_64  buildonly-randconfig-001-20250308gcc-12
x86_64  buildonly-randconfig-002-20250308clang-19
x86_64  buildonly-randconfig-003-20250308gcc-12
x86_64  buildonly-randconfig-004-20250308clang-19
x86_64  buildonly-randconfig-005-20250308clang-19
x86_64  buildonly-randconfig-006-20250308clang-19
x86_64  defconfiggcc-11
xtensaallnoconfiggcc-14.2.0
xtensarandconfig-001-20250308gcc-14.

Re: [PATCH v5 1/3] printf: convert self-test to KUnit

2025-03-08 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 10:55 AM Petr Mladek  wrote:
>
> Honestly, I am not able to find how the KUNIT_FAIL() actually prints
> the message. I can't find how assert_format() is defined.

KUNIT_FAIL -> KUNIT_FAIL_ASSERTION -> _KUNIT_FAILED ->
__kunit_do_failed_assertion -> kunit_fail -> kunit_print_string_stream
-> kunit_err(test, "%s", buf);

So I agree that the trailing newline is just as necessary here as in
any other printk.



Re: [PATCH v6 0/3] printf: convert self-test to KUnit

2025-03-08 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 11:49 PM Kees Cook  wrote:
>
> On Fri, Mar 07, 2025 at 05:08:55PM -0500, Tamir Duberstein wrote:
> > This is one of just 3 remaining "Test Module" kselftests (the others
> > being bitmap and scanf), the rest having been converted to KUnit.
> >
> > I tested this using:
> >
> > $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf
> >
> > I have also sent out a series converting scanf[0].
> >
> > Link: 
> > https://lore.kernel.org/all/20250204-scanf-kunit-convert-v3-0-386d7c3ee...@gmail.com/T/#u
> >  [0]
> >
> > Signed-off-by: Tamir Duberstein 
> > ---
> > Changes in v6:
> > - Use __printf correctly on `__test`. (Petr Mladek)
> > - Rebase on linux-next.
>
> Thanks for doing this!
>
> If Petr, Rasmus, Andy, and/or others Ack this I can carry it in my
> "lib/ kunit tests move to lib/tests/" tree, as that's where all the
> infrastructure in lib/tests/ exists.

I think the plan is to take it through the printk tree. We're still
working on it, here's v6:
https://lore.kernel.org/all/20250307-printf-kunit-convert-v6-0-4d85c361c...@gmail.com/
where I've rebased and put the test in lib/tests.



Re: [PATCH v3 2/3] dt-bindings: nand: Add fsl,elbc-fcm-nand

2025-03-08 Thread J . Neuschäfer
Miquel, what do you think about Rob's suggestion below?

On Mon, Mar 03, 2025 at 08:00:21AM -0600, Rob Herring wrote:
> On Wed, Feb 26, 2025 at 12:45:17PM -0600, Rob Herring (Arm) wrote:
> > 
> > On Wed, 26 Feb 2025 18:01:41 +0100, J. Neuschäfer wrote:
> > > Formalize the binding already supported by the fsl_elbc_nand.c driver
> > > and used in several device trees in arch/powerpc/boot/dts/.
> > > 
> > > raw-nand-chip.yaml is referenced in order to accommodate situations in
> > > which the ECC parameters settings are set in the device tree. One such
> > > example is in arch/powerpc/boot/dts/turris1x.dts:
> > > 
> > >   /* MT29F2G08ABAEAWP:E NAND */
> > >   nand@1,0 {
> > >   compatible = "fsl,p2020-fcm-nand", "fsl,elbc-fcm-nand";
> > >   reg = <0x1 0x0 0x0004>;
> > >   nand-ecc-mode = "soft";
> > >   nand-ecc-algo = "bch";
> > > 
> > >   partitions { ... };
> > >   };
> > > 
> > > Reviewed-by: Frank Li 
> > > Signed-off-by: J. Neuschäfer 
> > > ---
> > > 
> > > V3:
> > > - remove unnecessary #address/size-cells from nand node in example
> > > - add Frank Li's review tag
> > > - add missing end of document marker (...)
> > > - explain choice to reference raw-nand-chip.yaml
> > > 
> > > V2:
> > > - split out from fsl,elbc binding patch
> > > - constrain #address-cells and #size-cells
> > > - add a general description
> > > - use unevaluatedProperties=false instead of additionalProperties=false
> > > - fix property order to comply with dts coding style
> > > - include raw-nand-chip.yaml instead of nand-chip.yaml
> > > ---
> > >  .../devicetree/bindings/mtd/fsl,elbc-fcm-nand.yaml | 68 
> > > ++
> > >  1 file changed, 68 insertions(+)
> > > 
> > 
> > My bot found errors running 'make dt_binding_check' on your patch:
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/fsl,elbc-fcm-nand.example.dtb:
> >  nand@1,0: $nodename:0: 'nand@1,0' does not match '^nand@[a-f0-9]$'
> > from schema $id: 
> > http://devicetree.org/schemas/mtd/fsl,elbc-fcm-nand.yaml#
> 
> Drop the unit address in raw-nand-chip.yaml. So: 
> 
> properties:
>   $nodename:
> pattern: "^nand@"
> 

^^^



Best Regards,
J. Neuschäfer



[PATCH v4] dt-bindings: dma: Convert fsl,elo*-dma to YAML

2025-03-08 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" 

The devicetree bindings for Freescale DMA engines have so far existed as
a text file. This patch converts them to YAML, and specifies all the
compatible strings currently in use in arch/powerpc/boot/dts.

Signed-off-by: J. Neuschäfer 
---
I considered referencing dma-controller.yaml, but that requires
the #dma-cells property (via dma-common.yaml), and I'm now sure which
value it should have, if any. Therefore I did not reference
dma-controller.yaml.

V4:
- switch DMA controller node name (in examples) back to dma@ because the
  dma-controller.yaml binding is not used.

V3:
- Link: 
https://lore.kernel.org/r/20250226-ppcyaml-dma-v3-1-79ce31335...@posteo.net
- split out as a single patch
- restructure "description" definitions to use "items:" as much as possible
- remove useless description of interrupts in fsl,elo3-dma
- rename DMA controller nodes to dma-controller@...
- use IRQ_TYPE_* constants in examples
- define unit address format for DMA channel nodes
- drop interrupts-parent properties from examples

V2:
- part of series [PATCH v2 00/12] YAML conversion of several Freescale/PowerPC 
DT bindings
  Link: 
https://lore.kernel.org/lkml/20250207-ppcyaml-v2-5-8137b0c42...@posteo.net/
- remove unnecessary multiline markers
- fix additionalProperties to always be false
- add description/maxItems to interrupts
- add missing #address-cells/#size-cells properties
- convert "Note on DMA channel compatible properties" to YAML by listing
  fsl,ssi-dma-channel as a valid compatible value
- fix property ordering in examples: compatible and reg come first
- add missing newlines in examples
- trim subject line (remove "bindings")
---
 .../devicetree/bindings/dma/fsl,elo-dma.yaml   | 137 ++
 .../devicetree/bindings/dma/fsl,elo3-dma.yaml  | 125 +
 .../devicetree/bindings/dma/fsl,eloplus-dma.yaml   | 132 +
 .../devicetree/bindings/powerpc/fsl/dma.txt| 204 -
 4 files changed, 394 insertions(+), 204 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/fsl,elo-dma.yaml 
b/Documentation/devicetree/bindings/dma/fsl,elo-dma.yaml
new file mode 100644
index 
..92288d76d51be639ac9ca5264e5fa056e418e4d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/fsl,elo-dma.yaml
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/fsl,elo-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Elo DMA Controller
+
+maintainers:
+  - J. Neuschäfer 
+
+description:
+  This is a little-endian 4-channel DMA controller, used in Freescale mpc83xx
+  series chips such as mpc8315, mpc8349, mpc8379 etc.
+
+properties:
+  compatible:
+items:
+  - enum:
+  - fsl,mpc8313-dma
+  - fsl,mpc8315-dma
+  - fsl,mpc8323-dma
+  - fsl,mpc8347-dma
+  - fsl,mpc8349-dma
+  - fsl,mpc8360-dma
+  - fsl,mpc8377-dma
+  - fsl,mpc8378-dma
+  - fsl,mpc8379-dma
+  - const: fsl,elo-dma
+
+  reg:
+items:
+  - description:
+  DMA General Status Register, i.e. DGSR which contains status for
+  all the 4 DMA channels.
+
+  cell-index:
+$ref: /schemas/types.yaml#/definitions/uint32
+description: Controller index. 0 for controller @ 0x8100.
+
+  ranges: true
+
+  "#address-cells":
+const: 1
+
+  "#size-cells":
+const: 1
+
+  interrupts:
+maxItems: 1
+description: Controller interrupt.
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  "^dma-channel@[0-9a-f]+$":
+type: object
+additionalProperties: false
+
+properties:
+  compatible:
+oneOf:
+  # native DMA channel
+  - items:
+  - enum:
+  - fsl,mpc8315-dma-channel
+  - fsl,mpc8323-dma-channel
+  - fsl,mpc8347-dma-channel
+  - fsl,mpc8349-dma-channel
+  - fsl,mpc8360-dma-channel
+  - fsl,mpc8377-dma-channel
+  - fsl,mpc8378-dma-channel
+  - fsl,mpc8379-dma-channel
+  - const: fsl,elo-dma-channel
+
+  # audio DMA channel, see fsl,ssi.yaml
+  - const: fsl,ssi-dma-channel
+
+  reg:
+maxItems: 1
+
+  cell-index:
+description: DMA channel index starts at 0.
+
+  interrupts:
+maxItems: 1
+description:
+  Per-channel interrupt. Only necessary if no controller interrupt has
+  been provided.
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+
+dma@82a8 {
+compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
+reg = <0x82a8 4>;
+#address-cells = <1>;
+#size-cells = <1>;
+ranges = <0 0x8100 0x1a4>;
+interrupts = <71 IRQ_TYPE_LEVEL_LOW>;
+cell-index = <0>;
+
+dma-channel@0 {
+compatible = 

Re: [PATCH] powerpc/boot: Fix build with gcc 15

2025-03-08 Thread Nysal Jan K.A.
On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> Similar to x86 the ppc boot code does not build with GCC 15.
> 
> Copy the fix from
> commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> 
> Signed-off-by: Michal Suchanek 
> ---
>  arch/powerpc/boot/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 1ff6ad4f6cd2..e6b35699c049 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -33,6 +33,7 @@ else
>  endif
>  
>  ifdef CONFIG_PPC64_BOOT_WRAPPER
> +BOOTTARGETFLAGS  += -std=gnu11
>  BOOTTARGETFLAGS  += -m64
>  BOOTTARGETFLAGS  += -mabi=elfv2
>  ifdef CONFIG_PPC64_ELF_ABI_V2
> -- 
> 2.47.1
> 
> 

Reviewed-by: Nysal Jan K.A. 



Re: [PATCH v6 0/3] printf: convert self-test to KUnit

2025-03-08 Thread Tamir Duberstein
On Sat, Mar 8, 2025 at 7:51 AM Tamir Duberstein  wrote:
>
> On Fri, Mar 7, 2025 at 11:49 PM Kees Cook  wrote:
> >
> > On Fri, Mar 07, 2025 at 05:08:55PM -0500, Tamir Duberstein wrote:
> > > This is one of just 3 remaining "Test Module" kselftests (the others
> > > being bitmap and scanf), the rest having been converted to KUnit.
> > >
> > > I tested this using:
> > >
> > > $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 
> > > printf
> > >
> > > I have also sent out a series converting scanf[0].
> > >
> > > Link: 
> > > https://lore.kernel.org/all/20250204-scanf-kunit-convert-v3-0-386d7c3ee...@gmail.com/T/#u
> > >  [0]
> > >
> > > Signed-off-by: Tamir Duberstein 
> > > ---
> > > Changes in v6:
> > > - Use __printf correctly on `__test`. (Petr Mladek)
> > > - Rebase on linux-next.
> >
> > Thanks for doing this!
> >
> > If Petr, Rasmus, Andy, and/or others Ack this I can carry it in my
> > "lib/ kunit tests move to lib/tests/" tree, as that's where all the
> > infrastructure in lib/tests/ exists.
>
> I think the plan is to take it through the printk tree. We're still
> working on it, here's v6:
> https://lore.kernel.org/all/20250307-printf-kunit-convert-v6-0-4d85c361c...@gmail.com/
> where I've rebased and put the test in lib/tests.

Whoops, this is already the v6 thread! Does the layout here look correct to you?