[Dell][XPS]Touchscreen fails to function after resume from s3 by Lid close/open

Bug #1632527 reported by AceLan Kao on 2016-10-12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HWE Next
linux (Ubuntu)
AceLan Kao
AceLan Kao
AceLan Kao

Bug Description

Touchscreen fails to function after resume from s3 by Lid close/open

Suspend from power menu/ power button cannot reproduce this issue

1. Install ubuntu 16.04 and boot to OS
2. suspend the system by Lid close action
3. resume the session by Lid open
4. check if touchscreen function works

Expected results: Touchscreen should still works after Lid open

Actual results: Touchscreen fails to work after lid open

CVE References

AceLan Kao (acelankao) wrote :
tags: added: originate-from-1607594 somerville
AceLan Kao (acelankao) wrote :

There is a patch for this issue here
but the patch is based on some commits in 4.6, so it can't be used on ubuntu xenial kernel.

AceLan Kao (acelankao) wrote :

From Mika Westerberg

To backport to kernel 4.4, we need some extra work besides that commit.
   1. 6cee382 ("gpio/pinctrl: sunxi: stop poking around in private vars")
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index db007a3e2af7..6240dd40e8be 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1524,7 +1524,7 @@ bool gpiochip_line_is_irq(struct gpio_chip *chip, unsigned int offset)
        if (offset >= chip->ngpio)
                return false;

- return test_bit(FLAG_USED_AS_IRQ, &chip->gpiodev->descs[offset].flags);
+ return test_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags);

Changed in hwe-next:
status: New → In Progress

The patch from Intel is now in the mainline kernel and tagged for stable: https://marc.info/?l=linux-gpio&m=147679440002043&w=2

Please also make sure that this fix gets into all of these non-OEM Ubuntu releases: 14.04 (with 4.4 kernel), 16.04 and 16.10.

Impact scope includes Dell XPS 13 9350 (SKL) and 9360 (KBL).

AceLan Kao (acelankao) wrote :

Here is the patch

commit c538b9436751a0be2e1246b48353bc23156bdbcc
Author: Mika Westerberg <email address hidden>
Date: Mon Oct 10 16:39:31 2016 +0300

    pinctrl: intel: Only restore pins that are used by the driver

    Dell XPS 13 (and maybe some others) uses a GPIO (CPU_GP_1) during suspend
    to explicitly disable USB touchscreen interrupt. This is done to prevent
    situation where the lid is closed the touchscreen is left functional.

    The pinctrl driver (wrongly) assumes it owns all pins which are owned by
    host and not locked down. It is perfectly fine for BIOS to use those pins
    as it is also considered as host in this context.

    What happens is that when the lid of Dell XPS 13 is closed, the BIOS
    configures CPU_GP_1 low disabling the touchscreen interrupt. During resume
    we restore all host owned pins to the known state which includes CPU_GP_1
    and this overwrites what the BIOS has programmed there causing the
    touchscreen to fail as no interrupts are reaching the CPU anymore.

    Fix this by restoring only those pins we know are explicitly requested by
    the kernel one way or other.

    Cc: <email address hidden>
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=176361
    Reported-by: AceLan Kao <email address hidden>
    Tested-by: AceLan Kao <email address hidden>
    Signed-off-by: Mika Westerberg <email address hidden>
    Signed-off-by: Linus Walleij <email address hidden>

AceLan Kao (acelankao) wrote :

The patchset and testing kernel is here
I don't have the machine until next week, so if someone can help me to verify the kernel,
I can submit the SRU sooner.

Tim Gardner (timg-tpi) on 2016-11-03
Changed in linux (Ubuntu Yakkety):
status: New → Fix Released
Changed in linux (Ubuntu Zesty):
status: In Progress → Fix Released
Changed in linux (Ubuntu Xenial):
status: New → Fix Committed
assignee: nobody → AceLan Kao (acelankao)
AceLan Kao (acelankao) wrote :

The patch has CC'ed stable, so it won't affect the release with kernel newer than 4.6

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
Changed in hwe-next:
status: In Progress → Fix Released
Luis Henriques (henrix) on 2016-11-10
Changed in linux (Ubuntu Xenial):
status: Fix Released → Fix Committed
Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-xenial' to 'verification-done-xenial'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-xenial
AceLan Kao (acelankao) wrote :

Ubuntu kernel 4.4.0-49.70 fixes this issue.

tags: added: verification-done-xenial
removed: verification-needed-xenial

The verification of the Stable Release Update for linux-lts-xenial has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :
Download full text (22.5 KiB)

This bug was fixed in the package linux - 4.4.0-51.72

linux (4.4.0-51.72) xenial; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1644611

  * 4.4.0-1037-snapdragon #41: kernel panic on boot (LP: #1644596)
    - Revert "dma-mapping: introduce the DMA_ATTR_NO_WARN attribute"
    - Revert "powerpc: implement the DMA_ATTR_NO_WARN attribute"
    - Revert "nvme: use the DMA_ATTR_NO_WARN attribute"

linux (4.4.0-50.71) xenial; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1644169

  * xenial 4.4.0-49.70 kernel breaks LXD userspace (LP: #1644165)
    - Revert "UBUNTU: SAUCE: (namespace) fuse: Allow user namespace mounts by
    - Revert "UBUNTU: SAUCE: (namespace) fs: Don't remove suid for CAP_FSETID for
      userns root"
    - Revert "(namespace) Revert "UBUNTU: SAUCE: fs: Don't remove suid for
      CAP_FSETID in s_user_ns""
    - Revert "UBUNTU: SAUCE: (namespace) fs: Allow superblock owner to change
      ownership of inodes"
    - Revert "(namespace) Revert "UBUNTU: SAUCE: fs: Allow superblock owner to
      change ownership of inodes with unmappable ids""
    - Revert "UBUNTU: SAUCE: (namespace) security/integrity: Harden against
      malformed xattrs"
    - Revert "(namespace) Revert "UBUNTU: SAUCE: ima/evm: Allow root in s_user_ns
      to set xattrs""
    - Revert "(namespace) dquot: For now explicitly don't support filesystems
      outside of init_user_ns"
    - Revert "(namespace) quota: Handle quota data stored in s_user_ns in
    - Revert "(namespace) quota: Ensure qids map to the filesystem"
    - Revert "(namespace) Revert "UBUNTU: SAUCE: quota: Convert ids relative to
    - Revert "(namespace) Revert "UBUNTU: SAUCE: quota: Require that qids passed
      to dqget() be valid and map into s_user_ns""
    - Revert "(namespace) vfs: Don't create inodes with a uid or gid unknown to
      the vfs"
    - Revert "(namespace) vfs: Don't modify inodes with a uid or gid unknown to
      the vfs"
    - Revert "UBUNTU: SAUCE: (namespace) fuse: Translate ids in posix acl xattrs"
    - Revert "UBUNTU: SAUCE: (namespace) posix_acl: Export
      posix_acl_fix_xattr_userns() to modules"
    - Revert "(namespace) vfs: Verify acls are valid within superblock's
    - Revert "(namespace) Revert "UBUNTU: SAUCE: fs: Update posix_acl support to
      handle user namespace mounts""
    - Revert "(namespace) fs: Refuse uid/gid changes which don't map into
    - Revert "(namespace) Revert "UBUNTU: SAUCE: fs: Refuse uid/gid changes which
      don't map into s_user_ns""
    - Revert "(namespace) mnt: Move the FS_USERNS_MOUNT check into sget_userns"

linux (4.4.0-49.70) xenial; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1640921

  * Infiniband driver (kernel module) needed for Azure (LP: #1641139)
    - SAUCE: RDMA Infiniband for Windows Azure
    - SAUCE: Makefile RDMA infiniband driver for Windows Azure
    - [Config] Add hv_network_direct.ko to generic inclusion list
    - SAUCE: RDMA Infiniband for Windows Azure is dependent on amd64...

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.