DEV Community

Miklos Halasz
Miklos Halasz

Posted on

Why My Laptop Drained Overnight While Docked (and How a GRUB Change Fixed It)

I experienced a confusing and frustrating issue while using a Dell WD19 USB-C dock on Ubuntu. In the evening, everything worked as expected: the laptop was charging properly, external displays were active, and the wired network was connected. The next morning the laptop battery was completely empty — even though it had remained connected to the dock the entire time.

Even more confusing, this problem did not only occur overnight. Sometimes, after the laptop woke up from sleep, the dock would continue to provide display output and network connectivity, yet would no longer supply any power. In that state, the system would quietly run on battery while appearing to be fully docked.

At first glance, this behavior seems impossible. A dock that can drive displays and provide Ethernet should also provide power. But with modern USB-C docks and Linux power management, this assumption is unfortunately not always true.

The actual problem

The root of the issue lies in how Linux handles power management during idle and suspend states, combined with how USB-C Power Delivery (PD) is negotiated.

While the laptop was idle overnight, it entered a low-power state known as s2idle (also called Modern Standby). In this state, the system is not fully asleep. The CPU is mostly idle, but many components — including USB controllers — remain logically active. This allows for fast wake-up times, but it also means devices are expected to manage their own low-power behavior correctly.

Linux, trying to reduce power usage further, enables USB autosuspend by default. Autosuspend allows the kernel to put USB devices into a low-power state when they appear idle. This works well for simple peripherals, but the WD19 dock is not a simple device. Internally, it contains a USB hub, a USB-C Power Delivery controller, a DisplayPort alt-mode controller, and a network adapter.

During the night, USB autosuspend put part of the dock into a suspended state. When that happened, the dock’s Power Delivery controller dropped the negotiated power contract. From the laptop’s perspective, external power simply disappeared. The system silently switched to battery power and continued running in s2idle until the battery was fully drained. Because the USB connection itself was never fully reset, Linux never retried power negotiation, and no warning was shown.

This is why the system looked fine before sleep, yet was dead in the morning.

The solution: disabling USB autosuspend

The fix was to disable USB autosuspend globally by altering the GRUB configuration and adding the following kernel parameter:

usbcore.autosuspend=-1
Enter fullscreen mode Exit fullscreen mode

After updating GRUB and rebooting, the kernel no longer attempts to automatically suspend USB devices. As a result, the dock’s Power Delivery controller remains fully powered and active, even while the system is idle or suspended in s2idle. The power contract between the dock and the laptop stays intact, and the laptop continues charging throughout the night.

This change does not meaningfully increase power consumption. The additional power usage is negligible compared to what the dock and external monitors already consume, and system stability is significantly improved.

Where s2idle and S3 fit into this

To understand why this fix is effective, it helps to distinguish between the two common Linux sleep states.

In s2idle, the system is only partially asleep. Devices remain logically connected, and power management relies heavily on drivers behaving correctly. This is where USB-C docks often fail, because power delivery can be dropped without a full hardware reset.

In contrast, S3 sleep (also called deep sleep or suspend to RAM) fully powers down the CPU and most devices, including USB controllers. When the system wakes up, everything — including USB-C power delivery — is reinitialized from scratch. This makes S3 far more robust, especially when docks are involved.

Disabling USB autosuspend makes s2idle behave more safely by preventing the dock from entering a half-suspended state where power delivery can be lost. In many cases, this alone is sufficient and avoids the need to force S3 sleep.

Why this works reliably

By altering GRUB and disabling USB autosuspend, the system no longer allows the dock’s internal controllers to power down independently during idle. This prevents the silent loss of USB-C power delivery that caused the overnight battery drain. The dock remains fully operational, the charging contract stays active, and the laptop behaves as users naturally expect: if it is docked, it stays charged.

In short, the problem was not a faulty battery or charger, but a subtle interaction between modern Linux power states and USB-C dock firmware. A single kernel parameter was enough to restore predictable and reliable behavior.

Top comments (0)