CV-Bowen opened a new pull request, #22551:
URL: https://github.com/apache/nuttx/pull/22551

   ## Summary
   
   In BMP mode all CPUs run the same image, so `noterpmsg_server_init()`
   registers the rpmsg note server channel on every CPU, while the server
   should run only on the note aggregation core.
   
   Add `CONFIG_DRIVERS_NOTERPMSG_SERVER_CPUID` (depends on
   `DRIVERS_NOTERPMSG_SERVER && BMP`), the same way
   `CONFIG_SYSLOG_RPMSG_SERVER_CPUID` (#22341) gates the syslog rpmsg server:
   when it is set, only that CPU registers the server.
   
   ## Impact
   
   New Kconfig option, visible only with `CONFIG_BMP`. Unset (the default),
   every CPU initializes the server as before. Without BMP nothing changes.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   **BMP on (compile only).** qemu-armv8a:rpserver and qemu-armv8a:rpproxy
   with `CONFIG_BMP=y`, `CONFIG_PERCPU_SECTION=y`, `CONFIG_SMP_NCPUS=2`,
   `CONFIG_DRIVERS_NOTERPMSG_SERVER=y` and
   `CONFIG_DRIVERS_NOTERPMSG_SERVER_CPUID=0`: `noterpmsg_server.c` compiles
   with no error or warning and references `sched_getcpu()`. As for #22341,
   no BMP image can be linked on current master (no in-tree linker script
   places `.data..percpu`).
   
   The only other error in that build is in `drivers/note/note_driver.c`
   (`'note_common' defined but not used`), and it is the same on master:
   `DRIVERS_NOTERPMSG_SERVER` selects `DRIVERS_NOTE`, and without
   `SCHED_INSTRUMENTATION` nothing calls `note_common()`. With BMP off it is
   a warning (sim:rpserver + `CONFIG_DRIVERS_NOTERPMSG_SERVER=y`, master and
   this PR alike). Not addressed here.
   
   BMP off: `CONFIG_DRIVERS_NOTERPMSG_SERVER_CPUID` does not appear in the
   configuration, so the code is unchanged.
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC 
disabled, which current master needs for nxinit to start nsh there; unrelated 
to this change. checkpatch passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to