[PATCH] test: self: mmu: skip false positive test fail when no RAM at address 0

2023-11-09 Thread Ahmad Fatoum
Testing zero_page_access only makes sense if we actually have RAM at address 0 that we may read from. If it happens to I/O memory, the SoC may hang or a data abort may be raised, which would make the test fail. Avoid this by explicitly checking for that case and skipping the test without running.

[PATCH] test: self: malloc: hide allocation size from compiler

2023-11-09 Thread Ahmad Fatoum
Once we start annotating malloc with __attribute((alloc_size)), GCC will detect that we intentionally buffers that are too big. Avoid the warning by hiding the size using the RELOC_HIDE macro. Signed-off-by: Ahmad Fatoum --- test/self/malloc.c | 8 1 file changed, 4 insertions(+), 4 de

[PATCH] ARM: stm32mp: fix typo in STM32MP135-DK prompt

2023-11-09 Thread Ahmad Fatoum
The board is called STM32MP135 and there is currently no STM32MP137. The typo was likely caused by copy-pasting from the STM32MP15x, which has STM32MP157. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-stm32mp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/ma

[PATCH] console: move ARCH_HAS_CTRLC into Kconfig

2023-11-09 Thread Ahmad Fatoum
We should do away altogether with , so prepare for doing that in the future by moing the only content it has on sandbox into Kconfig. Signed-off-by: Ahmad Fatoum --- Kconfig | 2 +- arch/Kconfig | 13 + arch/sandbox/Kconfig

[PATCH] include: spinlock.h: mark DEFINE_SPINLOCK with __always_unused

2023-11-09 Thread Ahmad Fatoum
The spinlock stubs don't actually do anything with the spinlock_t. To avoid the compiler warning about it add an __always_unused annotation to the spinlock. Signed-off-by: Ahmad Fatoum --- include/linux/spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/

[PATCH v2 2/3] complete: add support for spaces in completions

2023-11-09 Thread Ahmad Fatoum
Drivers have spaces inside their names, which makes tab completion tricky as it restarts for every separate argument. Support for doing this in readline and hush landed in commits 1498093ccd11 ("readline: Complete strings containing whitespaces correctly") and 70e0885229d2 ("hush: Fix handling '\

[PATCH v2 1/3] glob: drop needless ifdeffery in {glob,fnmatch}.h

2023-11-09 Thread Ahmad Fatoum
The implementation of the glob and fnmatch functions is taken from glibc and it shows in the amount of #ifdefs. We don't need that in barebox and can even get the glob_t size down by dropping unused members, so let's do that. Cc: Christian Melki Signed-off-by: Ahmad Fatoum --- v1 -> v2: - new

[PATCH v2 3/3] commands: drvinfo: support filtering by driver

2023-11-09 Thread Ahmad Fatoum
drvinfo can be very long especially for the in-tree defconfigs. Make it more convenient to use by add optional filtering support: barebox@board:/ drvinfo '*imx7d*' Driver Device(s) imx7d-src 3039.reset-control...@3039.of imx7d_adc 306100

[PATCH] include: pm_domain.h: make header self-contained

2023-11-09 Thread Ahmad Fatoum
pm_domain.h so far included no headers and only worked, because it was included in a "correct" order in other files. Fix this by including the header it depends on. Signed-off-by: Ahmad Fatoum --- include/pm_domain.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/pm_domain.h b/in

[PATCH master] phy: stm32-usbphyc: fix unbalanced phy exit

2023-11-09 Thread Ahmad Fatoum
On the STM32MP1, shutting down barebox can result in a ERROR: phy1: phy exit failed --> -22 message printed to the console. This is because the regulator is disabled more often than it was enabled, because stm32_usbphyc_pll_disable is called twice: - Once from stm32_usbphyc_remove calling st

[PATCH] barebox-wrapper: define stub for MODULE_VERSION

2023-11-09 Thread Ahmad Fatoum
We already stub out a number of MODULE_* macros to save porters the hassle of deleting them. Let's add MODULE_VERSION to the list as well. Signed-off-by: Ahmad Fatoum --- include/linux/barebox-wrapper.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/barebox-wrapper.h b/include

[PATCH master] efi: acpi: fix printf format specifier mismatch

2023-11-09 Thread Ahmad Fatoum
entry_count has type size_t and not long as the format string wrongly suggested. Signed-off-by: Ahmad Fatoum --- drivers/bus/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/acpi.c b/drivers/bus/acpi.c index f69789200633..ac034cce4569 100644 --- a/drivers/bu

[PATCH master] mfd: syscon: don't register clocked syscon if geting clock fails

2023-11-09 Thread Ahmad Fatoum
When of_syscon_register is called with check_clk=true, it will attempt to attach the clock. If that fails, the newly allocated syscon is freed, but a dangling pointer remained in the syscon_list. Fix this by only registering the syscon in the successful case. Fixes: b36b7b727192 ("mfd: syscon: cl

[PATCH] usb: dwc2: use linux/spinlock.h for stubs

2023-11-09 Thread Ahmad Fatoum
We already have dummy definitions for common spin lock operations, so reuse them instead of defining them in the driver. Signed-off-by: Ahmad Fatoum --- drivers/usb/dwc2/gadget.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/

[PATCH 2/2] serial: stm32: support probing with missing clock provider

2023-11-09 Thread Ahmad Fatoum
The STM32MP135F-DK support in barebox has bitrotted, because of changes to the upstream device tree: The root of the clock tree is now provided by OP-TEE over SCMI for which no support exists in barebox, so drivers requesting clocks will defer indefinitely, including the console device. A series a

[PATCH 1/2] console: provide best-effort clk_get_for_console helper

2023-11-09 Thread Ahmad Fatoum
From: Ahmad Fatoum clk_get will return -EPROBE_DEFER if clock provider hasn't yet been probed. In a system with deep probe enabled, dependencies are probed on demand, so a -EPROBE_DEFER return is final and the console probe will never succeed. CONFIG_DEBUG_LL is often used to debug this, but bec

[PATCH master] scripts: setlocalversion: sync with Linux

2023-11-09 Thread Ahmad Fatoum
We are using an older version of setlocalversion that sources the config. This is wrong as there's no guarantee that it's ok to source the config, e.g.: CONFIG_DEFAULT_ENVIRONMENT_PATH="$(objtree)/.ptxdist-defaultenv" when sourced will lead to: scripts/setlocalversion: 15: include/config/aut

[PATCH 2/2] malloc: use __attribute((alloc_size)) for dynamic memory allocation

2023-11-09 Thread Ahmad Fatoum
Adorning functions allocating dynamic memory with __alloc_size allows GCC to warn about heap overflows it notices during normal compilation. Import the definitions from Linux and switch over barebox to make use of it. Signed-off-by: Ahmad Fatoum --- include/linux/compiler-gcc.h | 8

[PATCH 1/2] KASan: test_kasan: hide buggy accesses from compiler

2023-11-09 Thread Ahmad Fatoum
Once we add __alloc_size attributes to allocations, GCC will complain about violation of memory safety in test_kasan.c. That memory violation is intended though as test_kasan is meant to trigger kasan at runtime to verify correct operation. Silence the warnings by hiding the origin of ptr, so the

[PATCH master] resource: align memory reservation to page boundaries

2023-11-09 Thread Ahmad Fatoum
barebox remaps all reserved entries as uncached to avoid speculative access into the described regions using remap_range. The ARM implementation requires buffers to be page aligned, which we can't assume unconditionally. For this reason, reserve_sdram_region will align region start and size before