gateway-dk-ask: pin ASK with libxml2 2.12+ compat fix for fmc#9677
gateway-dk-ask: pin ASK with libxml2 2.12+ compat fix for fmc#9677igorpecovnik merged 5 commits intoarmbian:mainfrom
Conversation
Update ASK to a commit that adds a libxml2 compatibility patch for fmc. Newer libxml2 (2.12+) changed the xmlStructuredErrorFunc callback signature to take a const error pointer. Without the patch, fmc fails to compile against libxml2 2.12+ headers (Ubuntu Resolute and other distros with newer libxml2).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo files modified: a gateway ASK build script updated with new commit pinning, restructured patch staging directories, Debian metadata adjustments, installation method changes, and enhanced patch resolution with validation logic; and a kernel libbpf patch adding const-correctness for newer glibc compatibility. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
glibc 2.42+ (Ubuntu Resolute and later) ships const-aware strstr/strchr declarations in <string.h>. Assigning their results to non-const char* triggers -Werror=discarded-qualifiers in tools/bpf/resolve_btfids, which is compiled by the linux-headers .deb postinst on the build host. Fix by declaring the receiving variables as const char* in two places in tools/lib/bpf/libbpf.c. Matches the upstream 6.13+ fix, backported to the NXP lf-6.12.y SDK kernel (which NXP has moved off for 6.18+).
|
Went ahead and fixed the headers issue as well, however, identified another bug, so I'm fixing the whole ASK patching process for future-proofness. Will push soon. |
Patched library rebuilds now pick the correct ASK patch by parsing the
upstream version from debian/changelog after apt-get source. Patches are
staged under /tmp/ask-patches/<pkg>/<version>/<file>, letting one ASK
repo cover distros whose source versions differ (Trixie/Noble 1.1.0 vs
Resolute 1.1.1). Missing-patch case fails loudly instead of patching
the wrong tree.
Other changes in this bundle:
- Switch .deb install in chroot from dpkg -i to apt-get install so
runtime deps resolve automatically.
- Add libxml2 | libxml2-16 alternative dep for Trixie/Noble compat.
- Declare /etc/fmc/config/{cfgdata.xsd,hxs_pdl_v3.xml,netpcd.xsd} as
conffiles so local edits survive OTA upgrades.
- Bump pinned ASK commit to 9f5a37e.
- Update package maintainer to Tomaz Zaman <tomaz@mono.si>.
- leds-lp5812: mutex_destroy in probe err_out and remove paths to
pair the mutex_init in probe.
|
All three images build, flash and run fine now. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bsp/gateway-dk/leds-lp5812.c`:
- Around line 610-612: The mutex for lp5812 chip (chip->lock) is being destroyed
too early in the probe error path and in .remove(), causing
use-after-destruction when devm_led_classdev_register cleanup invokes brightness
callbacks; stop calling mutex_destroy(&chip->lock) directly in the err_out path
and .remove() (and anywhere before devm cleanup completes). Instead either
remove those explicit mutex_destroy calls entirely (since kernel mutexes need no
explicit destruction) or register a devm action immediately after mutex_init()
to destroy the mutex during device teardown, ensuring destruction happens after
devm_led_classdev_unregister/cleanup; update references in lp5812_deinit_device,
err_out, and the .remove() path accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ce183a21-1a20-4e68-805e-69e300f81077
📒 Files selected for processing (2)
extensions/gateway-dk-ask.shpackages/bsp/gateway-dk/leds-lp5812.c
mutex_destroy ran before devres unwinds devm_led_classdev_register, whose cleanup can invoke brightness_set via led_trigger_set(NULL). Those callbacks acquire chip->lock, so destroying it in .remove created a use-after-destruction hazard on CONFIG_DEBUG_MUTEXES=y builds. Kernel mutexes don't require explicit destruction — the memory holding chip->lock is freed by the devm_kzalloc devres entry after all callbacks complete.
cdx: refuse to load without ASK-capable FMAN microcode.
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
Update the ASK repo pin to a commit that adds a libxml2 compatibility patch for
fmc.Newer libxml2 (2.12.0+, released Oct 2023) changed the
xmlStructuredErrorFunccallback signature to take aconst xmlError *instead ofxmlError *. Without the patch, fmc fails to compile against libxml2 2.12+ headers, breaking builds against newer distributions.The patch in the ASK repo uses a
LIBXML_VERSIONpreprocessor check to select the correct callback signature for both old and new libxml2.Distribution coverage
How Has This Been Tested?
Checklist:
Summary by CodeRabbit
Bug Fixes
Chores