Re: kern/60620: Fatal logic inversion in fdtbus_get_u32prop_with_default() breaks usmsc(4) and other FDT drivers
Nick Hudson <[email protected]>
| Newsgroups | gmane.os.netbsd.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 19/08/2026 06:05, [email protected] via gnats wrote: [snip] > A fatal regression was introduced in sys/dev/fdt/fdt_subr.c (revision 1.43) > with the implementation of fdtbus_get_u32prop_with_default(). > The internal logic of of_getprop_uint32() return value checking is inverted: > ---------------------------------------------------------------------- > static int > fdtbus_get_u32prop_with_default(int phandle, const char *prop, int dflt) > { > uint32_t val; > if (of_getprop_uint32(phandle, prop, &val)) { > val = dflt; > } > return val; > } This isn't a bug. Also, $ uname -a NetBSD rpi2 11.99.7 NetBSD 11.99.7 (GENERIC) #0: Sun Aug 16 16:46:12 BST 2026 [email protected]:/Volumes/Work/netbsd/nick-vchiq/obj.evbarmv7hf-el/sys/arch/evbarm/compile/GENERIC evbarm $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper Target: armv7--netbsdelf-eabihf Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=armv7--netbsdelf-eabihf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb1 20250721' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-default-libstdcxx-abi=new --with-isl=/var/obj/mknative/evbarm-earmv7hf/usr/src/tooldir.NetBSD-10.0_STABLE-amd64 --with-mpc-lib=/var/obj/mknative/evbarm-earmv7hf/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/evbarm-earmv7hf/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/evbarm-earmv7hf/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/arm --enable-tls --enable-initfini-array --disable-multilib --disable-libstdcxx-pch --build=armv7--netbsdelf-eabihf --host=armv7--netbsdelf-eabihf --with-sysroot=/var/obj/mknative/evbarm-earmv7hf/usr/src/destdir.evbarm Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.5.0 (nb3 20260326) $ gcc -Wall -o test_fdt test_fdt_subr.c $ ./test_fdt === FDT Regression Test Bench === [Case 1] Property EXISTS (Expected output: 200) - ORIGINAL (Buggy): 200 --> PASS - FIXED (Patch): 200 --> PASS [Case 2] Property DOES NOT EXIST (Expected output: 100) - ORIGINAL (Buggy): 100 --> PASS - FIXED (Patch): 100 --> PASS === Test finished === $ Will check -current shortly