Skip to content

qmi_wwan_q: kernel 6.18 compatibility fixes - #256

Open
ozgunokan wants to merge 2 commits into
FUjr:mainfrom
ozgunokan:qmodem-edma
Open

qmi_wwan_q: kernel 6.18 compatibility fixes#256
ozgunokan wants to merge 2 commits into
FUjr:mainfrom
ozgunokan:qmodem-edma

Conversation

@ozgunokan

Copy link
Copy Markdown

qmi_wwan_q: kernel 6.18 compatibility fixes

  • hrtimer_init() -> hrtimer_setup() (removed upstream in kernel 6.11+)
  • usbnet_bh() tasklet hijack removed: usbnet replaced the tasklet-based
    bh with a private workqueue (bh_work) that external drivers can no
    longer intercept
  • qmap_wake_queue() call moved from the removed usbnet_bh() hook into
    rmnet_usb_rx_fixup(), which usbnet already calls on every completed
    RX -- equivalent timing to the original hook

Tested on IPQ807x (Arcadyan AW1000, Quectel RG500Q-EA), kernel 6.18.44,
NSS-accelerated rmnet confirmed via qca-nss-drv rmnet_rx counters.

@FUjr

FUjr commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Thank you for the kernel 6.18 work and the Turkish SMS contribution. I reviewed both commits, but I cannot merge the PR as-is because it combines unrelated changes and has compatibility/regression risks:

  • hrtimer_setup() is used unconditionally even though this driver still supports older kernel branches where that API is unavailable; it needs an appropriate version guard and the existing fallback.
  • Moving qmap_wake_queue() exclusively to the RX fixup is not equivalent to the previous bottom-half timing. Upload-only traffic can leave child QMAP queues stopped until an RX packet arrives.
  • The Turkish GSM 7-bit mappings are applied globally. National locking/single-shift tables must be selected from the relevant UDH language IE; otherwise non-Turkish messages using reserved extension codes can be decoded differently.
  • The SMS parser still accepts an unbounded, unvalidated modem-provided PDU into a fixed 512-byte buffer.

Please split the kernel and SMS changes into separate PRs and address these points. Thanks again for testing this on IPQ807x/RG500Q-EA and for taking the time to contribute.

@sqliuchang

Copy link
Copy Markdown
Contributor

On the IPQ807x target with kernel 6.18, only the generic QMI and MHI drivers currently build without issues—both vendor and NSS variants fail to compile.
I've verified that this PR successfully fixes the build for the NSS-accelerated QMI driver.

FUjr pushed a commit to ozgunokan/QModem-NSS that referenced this pull request Sep 8, 2026
Addresses review feedback on FUjr#257/FUjr#256: the Turkish national language
extension mappings were previously written directly into the shared
gsm7bits_extend_to_latin1 table, so every GSM 7-bit message decoded
through it regardless of language -- reserved extension codes used by
other languages/future 3GPP additions could have been misdecoded as
Turkish characters.

This moves the Turkish mappings into a separate turkish_extend_to_latin1
table and adds udh_has_turkish_shift(), which walks the PDU's User Data
Header IEs and only selects that table when a National Language Locking
Shift (IEI 0x24) or Single Shift (IEI 0x25) IE explicitly selects Turkish
(language id 0x01, per 3GPP TS 23.038 table 6.2.1.2.5). Every other
message continues to decode through the original, unmodified table.

Also adds a bounds check in sms_send() (operations.c): profile->sms_pdu
was hex-encoded into a fixed 512-byte pdu_hex buffer with no upper
bound on the source PDU length, which could overflow the stack buffer
for a long/malformed PDU. This rejects PDUs longer than 255 chars
(the max that fits pdu_hex[512] as hex + terminator) up front.

Tested on Arcadyan AW1000 (Quectel RG500Q-EA), IPQ807x: Turkish SMS
with the language shift IE set decode correctly; a batch of non-Turkish
GSM 7-bit messages (EN/DE test SMS) decode unchanged before and after
this patch.
@FUjr

FUjr commented Sep 8, 2026

Copy link
Copy Markdown
Owner

I have rebuilt this branch on the latest main and separated it from the SMS work.

The NSS changes now include:

  • automatic hrtimer_init()/hrtimer_setup() selection by kernel version;
  • restoration of the original usbnet bottom-half hook on older kernels, without the unsafe global work-function hijack;
  • an opt-in QMODEM_QMI_NSS_RX_WAKE_FALLBACK package build option for the newer-kernel RX-side queue wake workaround (default: disabled);
  • an opt-in QMODEM_QMI_NSS_REGISTRATION_RETRY package build option for transient NSS registration failures (default: disabled);
  • checked RX-handler registration with cleanup on failure, bounded retry scheduling, and synchronous cancellation during teardown.

The updated head is 78f373e. This PR is now NSS/kernel-only; the Turkish SMS changes remain in PR #259.

The two behavioral workarounds are intentionally compile-time options so a target can enable them only after validating its vendor kernel/NSS integration. Would you be comfortable merging this split and gated version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants