Subsystems it speaks它会的内核子系统
Beyond generic driver scaffolding, the hub routes each task to a per-subsystem expert module — loaded on demand, aligned to that subsystem's kernel Documentation/, verified against a real source tree, and carrying its own test cases and known-bug.
不止通用驱动骨架——hub 按任务把你路由到对应子系统的专家模块:按需加载、对齐该子系统的内核 Documentation/、拿真源码树验证、各带自己的测试用例和踩坑记录。
Interrupts中断
request_irq / threaded IRQ, bottom-half choice (workqueue / tasklet / softirq), and what can sleep where.request_irq / threaded IRQ、下半部选型(workqueue / tasklet / softirq)、哪个上下文能睡。
Scheduler调度器
Wait queues, completion, the manual-sleep ordering (lost wakeup), preemption, policy / affinity, CFS & EEVDF.等待队列、completion、手动睡眠顺序(丢唤醒)、抢占、策略 / 亲和性、CFS 与 EEVDF。
Memory management内存管理
Allocator choice (kmalloc / kvmalloc / vmalloc / kmem_cache), GFP context, user-memory access, driver mmap.分配器选型(kmalloc / kvmalloc / vmalloc / kmem_cache)、GFP 上下文、访问用户内存、驱动 mmap。
Filesystems文件系统
VFS objects, implementing file_operations, exposing data via debugfs / procfs / seq_file, writing a filesystem.VFS 对象、实现 file_operations、用 debugfs / procfs / seq_file 导出数据、写文件系统。
Locking并发加锁
spinlock vs mutex choice, the irqsave rule for locks shared with IRQ context (or same-core deadlock), no-sleep-in-atomic, RCU for read-mostly data.spinlock 与 mutex 选型、进程和中断共享的锁要 irqsave(否则同核死锁)、原子态禁睡眠、读多写少用 RCU。
Runtime PM运行时电源
pm_runtime enable + get/put balance — and the get_sync trap (it adds a ref even on failure), autosuspend, dev_pm_ops system-sleep callbacks.pm_runtime enable + get/put 配平——以及 get_sync 的坑(失败也加引用)、autosuspend、dev_pm_ops 系统睡眠回调。
DMA mappingDMA 映射
The DMA API — coherent vs streaming, the mandatory dma_mapping_error check, DMA mask, cache sync. Not dmaengine.DMA API:coherent 与 streaming、必查 dma_mapping_error、DMA mask、缓存同步。注意不是 dmaengine 子系统。
Device tree设备树
compatible binding, of_* property reads, MMIO/IRQ/clock/GPIO resources, node iteration with refcounting.compatible 绑定、of_* 读属性、拿 MMIO/中断/时钟/GPIO、遍历节点的引用计数。
I2C
i2c_driver bind, SMBus / raw transfer / regmap-i2c, and the probe-signature change across versions.i2c_driver 绑定、SMBus / 原始传输 / regmap-i2c、跨版本的 probe 签名变更。
SPI
spi_driver bind, spi_sync multi-segment transfers, regmap-spi, DMA-able buffers.spi_driver 绑定、spi_sync 多段传输、regmap-spi、buffer 必须 DMA-able。
GPIO
gpiod descriptor consumer, GPIO-as-IRQ, writing a gpiochip, and the active-low handling.gpiod 描述符消费、GPIO 当中断、写 gpiochip 控制器、active-low 处理。
USB
host driver bind, control / bulk transfers, async URBs, and the completion-callback context rule.host 驱动绑定、控制 / 批量传输、URB 异步、完成回调的上下文规则。
PHY (generic)通用 PHY
USB / PCIe / MIPI phy — consume phy_init → phy_power_on (reverse to tear down), or write a provider. Not the MDIO network PHY.USB / PCIe / MIPI phy —— 消费 phy_init → phy_power_on(拆除反序),或写 provider。不是网络 MDIO PHY。
Mailbox邮箱 (mailbox)
Inter-processor IPC — client mbox_send_message, or write a controller; the controller must signal TX completion (mbox_chan_txdone).核间 IPC —— client mbox_send_message,或写控制器;控制器必须上报 TX 完成(mbox_chan_txdone)。
Clocks (CCF)时钟 (CCF)
Consumer clk_get / prepare+enable, the two-phase prepare-vs-enable context split (what can sleep), and writing a clk provider for device tree.消费 clk_get / prepare+enable、prepare 与 enable 两阶段的上下文区别(谁能睡)、写 clk provider 暴露给设备树。
Pin control引脚 (pinctrl)
Runtime state switching, the PM sleep / idle helpers, and the fact that the default state is auto-applied by the driver core.运行时切引脚状态、PM 的 sleep / idle 封装、default 态由 driver core 自动应用(不用手动选)。
Regulators供电 (regulator)
Supply get / enable / set-voltage, the reference-counted enable/disable balance, and optional supply vs the dummy regulator.拿供电 / enable / 调压、enable·disable 引用计数配平、可选供电 vs dummy 稳压器。
Regmap
Per-bus init, regmap_read / write / update_bits, the register cache across PM, and marking volatile registers.按总线 init、regmap_read / write / update_bits、跨 PM 的寄存器缓存、标 volatile 寄存器。
Reset复位 (reset)
assert / deassert / self-reset a reset line, and the exclusive-vs-shared reference-counted choice by how the line is wired.assert / deassert / 自复位一条复位线、按硬件接线选 exclusive vs shared(引用计数)。
PWM
Atomic pwm_state apply (period+duty+enable in one shot), the pwm_apply_state → pwm_apply_might_sleep rename, and atomic vs sleeping apply.pwm_state 一次性原子应用(周期+占空比+使能)、pwm_apply_state → pwm_apply_might_sleep 改名、原子 vs 会睡的 apply。
Clk provider写时钟控制器
Writing a clock controller — clk_hw / clk_ops, where .enable is atomic but .prepare may sleep, and exposing clocks to DT.写时钟控制器 —— clk_hw / clk_ops,.enable 原子而 .prepare 可睡,暴露给 DT。
Pinctrl driver写引脚控制器
Writing a pin controller — pinctrl_desc with the three ops, the DT dt_node_to_map, set_mux and pin_config_set.写 pin 控制器 —— pinctrl_desc + 三组 ops、DT dt_node_to_map、set_mux 和 pin_config_set。
Regulator driver写稳压器驱动
Writing a PMIC regulator — the *_regmap helper ops driven by regulator_desc register fields, and list_voltage selector→µV mapping.写 PMIC 稳压器 —— *_regmap helper ops 配 regulator_desc 寄存器字段、list_voltage selector→µV 映射。
Networking网络
net_device registration, NAPI receive (budget / poll), ndo_start_xmit + queue control, sk_buff lifecycle.net_device 注册、NAPI 收包(budget/poll)、ndo_start_xmit 发包 + 队列控制、sk_buff 生命周期。
Audio (ASoC)音频 (ASoC)
codec / component, cpu DAI, the machine sound card, DAI ops, and the atomic trigger-callback rule.codec / component、cpu DAI、machine 声卡、DAI ops、trigger 回调的原子上下文规则。
Camera (V4L2)摄像 (V4L2)
v4l2 / video device registration, videobuf2 queues, sensor subdev (async), the stop_streaming buffer-return rule.v4l2 / video device 注册、videobuf2 队列、sensor subdev(异步)、stop_streaming 归还 buffer 规则。
IIO (sensors / ADC)IIO(传感器 / ADC)
Sensor / ADC driver skeleton, private data via iio_priv, channels & info, and triggered-buffer capture.传感器 / ADC 驱动骨架、用 iio_priv 拿私有数据、channels 与 info、触发缓冲采集。
Build system构建系统
Kbuild Makefiles, the Kconfig language, the native config flow (no hand-edited defconfig), cross-compile, module essentials.Kbuild Makefile、Kconfig 语言、原生配置流程(不手改 defconfig)、交叉编译、模块要素。
Thermal温控 (thermal)
Temperature-sensor zones (get_temp in milli-degrees C), cooling devices, the OF-register rename, and DT thermal-zones.温度传感器 zone(get_temp 回填毫摄氏度)、冷却设备、OF 注册改名、DT thermal-zones。
Watchdog看门狗 (watchdog)
watchdog_ops start/stop/ping, the nowayout semantics, max_hw_heartbeat_ms auto-feed, and stop-on-reboot.watchdog_ops 启停喂狗、nowayout 语义、max_hw_heartbeat_ms 框架代喂、干净重启停狗。
RTC
rtc_class_ops read/set time, the struct tm conventions (tm_year since 1900, tm_mon 0-based), and allocate-then-register.rtc_class_ops 读写时间、struct tm 约定(tm_year 自 1900、tm_mon 0 起)、先 allocate 后 register。
Power supply电源 (power-supply)
power_supply_desc register, the fixed micro-unit properties (µV / µA / µAh / 0.1°C), and power_supply_changed on state change.power_supply_desc 注册、属性固定微单位(µV / µA / µAh / 0.1°C)、状态变化调 power_supply_changed。
hwmon硬件监控 (hwmon)
devm_hwmon_device_register_with_info, and the fixed sysfs units — temperature in milli-°C, voltage in mV, fan in RPM.devm_hwmon_device_register_with_info、sysfs 固定单位 —— 温度毫摄氏度、电压 mV、风扇 RPM。
cpufreqCPU 调频 (cpufreq)
Writing a cpufreq_driver + frequency table, .target_index switching by index, and the transition_begin/end pairing for async frequency changes.写 cpufreq_driver + 频率表、.target_index 按索引切频、异步改频率要 transition_begin/end 成对(否则调频卡死)。
cpuidleCPU 空闲 (cpuidle)
cpuidle_driver + idle states, the .enter atomic-context rule (return the state actually entered), and CPUIDLE_FLAG_TIMER_STOP for timer-stopping deep states.cpuidle_driver + idle states、.enter 原子上下文(返回实际进入的态)、停本地 timer 的深睡态标 CPUIDLE_FLAG_TIMER_STOP。
devfreq设备调频 (devfreq)
Non-CPU device DVFS (GPU / bus) — devfreq_dev_profile + .target snapping to a real OPP via devfreq_recommended_opp, with true utilization in get_dev_status.非-CPU 设备调频(GPU / 总线)—— devfreq_dev_profile + .target 用 devfreq_recommended_opp 取实际 OPP、get_dev_status 回填真实利用率。
LED
led_classdev register, the atomic brightness_set vs brightness_set_blocking (for sleeping buses), and DT init data.led_classdev 注册、原子 brightness_set vs brightness_set_blocking(走会睡的总线)、DT init data。
Input输入 (input)
input_dev register, declaring capabilities before register, reporting events, and the mandatory input_sync.input_dev 注册、注册前声明能力、上报事件、必须的 input_sync 帧同步。
MMC / SD
Host controller driver — mmc_alloc_host / mmc_add_host, the mmc_host_ops, and the mandatory mmc_request_done on every completion path.主机控制器驱动 —— mmc_alloc_host / mmc_add_host、mmc_host_ops、每条完成路径都必须 mmc_request_done。
DMA engineDMA engine
Slave DMA — the prep → submit → dma_async_issue_pending sequence (submit alone won't start it), channel lifecycle, dma-mapped buffers.slave DMA —— prep → submit → dma_async_issue_pending 序列(光 submit 不启动)、通道生命周期、dma-map 过的缓冲。
NVMEM
eeprom / efuse / otp — consume a cell (nvmem_cell_read buffer must be kfreed), or write a provider via nvmem_config.eeprom / efuse / otp —— 消费 cell(nvmem_cell_read 缓冲要 kfree),或用 nvmem_config 写 provider。
MTD
NAND / NOR / SPI flash — erase before write (aligned to erasesize), mtd_device_parse_register partitions, nand_scan.NAND / NOR / SPI flash —— 写前必擦(按 erasesize 对齐)、mtd_device_parse_register 分区、nand_scan。
DMA provider写 DMA 控制器
Writing a DMA controller — dma_device with dma_cap_set, the virt-dma (vchan) layer, and completing the cookie + client callback.写 DMA 控制器 —— dma_device + dma_cap_set、virt-dma(vchan)层、完成 cookie + 触发 client 回调。
IOMMU
Writing an IOMMU driver — iommu_ops with map_pages/unmap_pages, and flushing the IOTLB after unmap before pages are reused.写 IOMMU 驱动 —— iommu_ops 的 map_pages/unmap_pages、unmap 后放页前必刷 IOTLB。