Check power, clocks, reset and bus activity before changing driver code. Compare the device tree loaded on the board with the schematic, then read the probe log. A measurement and a log from the same board revision help distinguish a hardware issue from a configuration or driver issue.
A Linux driver for a new board is the worst kind of debugging problem: two unknowns at once. The hardware has never worked, and the driver has never run on it. When the kernel prints nothing, or prints a probe error and moves on, there is no obvious place to start — and the usual reflex, changing the driver until something happens, wastes the most time. The first job is deciding which side of the interface is at fault.
The sequence below is the order that wastes the least time. Each step removes one unknown before you touch the next one.
1. Prove the hardware before you trust the driver
A driver cannot debug hardware it cannot see. Before reading a line of driver code, confirm the board itself: power rails at the right voltage, clocks running at the right frequency, reset released, and the device responding on its bus. An oscilloscope or logic analyser on the I2C, SPI, or UART lines tells you in minutes whether the device answers at all.
A peripheral held in reset, a supply rail that drops under load or a clock running at the wrong frequency can all prevent a device from responding. If there is no response on the bus, check the rails, reset and clock against the circuit and PCB design before changing the driver.
2. Treat the device tree as code, not configuration
A device-tree mismatch can keep a driver from binding or cause its probe to fail. Check the compatible string first. If the driver matches but cannot initialise the peripheral, compare the register address, interrupt, clocks and pin configuration with the schematic and the running device tree.
Read the device tree against the schematic, not against the previous board’s device tree — the previous board looks right, and every difference from it is exactly where the new board breaks. Check four things in particular: the compatible string, the reg addresses, the interrupt specifier, and the clocks and resets. Then confirm the loaded device tree blob is the one you just edited — a stale DTB in the boot partition has ended more debugging sessions than any real bug.
3. Read the probe failure, don’t guess at it
A probe return code narrows the investigation. -EPROBE_DEFER tells the driver core to try again later because a required resource is unavailable. Read the device’s log for the supplier it is waiting for, such as a clock or regulator. Check that the supplier is described in the running device tree and its driver is available. Then check whether the peripheral binds after that resource becomes ready. For -ENODEV or -EINVAL, check the operation that returned the error before deciding which hardware or configuration value to investigate.
Run the probe with dynamic debug enabled for the driver and the subsystem it uses, so you see the probe path instead of only its result. And keep a minimal test: a driver that does nothing but probe, read an ID register, and print it. Building that minimal driver first is part of Linux kernel and driver development: the probe path is proven before any features are built on it. If the minimal driver cannot read the ID, the problem is below the driver — bus, power, reset, or device tree — and you know it in minutes instead of days.
4. Debug without a working console
The hardest case is the board with no console at all: the kernel boots, or seems to, and prints nothing. There is still a sequence. First, confirm the kernel actually starts — a heartbeat LED toggled from early boot code, or a UART character printed before the console subsystem initialises, separates “the kernel never started” from “the console is misconfigured.” Second, use earlycon or earlyprintk to get output before the real console driver loads; the most common cause of a silent boot is the console UART’s clock or pinmux being wrong in the device tree, which is a one-line fix once you can see it. Third, if the board hangs with no output at all, JTAG is not a luxury — it is the only way to see where the kernel stopped.
For crashes after boot, ramoops or pstore turns the next reboot into a diagnosis: the panic log survives in a reserved memory region, readable after the board comes back up. Set it up before you need it.
5. Suspect timing and interrupts before logic
Once the driver probes and the device answers, the remaining failures are usually timing or interrupts, not logic. A driver that works on the bench and fails in the field is almost always a timing assumption: a delay that was a guess, a poll loop that assumes the device is fast, an interrupt that arrives before the handler is ready. Interrupt storms, missed interrupts, and shared interrupt lines misbehaving under load all look like logic bugs and are none of them.
The fixes are mechanical. Replace fixed sleeps with readiness checks wherever the device offers a status bit. Give the interrupt handler the smallest possible job and defer the rest. Check DMA coherency explicitly — a buffer that looks correct in the driver and wrong on the wire is a cache problem, not a data problem. And test at the corners, not just at room temperature with a lab supply: cold, hot, low battery, and a busy bus are where timing assumptions break — conditions the bench never exercises.
6. Separate the two faults with one experiment each
When you still do not know which side is at fault, run one experiment that can only fail on one side. To test the hardware, drive the device from the bootloader or from a known-good minimal setup — U-Boot can toggle GPIOs, read an I2C ID register, and bring up a link without any Linux driver involved. If the device answers there, the hardware is probably fine. To test the driver, run it against a device you know works, or stub the hardware access and check the driver’s logic in isolation. One clean experiment each beats a week of changing both sides at once and hoping.
Keep a log of what each experiment proved — it stops the team re-testing a hypothesis that was already ruled out.
A short debugging checklist
- Rails, clocks, reset, and bus activity confirmed with instruments before any driver change.
- Device tree read against the schematic; compatible string, reg, interrupt, clocks, and resets checked; the loaded DTB confirmed current.
- Probe error codes read and understood; minimal probe-and-read-ID driver used as a test.
- Console failure separated from boot failure; earlycon and ramoops configured before they are needed.
- Fixed sleeps replaced with readiness checks; DMA coherency checked; corners tested.
- One experiment that can only fail on the hardware side, one that can only fail on the driver side — and a log of what each proved.
The cheapest fix is the early one
None of this is exotic. It is ordinary, and that is why it is expensive when skipped: a device tree error found in review costs an hour; the same error found after a week of driver rewrites costs the week. The pattern is the same as every other interface problem — the mismatch hides until the schedule is tight and the hardware is built.
When you evaluate a development partner, ask how they debug a driver on a board that has never worked: instruments and device tree first, or rewriting the driver? A team that works across hardware, firmware, and software in one place can move between the two sides of the problem without handing it over — the difference between a driver that works on the bench and one that works in the field. A design review, debugging and redesign pass that checks the device tree against the schematic, and the driver against the hardware it runs on, is the cheapest place to find what this list misses.
Frequently asked questions
Why does my driver never probe and the kernel log shows nothing?
First confirm the expected driver is present and enabled. Check that the device node is enabled and that its compatible string matches the driver. Then verify that the board loaded the device tree you edited. If the driver does enter probe, use its log to check the addresses, interrupt, clocks and resets for that peripheral.
What does -EPROBE_DEFER mean?
The driver is waiting for a resource it needs to initialise the device. The kernel schedules another probe attempt. Look for the missing dependency in the log, check whether its supplier becomes ready and verify that the peripheral then binds. Changing the probe order alone will not supply a missing clock or regulator. See the Linux kernel documentation on driver probing.
How do I debug a board with no console output at all?
First confirm the kernel actually starts — a heartbeat LED toggled from early boot code, or a UART character printed before the console subsystem initialises, separates “the kernel never started” from “the console is misconfigured.” Then use earlycon or earlyprintk to get output before the real console driver loads; the most common cause of a silent boot is the console UART’s clock or pinmux being wrong in the device tree. If the board hangs with no output at all, JTAG is the only way to see where the kernel stopped, and for crashes after boot, ramoops or pstore preserves the panic log in reserved memory for the next reboot.
How can I tell whether the fault is in the hardware or the driver?
Run one experiment that can only fail on one side. To test the hardware, drive the device from the bootloader or a known-good minimal setup — U-Boot can toggle GPIOs, read an I2C ID register, and bring up a link without any Linux driver involved. To test the driver, run it against a device you know works, or stub the hardware access and check the driver’s logic in isolation. Keep a log of what each experiment proved, so the team does not re-test a hypothesis that was already ruled out.