Re: Elantech Clickpad (pms0) stopped working on current

2015-06-07 Thread Alexey Suslikov
Stefan Sperling stsp at stsp.name writes:

 - if (((fw_version  0x0f)  16)  6)
 + if (((fw_version  0x0f)  16) != 6 
 + (fw_version  0x0f)  16 != 8)

fw_version  0x0f)  16 is repeating twice
(at least).

Is it good idea to turn above magic into a macro
with meaningful name?



Elantech Clickpad (pms0) stopped working on current

2015-06-06 Thread Remi Locherer
Synopsis:  Elantech Clickpad (pms0) stopped working on current
Category:  kernel
Environment:
System  : OpenBSD 5.7
Details : OpenBSD 5.7-current (GENERIC.MP) #1046: Fri Jun  5 
13:25:01 MDT 2015
 
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Architecture: OpenBSD.amd64
Machine : amd64
Description:
When I try to use the touchpad on my noteboot the below messages are
shown in xconsole and dmesg. The mouse pointer does not react anymore to
movements on the touchpad.

Affected devic:
pms0: Elantech Clickpad, version 4, firmware 0x575f03

I first noticed this with the snapshot kernel from May 31. With the kernel
from June 5 it's the same. The touchpad was working fine with the snapshot
from May 23.

pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: not in sync yet, discard input (state 0)
pms0: unknown packet type 0x3
pms0: unknown packet type 0x3
pms0: unknown packet type 0x3
pms0: unknown packet type 0x13
pms0: unknown packet type 0x3
pms0: unknown packet type 0x3
pms0: unknown packet type 0x3
pms0: unknown packet type 0x13
pms0: unknown packet type 0x3
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: unknown packet type 0x18
pms0: unknown packet type 0x18
pms0: unknown packet type 0x18
pms0: unknown packet type 0x8
pms0: unknown packet type 0x18
pms0: unknown packet type 0x18
pms0: unknown packet type 0x8
pms0: unknown packet type 0x18
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: unknown packet type 0x5
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: unknown packet type 0x15
pms0: unknown packet type 0x15
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: unknown packet type 0x1
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)
pms0: not in sync yet, discard input (state 0)



How-To-Repeat:
Use an Elantech Clickpad, version 4, firmware 0x575f03 with
snapshot from June 5.

Fix:
Workaround: use snapshot from May 23.


dmesg:
OpenBSD 5.7-current (GENERIC.MP) #1046: Fri Jun  5 13:25:01 MDT 2015
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3881746432 (3701MB)
avail mem = 3760226304 (3586MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xe0970 (63 entries)
bios0: vendor Phoenix Technologies Ltd. version P00ACX date 04/26/2013
bios0: SAMSUNG ELECTRONICS CO., LTD. 900X3F
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC SSDT ASF! HPET APIC MCFG FPDT SSDT SSDT UEFI MSDM 
UEFI UEFI
acpi0: wakeup devices P0P1(S4) GLAN(S4) XHC_(S4) HDEF(S4) PXSX(S4) RP01(S4) 
PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP06(S4) 
PXSX(S4) RP07(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.39 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.15 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.15 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2

Re: Elantech Clickpad (pms0) stopped working on current

2015-06-06 Thread Remi Locherer
On Sat, Jun 06, 2015 at 10:47:19AM +0200, Stefan Sperling wrote:
 On Sat, Jun 06, 2015 at 10:21:59AM +0200, Remi Locherer wrote:
  Synopsis:  Elantech Clickpad (pms0) stopped working on current
  Category:  kernel
  Environment:
  System  : OpenBSD 5.7
  Details : OpenBSD 5.7-current (GENERIC.MP) #1046: Fri Jun  5 
  13:25:01 MDT 2015
   
  dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
  
  Architecture: OpenBSD.amd64
  Machine : amd64
  Description:
  When I try to use the touchpad on my noteboot the below messages are
  shown in xconsole and dmesg. The mouse pointer does not react anymore to
  movements on the touchpad.
  
  Affected devic:
  pms0: Elantech Clickpad, version 4, firmware 0x575f03
  
  I first noticed this with the snapshot kernel from May 31. With the kernel
  from June 5 it's the same. The touchpad was working fine with the snapshot
  from May 23.
 
 This was probably caused by pms.c commit r1.61 which enabled touchpad
 support for newer elantech devices using firmware versions 0xX8.
 
 Your device (firmware version 0xX7) was not matched before but matches
 now because of the way the new matching check was written. Can you try this
 diff to see if it restores previous behaviour for your device?


After applying this patch I can use the touchpad again. Thanks!


 Index: pms.c
 ===
 RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
 retrieving revision 1.61
 diff -u -p -r1.61 pms.c
 --- pms.c 25 May 2015 15:04:26 -  1.61
 +++ pms.c 6 Jun 2015 08:37:41 -
 @@ -1840,7 +1840,8 @@ elantech_get_hwinfo_v4(struct pms_softc 
   if (synaptics_query(sc, ELANTECH_QUE_FW_VER, fw_version))
   return (-1);
  
 - if (((fw_version  0x0f)  16)  6)
 + if (((fw_version  0x0f)  16) != 6 
 + (fw_version  0x0f)  16 != 8)
   return (-1);
  
   elantech-fw_version = fw_version;