quo / ithc-linux Goto Github PK
View Code? Open in Web Editor NEWLinux driver for Intel Touch Host Controller
Linux driver for Intel Touch Host Controller
I come back after a long period and rebuild this again. But this time I met with a new issue.
[pairman@fedora ithc-linux]$ sudo make dkms-install
mkdir -p /usr/src/`sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`-`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
cp -r dkms.conf Makefile src /usr/src/`sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`-`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
dkms add `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
Creating symlink /var/lib/dkms/ithc/0.1/source -> /usr/src/ithc-0.1
dkms build `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
Sign command: /lib/modules/5.18.11-1.surface.fc36.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Certificate or key are missing, generating self signed certificate for MOK...
Building module:
Cleaning build area...
make -j8 KERNELRELEASE=5.18.11-1.surface.fc36.x86_64 KDIR=/lib/modules/5.18.11-1.surface.fc36.x86_64/build...
Signing module /var/lib/dkms/ithc/0.1/build/build/ithc.ko
At main.c:160:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: crypto/bio/bss_file.c:75
sign-file: /var/lib/dkms/mok.key: No such file or directory
Cleaning build area...
dkms install `sed -n '/^PACKAGE_NAME="\(.*\)"$/s//\1/p' dkms.conf`/`sed -n '/^PACKAGE_VERSION="\(.*\)"$/s//\1/p' dkms.conf`
ithc.ko.xz:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.18.11-1.surface.fc36.x86_64/extra/
depmod....
sync
[pairman@fedora ithc-linux]$
Is there anyway to fix it? surface-secureboot
is already installed. Idk if this causes modprobe errors.
I mentioned this issue here: linux-surface/linux-surface#1014
But after some additional testing I seem to have narrowed it down.My system fails to resume from suspend if all of the following occur:
To narrow down the issue I installed the ithc kernel module with the generic kernel, not the surface kernel.
Strangely, if I either blacklist the ITHC kernel module, or use Gnome on Wayland, or switch from Nvidia to integrated graphics, I don't seem to have the issue where I fail to resume from suspend. Any clue what is going on or how to debug this?
I had failure to resume issues on both Ubuntu and Pop_OS!, both 22.04 versions, with the surface kernel, ithc module, and nvidia (hybrid) graphics on a surface laptop studio with dGPU. But I have only narrowed the issue down to the 3 items above on Pop OS with kernel version 6.0.6-76060006-generic, with the nvidia dkms 525 driver version. I did try other nvidia versions and was still having failure to resume issues.
Thank you!
so I'm really new to linux, and linux on a surface.
i managed to install dkms and the headers, but when i try
sudo make dkms-install
it outputs
make: *** No rule to make target 'dkms-install'. Stop.
I’m trying to get my CPU to throttle at least a bit while using touch, and as part of that try to understand what ithc does. I noticed that it calls cpu_latency_qos_update_request()
, and resets the value after a timeout. However, if I understand correctly, this is currently resetting to the wrong default value.
See torvalds/linux:include/linux/pm_qos.h
, and src/ithc-main.c#L248
As stated elsewhere, I’m travelling and did not bring my Surface with me, I’ll test this once I return and submit a merge request after that.
Please advice whether I understood your code correctly ;)
If you've tested the driver and it doesn't work, please open a new issue if one doesn't already exist for your device.
If the driver works (or at least appears to do something in dmesg), please reply here with the following information (especially if the device still has question marks in the table below or is not listed at all):
sudo dmesg
(or at least the output of sudo dmesg | grep -Ei 'ithc|linux version|dmi:|class 0x0901'
).intremap=nosid
, poll
, or any other workarounds.Device | PCI VID:DID | Subsystem VID:DID | Touch VID:PID | Notes |
---|---|---|---|---|
Surface Pro 7+ | 8086:a0d0 | 1414:0056 | 045e:0c1a | Requires nosid |
Surface Pro 8 | 8086:a0d0 | 1414:0055 | 045e:0c37 | Requires nosid |
Surface Pro 9 | 8086:51d0 | 1414:0064 | 045e:0c52 | nosid not needed |
Surface Pro 10 | 8086:7e49 | 1414:0086 | 045e:0c7f | QuickSPI mode |
Surface Laptop 4 | 8086:a0d0 | 1414:0052, 1414:0053 | 045e:0c31 | Requires nosid |
Surface Laptop 5 | 8086:51d0 | 1414:0071 | 045e:0c59 | nosid not needed |
Surface Laptop 6 | 8086:7e49 | 1414:0089, 1414:0090 | 045e:0c88, 045e:0c89 | QuickSPI mode |
Surface Laptop Studio | 8086:a0d0 | 1414:0049 | 045e:0c1b | Requires nosid |
Surface Laptop Studio 2 Touchscreen | 8086:51d0 | 1414:0077 | 045e:0c5d | QuickSPI mode |
Surface Laptop Studio 2 Touchpad | 8086:51d1 | 8086:7270 | 045e:0c46 | QuickSPI mode |
Lenovo X1 Fold | 8086:98d0 | none | 056a:5102 | Requires nosid , does not need iptsd |
Intel NUC M15 LAPBC510/LAPBC710 (aka XPG Xenia Xe, Schenker VISION 15, Avell B.ON, ...) |
8086:a0d0 | 8086:2097 | ? | ? |
Intel NUC M15 LAPRC710 | 8086:51d0 | none | ? | ? |
HP ENVY x360 | 8086:51d0 | 103c:8a28 | ? | ? |
Raw config samples:
state bufsizes touchcfg "$TIC" spicfg pid vid rev fwid? fwmode
SP7+ e0000402 00000000 000a00ff 0000001c 0000001c 43495424 fda00a2e 0c1a045e 00000001 05008a8b 00000000 00000000 00000000 0404035e 000001c0 00000002
SP8 e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0c3c4bea fb190781 00000000 e8d1154a 00040302 62f02ab8 628c8830
SP9 e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3f5e8 0c52045e 00000001 c0d97627 fd3b7fc1 00000000 9ec337a3 00040302 64dec79e 58095491
SL4 e0000402 00000000 000a00ff 0000001c 0000001c 43495424 ffa00a28 0c31045e 00000001 0700648b 00000000 00000000 00000000 0404035e 000001c0 00000002
SL5 e0000002 00000000 001fc0ff 00000010 00000014 43495424 09e3d2e8 0c59045e 00000001 30354141 5e7b5d98 00000000 b9be6b38 00040302 c8c4c4e1 0592c2fb
SLS e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3a3e8 0c1b045e 00000001 473e2e89 7030bc6f 00000000 a2a137f3 00040302 70159f6b 47ed5bb1
X1Fold e0000002 00000000 0001c08b 00000004 00000014 43495424 70060a6a 5102056a 00000001 00040050 00000000 00000000 00000000 0004035e 00000000 00000000
DKMS-Install command cannot use duplicately (I do not know if this kind of problem also occured to non-DKMS approch)
so in order to reinstall I have to remove dkms module first
maybe we should edit the README.md
here is my initial suggestion
from
Installation with DKMS
----------------------
- Install prerequisites (e.g. Debian packages: `dkms` and `linux-headers-amd64`)
- `sudo make dkms-install`
- `sudo modprobe ithc` (or reboot)
- Check dmesg for ithc messages/errors.
to
Installation with DKMS
----------------------
- Install prerequisites (e.g. Debian packages: `dkms` and `linux-headers-amd64`)
- `sudo make dkms-install` (in order to re-install, you have to run `sudo make dkms-uninstall` first (ignore any error))
- `sudo modprobe ithc` (or reboot)
- Check dmesg for ithc messages/errors.
Hi
First thanks a lot for your amazing work !
I've compiled ithc on nixos. When I load the module with insmod, the ithc
module appears in lsmod
but it is also listed in hid
.
Mouse clicks are working even if I do not use iptsd. I thought that when hid was not passed as an option it would not have worked.
However it is acting weird:
System: Fedora Workstation Edition 36
Device: Surface Pro 7+
Is there a guide for building ithc-linux on Fedora 36? I tried to build but got these error messages:
[pairman@fedora ithc-linux]$ sudo make && sudo make install
[sudo] password for pairman:
mkdir -p build
find build/ -type l -exec rm {} +
ln -sr src/* build/
make -C /lib/modules/`uname -r`/build M=/home/pairman/Downloads/ithc-linux/build
make[1]: Entering directory '/usr/src/kernels/5.17.9-2.surface.fc36.x86_64'
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `if [ "gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)" != ""gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)"" ]; then \'
make[1]: *** [Makefile:1727: prepare] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.17.9-2.surface.fc36.x86_64'
make: *** [Makefile:8: default] Error 2
[pairman@fedora ithc-linux]$
Thanks in advance.
Not sure if I'm installing correctly. Never used dkms. I git cloned the repository then just ran dkms install 'path to dkms.conf file' but can't modprobe it afterwards.
When IPTSD in used and pen is near screen, hibernate and resume make driver got hang.
Also linux-surface/linux-surface#752 (comment)
I've also seen that sometimes the driver stops working if multitouch is toggled while pen is active.
Possible workaround is to trigger a reset with:
echo x | sudo tee /sys/kernel/debug/ithc/cmd
Or reload the driver with:
sudo modprobe -r ithc; sudo modprobe ithc
(iptsd must be stopped first)
From #9 (#9 (comment))
(Sorry I think this comment I should move and further telling into new issues instead)
Trying on SLS surface kernel Ubuntu 22.04 LTS both X11/Wayland
For short only last workaround worked
here [dmesg_tail.log](https://github.com/quo/ithc-linux/files/8826725/dmesg_tail.log)
PS: this is about driver hang after resuming from hibernation
PS2: "When IPTSD in used and pen is near screen, hibernate and resume make driver got hang." not only that condition, even pen is not active or iptsd is not running, it also happens see the regularly updated comment [here](https://github.com/quo/ithc-linux/issues/8#issuecomment-1146105769)
Originally posted by @NP-chaonay in #9 (comment)
when executing the command:
sudo make dkms-install
I allways get following error:
make: *** No rule to make target 'dkms-install'. Stop.
I have installed "dkms" and "kernel-devel kernel-headers" (because I could not find and install "linux-headers-amd64").
When trying to write with the Surface Pen on Surface Pro 7+ using the latest ithc driver (with enabled hid) with linux-surface iptsd on Fedora, the driver stops working with [ 82.626291] ithc 0000:00:10.6: ithc_dma_rx_process_buf: hid_input_report failed with -1
in dmesg.
I’m having troubles getting the touchscreen on a Surface Pro 9 to work. I tested linux-surface kernels 6.3.2, 6.2.13 and 6.1.12 from the [linux-surface]
repository on Arch Linux, in all combinations of intel_iommu
and intremap
settings.
dmesg | grep ithc
outputs the following:
[ 12.583823] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[ 12.815479] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 0ce3d2e8 0c52045e 00000001 f5e81be4 002fcb5b 00000000 a404acd8 00040302 460a0c60 a78e200a
[ 12.822904] ithc 0000:00:10.6: invalid dma rx data! channel 1, buffer 0, size 1360, code 0, data size 0
[ 13.847092] ithc 0000:00:10.6: ithc_start: hid_add_device failed with -110
[ 13.847101] ithc: probe of 0000:00:10.6 failed with error -110
Before wiping Windows off, I still installed the currently newest version of firmware (SurfacePro9_Win11_22621_23.044.40352.0.msi
) - was that a mistake?
(not sure whether this belongs here, or into linux-surface, please transfer the issue if appopriate)
The IOMMU gives the following error when trying to use the irq:
DMAR: DRHD: handling fault status reg 2
DMAR: [INTR-REMAP] Request device [01:05.0] fault index 0x2f [fault reason 0x26] Blocked an interrupt request due to source-id verification failure
No clue how to fix this. May be an ACPI bug?
Secure Boot-enabled machines require a module to be signed with enrolled MOK keys--the dkms installation is signing the modules, but seemingly with improper keys, as modprobe fails due to the used keys not being enrolled.
Hi there, i installed the module on Surface pro 8 on Ubuntu and when checking it with dmesg got this output
jackgrey@jackgrey-Surface-Pro-8:~/ithc-linux$ sudo dmesg | grep ithc
[ 1.694464] ithc: loading out-of-tree module taints kernel.
[ 1.694484] ithc: module verification failed: signature and/or required key missing - tainting kernel
[ 1.696822] ithc 0000:00:10.6: enabling device (0000 -> 0002)
[ 1.916007] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0cbc4bea fb190781 00000000 e8919552 00040302 62f12ab8 628c8830
[ 1.916455] ithc 0000:00:10.6: registered device ithc
[ 1734.766353] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 08e300e8 0c37045e 00000001 0cb84bea fb190781 00000000 e891175a 00040302 62f12ab8 628c8838
[ 1734.767149] ithc 0000:00:10.6: registered device ithc
any solution?
Hi Quo,
Just wanted to give you a heads up, seems the ithc driver, while installed in my KDE Neon 5.25 (Ubuntu 20.04, Kernel 5.19.2), it no longer detects a touch input. It worked well during the 5.18.x kernels (although these ones gave me trouble with virtualbox, but that's unrelated), and also pefectly with 5.17.x, but since the upgrade to 5.19.x, there's now trouble...could you take a look to it?
Thanks so much!
I get these errors: when I run "make && sudo make install"
mkdir -p build
find build/ -type l -exec rm {} +
ln -sr src/* build/
make -C /lib/modules/uname -r
/build M=/home/number6/ithc-linux/build
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-30-generic'
make -C /lib/modules/uname -r
/build M=/home/number6/ithc-linux/build modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
INSTALL /lib/modules/5.15.0-30-generic/extra/ithc.ko
SIGN /lib/modules/5.15.0-30-generic/extra/ithc.ko
At main.c:160:
Do you know how I might be able to fix this?
I installed ithc from git commit 02bf0eb using the dkms instructions. However, I have no touchscreen device listed under my libinput list, and ithc
module is printing out some suspicious errors (sudo dmesg | grep -i ithc
):
[ 767.498937] ithc 0000:00:10.6: config: e0000002 00000000 001fc0ff 00000010 00000014 43495424 0de37ae8 0c1b045e 00000001 34fb1951 22fabca3 00000000 f48e9377 00040302 969ee474 53119add
[ 767.499665] ithc 0000:00:10.6: registered device ithc
[ 768.521677] ithc 0000:00:10.6: ithc_probe: hid_add_device failed with -110
[ 768.521693] ithc: probe of 0000:00:10.6 failed with error -110
I have tried re-initializing the module after startup with modprobe -r ithc && modprobe ithc
. After doing this, it prints the same output/error.
uname -a
:
Linux daniel-surface 6.0.1-arch2-1-surface #1 SMP PREEMPT_DYNAMIC Fri, 14 Oct 2022 15:47:45 +0000 x86_64 GNU/Linux
Hardware: Microsoft Surface Laptop Studio, i7 16GB
Operating System: Arch Linux (rolling)
The THC doesn't seem to draw a significant amount of power as is, but it would still be nice to implement all the low power stuff the Windows driver does.
So I recently got a SP8 and installed arch with the linux-surface on it.
I now want to try to enable the touchscreen and pen, but before I potentially break anything, I wanted to ask if the process I'll be doing is correct.
I'd do the following:
and hope that does everything
Is this all I have to do, or have I missed something?
It's my first time compiling and installing, so I want to make sure I don't make any mistakes that might cost me time.
Pen left click/hover work (doesnt test if detect as mouse or pen); MultiTouch dont work but logged in dmesg as msg "ithc 0000:00:10.6: truncated prd" when touch is done. (see below)
Will these drivers eventually be roled into surface-kernel
and then mainline linux
?
Thank you so much for your work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.