Debian 11 'Bullseye' on the Dell XPS 13 9305

When it comes to bare-metal Linux on laptops I usually make it difficult for myself. I will attempt to make it work on whatever hardware I have rather than buying something where Linux is expected to work well. Nvidia laptop graphics cards do not make for a good time. I was dimly aware that the Dell XPS line was considered “good for Linux” and that in some markets they even sell it pre-installed. When I recently saw a good deal on a 13” 9305 I decided to give it a go.

In short, it’s amazing and pretty much everything works. I’ll come back to the stuff that works in a minute because there is a significant problem with suspend that I want to highlight. There is an easy solution but I almost didn’t find it and it would have been a shame to return a perfectly good laptop. TL;DR: to fix high battery drain while suspended, change RAID mode to AHCI mode in BIOS storage options.

The basic problem is that out-of-the-box the 9305 (and possibly the 9310) will burn through a tonne of battery while suspended. Most of the online discussion on the topic revolves around this command:

# cat /sys/power/mem_sleep 
[s2idle]

On older models the output is often more like [s2idle] deep. For these models the aim of the game is to make sure that deep is selected instead, which you can do by tweaking boot parameters.

Now the situation has changed and as you can see I don’t have the deep option at all. As this Anandtech article explains,

In Haswell (and Clovertrail), Intel introduced a new S0ix active idle state (there are multiple active idle states, e.g. S0i1, S0i3). These states promise to deliver the same power consumption as S3 sleep, but with a quick enough wake up time to get back into full S0 should you need to do something with your device.

The problem then is that the XPS is only doing this S2 idle when it sleeps and it still requires quite a bit of energy. Somehow we have to get it into one of these S0ix states, which isn’t represented in the sysfs file.

Fortunately mgru on the Dell community forums pointed out the cause, which is discussed in a slightly opaque kernel bug report.

The - almost too easy - solution is: Set the disk mode from RAID to AHCI in the BIOS. I did that yesterday and tried sleep mode. I had a 1% drop in battery in almost 5 hours yesterday. I will further check it today when i come home from work. But it looks like this is the fix for the issue at first sight.

I agree that this does seem to work. In a somewhat unscientific test I let my laptop sleep for 10 minutes and saw a huge difference.

  • In RAID mode: 0.3420 Wh consumed
  • In AHCI mode: 0.0532 Wh consumed

Now that I’ve solved that problem I’m very happy with this machine. Now let’s summarise.

Issues/nitpicks

  • WiFi networks that I’ve used previously sometimes come up anew with an adapter name in parentheses and I have to input the network password again. I haven’t worked out the pattern to this yet but it’s only a minor annoyance so far.
  • The laptop isn’t quite square in its construction, at least the one I received. If I press my palm on the bottom-right corner it flexes ever so slightly before becoming firm against the table.
  • The white “charging” light at the front of the device is kind of bright, and as far as I know uncontrollable from software.

What works

Testing on Debian 11 with KDE.

  • Graphics
  • Audio input and output with the internal speakers and microphone
  • Bluetooth headphones (after apt-get install pulseaudio-module-bluetooth)
  • WiFi (after apt-get install firmware-iwlwifi and doing the modprobe dance or reboot)
  • Suspend/wake generally
  • External monitor connected via USB-C
  • Internal screen brightness control, including via function keys
  • Volume control via function keys
  • Keyboard brightness control, including via function keys
  • Webcam (tested using cheese)
  • Touchpad with multi-touch and two finger scrolling
  • Wired Ethernet via Satechi USB-C hub
  • Importing photos via USB from an up-to-date iPhone into Digikam