agentleFS
gvagogvago/unofficial-qodo-review-skills/skills/kernel-driver-hardware/SKILL.md

kernel-driver-hardware

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Use when a Linux kernel PR diff touches driver hardware interaction, register access, DMA mapping, memory barriers, IRQ handlers, device power/state machines (Sashiko stage 7). Skip for purely generic software logic (VFS, core networking). Part of the linux-kernel-review suite.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify ordering guarantees explicitly.

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kernel-driver-hardware

Lens for hardware-facing driver review (Sashiko stage 7). A hardware engineer's read of register access, DMA, and device state machines. If the diff is purely generic software logic (VFS, core networking), this lens returns no findings, say so and stop.

How to apply

  • Establish the device state machine implied by the driver: probe, open, start, stop, reset, suspend/resume, remove. Every hardware touch must be legal in the state where it happens.
  • Verify ordering guarantees explicitly; never assume the compiler or bus preserves your intended order without a barrier.

Rule index

  • H1. Register access legality: clocks and power domains enabled before registers are touched; no MMIO after reset/suspend has torn state down.
  • H2. DMA correctness: every dma_map has a matching unmap on all paths; missing dma_wmb()/dma_rmb() between descriptor writes and doorbell; unsafe DMA buffer allocation (stack buffers, unaligned).
  • H3. Endianness: missing or double cpu_to_le32/be conversions on hardware-shared structures.
  • H4. IRQ handling: handlers touching state that is freed or reset concurrently; missing synchronize_irq before teardown; enabling IRQs before the handler's data is ready.
  • H5. Ring/queue state: hardware rings accessed before initialization in the current hardware state; producer/consumer index math on wrap.
  • H6. Timing: missing required delays after reset/power transitions; busy-wait loops without timeout.

Mapping a finding to the contract

  • action_level: action_required for state-machine violations, missing barriers on DMA paths, or IRQ/teardown races; remediation_recommended for missing timeouts on unlikely-stuck waits.
  • category: Correctness.
  • evidence: the register/DMA/IRQ operation, the device state at that point, and why the ordering or state is wrong. Cite the datasheet constraint only as stated in the code/comments, do not invent hardware behavior.

What NOT to flag

  • Generic software logic, return no findings for non-hardware diffs.
  • Barrier "hardening" where existing locks already order the accesses.
  • Delay-length tuning without evidence the current value fails.

Sourcing

Stage text adapted from Sashiko (Apache-2.0). For driver-subsystem specifics (i2c, hid, tty, pci, ata...), kernel-subsystem-guides carries the per-subsystem invariant files.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.