As I already mentioned in my previous post about the XPS 13, I had issues with the touchpad: it freezes rather frequently, because it looses sync a lot. After losing sync for a few times, the psmouse driver issues a reconnect request. And when that happens, the touchpad freezes. It looks like this in the kernel log:

Jul 26 15:43:19 sylvester kernel: psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 4
Jul 26 15:43:19 sylvester kernel: psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
Jul 26 15:43:19 sylvester kernel: psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
Jul 26 15:43:19 sylvester kernel: psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
Jul 26 15:43:19 sylvester kernel: psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
Jul 26 15:43:19 sylvester kernel: psmouse serio1: issuing reconnect request

Sometimes this would happen several times in a minute, which makes using the touchpad horribly annoying. I found various pages mentioning this problem on the Internet, like this Fedora bugreport, a Dell Community forum thread, or Stack Exchange question. Unfortunately, none of the posts I found, contained a real fix. There were some kernel patches available, but I was already running a 4.1 kernel, and those patches had already been included there. The resetafter=0 option for the psmouse module didn't help, it only caused the problem to happen less frequent. Adding i8042.nomux i8042.reset to the kernel options didn't solve anything either. After some more STFW, I stumbled on a kernel patch. The discussion about this patch, turned out to be informative. It's a rather long discussion, so I will summarize what I learned from it.

  • The touchpad can operate in I2C or PS2 mode
  • The psmouse driver loses sync due too invalid packets
  • The invalid packets only occur in PS2 mode
  • Putting the touchpad in I2C mode also puts the sound in I2S mode
  • Older kernels (<4.1) don't support I2S mode
  • A kernel option allows to put the sound in HDA mode, so that older kernels could still have working audio: acpi_osi="!Windows 2013"
  • If that kernel option is not there, the touchpad should be in I2C mode

As I did not have that kernel option enabled, my touchpad should have been operating in I2C mode, and I shouldn't have had the problem at all. But it wasn't running in I2C mode, and I had no idea how to force it. So I contacted Dell Pro support via Twitter, and CC'd the Dell employee who sent that kernel patch I linked earlier, as I felt he knew a thing or two about this problem. They suggested to try a few things, though I already suspected that they wouldn't help (yet tried them anyway just to be sure):

  • Disabling the i2c_hid driver
  • Add the kernel option acpi_osi="!Windows 2013"

As I expected, they didn't change a thing, so I continued to dig around. I found that when loading the i2c_i801 module, the following warning showed up in the kernel log:

[ 7214.275358] ACPI Warning: SystemIO range 0x000000000000F040-0x000000000000F05F conflicts with OpRegion 0x000000000000F040-0x000000000000F04F (\_SB_.PCI0.SBUS.SMBI) (20150410/utaddress-254)
[ 7214.275366] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver

However, this turned out to be unrelated. A bit later, Dell Pro support pointed me to the Gentoo Wiki. I felt a bit ashamed as I had never read that page before. It said to enable the Synopsys DesignWare Platform I2C driver. Since I did not have this enabled in my kernel config, I was hopeful that this would finally solve my issue. So I recompiled my kernel and rebooted, but once again, it didn't help. I still needed the psmouse module to be loaded, or the touchpad wouldn't work at all. During my efforts to solve this problem, I had installed sys-apps/i2c-tools, which contains the i2cdetect tool. Running this tool with the -l option didn't show the Synopsys DesignWare I2C adapter:

i2c-0   i2c             i915 gmbus ssc                          I2C adapter
i2c-1   i2c             i915 gmbus vga                          I2C adapter
i2c-2   i2c             i915 gmbus panel                        I2C adapter
i2c-3   i2c             i915 gmbus dpc                          I2C adapter
i2c-4   i2c             i915 gmbus dpb                          I2C adapter
i2c-5   i2c             i915 gmbus dpd                          I2C adapter
i2c-6   i2c             DPDDC-A                                 I2C adapter
i2c-7   i2c             DPDDC-B                                 I2C adapter

Running find /sys/devices/ -name 'i2c*' made clear that all these I2C adapters were related to the GPU:

/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/i2c-6
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1/i2c-7
/sys/devices/pci0000:00/0000:00:02.0/i2c-0
/sys/devices/pci0000:00/0000:00:02.0/i2c-0/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-0/i2c-dev/i2c-0
/sys/devices/pci0000:00/0000:00:02.0/i2c-1
/sys/devices/pci0000:00/0000:00:02.0/i2c-1/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-1/i2c-dev/i2c-1
/sys/devices/pci0000:00/0000:00:02.0/i2c-2
/sys/devices/pci0000:00/0000:00:02.0/i2c-2/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-2/i2c-dev/i2c-2
/sys/devices/pci0000:00/0000:00:02.0/i2c-3
/sys/devices/pci0000:00/0000:00:02.0/i2c-3/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-3/i2c-dev/i2c-3
/sys/devices/pci0000:00/0000:00:02.0/i2c-4
/sys/devices/pci0000:00/0000:00:02.0/i2c-4/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-4/i2c-dev/i2c-4
/sys/devices/pci0000:00/0000:00:02.0/i2c-5
/sys/devices/pci0000:00/0000:00:02.0/i2c-5/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-5/i2c-dev/i2c-5
/sys/devices/pci0000:00/0000:00:02.0/i2c-6
/sys/devices/pci0000:00/0000:00:02.0/i2c-6/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-6/i2c-dev/i2c-6
/sys/devices/pci0000:00/0000:00:02.0/i2c-7
/sys/devices/pci0000:00/0000:00:02.0/i2c-7/i2c-dev
/sys/devices/pci0000:00/0000:00:02.0/i2c-7/i2c-dev/i2c-7

To be sure that it was the GPU, I ran lspci -s 0000:00:02.0:

00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)

I started running out of ideas, so I asked Dell Pro support to internally contact the Dell employee who wrote that kernel patch. They told me they escalated the issue and that they would be in touch. A few days later I hadn't heard from Dell yet, and I was trying to optimize the power usage a bit. While adding some kernel options for that, I noticed that I still had the acpi_osi="!Windows 2013" option enabled, so I removed it. After the next reboot, my kernel log was flooded with I2C debugging messages that I hadn't seen before:

i2c_designware INT3433:00: i2c_dw_isr:  Synopsys DesignWare I2C adapter enabled= 0x1 stat=0x504
i2c_designware INT3432:00: i2c_dw_isr:  Synopsys DesignWare I2C adapter enabled= 0xffffffff stat=0xffffffff

The i2cdetect tool now did show the Synopsys DesignWare I2C adapter:

i2c-0   i2c             i915 gmbus ssc                          I2C adapter
i2c-1   i2c             i915 gmbus vga                          I2C adapter
i2c-2   i2c             i915 gmbus panel                        I2C adapter
i2c-3   i2c             i915 gmbus dpc                          I2C adapter
i2c-4   i2c             i915 gmbus dpb                          I2C adapter
i2c-5   i2c             i915 gmbus dpd                          I2C adapter
i2c-6   i2c             DPDDC-A                                 I2C adapter
i2c-7   i2c             DPDDC-B                                 I2C adapter
i2c-8   i2c             Synopsys DesignWare I2C adapter         I2C adapter
i2c-9   i2c             Synopsys DesignWare I2C adapter         I2C adapter

The psmouse modules wasn't loaded, yet my touchpad worked fine. And it didn't freeze anymore. Sweet! Adding the acpi_osi="!Windows 2013" must have triggered something in the BIOS, and after removing it again, the BIOS switched the touchpad into I2C mode. I would like to thank Dell Pro support for their help trying to solve this issue. As the acpi_osi="!Windows 2013" option would do the opposite of what I wanted (putting the touchpad in PS2 mode), I wouldn't have added it myself. tl;dr, if your Dell XPS 13 touchpad is in PS2 mode, it will have the freezing problem. To switch it to I2C mode, add the kernel option acpi_osi="!Windows 2013", reboot, then remove that kernel option again, and reboot once more. If you build your own kernel, make sure to enable the required kernel drivers as shown here, and use the Xorg libinput input driver.