Skip to content

Upstreaming Strategy

KDAL is developed out-of-tree under GPL-2.0-only, the kernel’s own licence, since 2026-12-03 (KDAL #61): LICENSE is the GPL version 2, every C source starts with its SPDX line, the module declares MODULE_LICENSE("GPL"), and the userspace ABI header include/kdal/ioctl.h is GPL-2.0-only WITH Linux-syscall-note, as the kernel’s UAPI headers are. Before that the repository said GPLv3 while the module and the compiler said version 2. Upstreaming still needs community review. This page outlines the engineering practices meant to keep that path open.

The user-kernel ABI consists of 6 ioctl commands (5 dispatched; KDAL_IOCTL_POLL_EVENT is defined but returns -ENOTTY), plus read and write on /dev/kdal and read-only debugfs files. No new system calls, no new filesystem types, no new socket families.

All code follows checkpatch.pl guidelines:

  • Tabs for indentation, 80-column soft limit
  • /* C89 comments */ in kernel code
  • kdal_* prefix for global symbols (the module exports none: no EXPORT_SYMBOL)
  • Proper goto error unwinding
KDAL usage Kernel API
Character device misc_register() / misc_deregister()
Debug interface debugfs_create_dir() / debugfs_create_file()
Synchronisation struct mutex / mutex_lock() / mutex_unlock()
Linked lists struct list_head / list_for_each_entry_safe()
Memory kmalloc() / kfree() / kzalloc()
User copy copy_to_user() / copy_from_user()
Events DECLARE_WAIT_QUEUE_HEAD / wake_up_interruptible() (woken on each event; nothing waits on it yet)

No custom allocators, no out-of-tree dependencies.

Platform-specific code lives exclusively under src/backends/. The core and driver layers never reference SoC registers, DMA engines, or bus controllers directly. The core can be reviewed independently of any hardware.

KDAL_IOCTL_GET_VERSION returns major/minor/patch. Any ABI change increments the version. Userspace tools check compatibility:

struct kdal_ioctl_version ver;
ioctl(fd, KDAL_IOCTL_GET_VERSION, &ver);
if (ver.major != EXPECTED_MAJOR) { /* incompatible */ }
  • Settle the licence as GPL-2.0-only, with SPDX lines on every C file (KDAL #61)
  • Pass checkpatch.pl --strict on all files
  • Pass sparse with zero warnings
  • Achieve cppcheck clean run
  • Write Documentation/driver-api/kdal.rst in kernel docs format
  • Submit to linux-kernel@vger.kernel.org as RFC patch series
  • Address reviewer feedback (expect 3–5 revision cycles)
  • Find a subsystem maintainer willing to sponsor

Recommended submission order:

  1. Headers - include/kdal/: types, API contracts, ioctl definitions
  2. Core - src/core/: lifecycle, registry, events, chardev, debugfs
  3. QEMU backend - src/backends/qemu/: reference implementation
  4. Example drivers - src/drivers/example/: UART, I2C, SPI, GPU
  5. Tests - tests/kunit/: in-kernel test suite
  6. Documentation - kernel Documentation/ format
Phase Gate
Out-of-tree validation Thesis defense
Community RFC Post-defense, after real hardware results
Formal submission After 1–2 RFC revision cycles
Acceptance Depends on maintainer bandwidth