From owner-svn-src-all@freebsd.org Sat Jan 27 16:36:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE44ECA6F7; Sat, 27 Jan 2018 16:36:07 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5896F592; Sat, 27 Jan 2018 16:36:07 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CCF5523B; Sat, 27 Jan 2018 16:36:07 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0RGa7BF087686; Sat, 27 Jan 2018 16:36:07 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0RGa7lc087685; Sat, 27 Jan 2018 16:36:07 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201801271636.w0RGa7lc087685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 27 Jan 2018 16:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328481 - stable/11/sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: stable/11/sys/dev/atkbdc X-SVN-Commit-Revision: 328481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jan 2018 16:36:08 -0000 Author: dumbbell Date: Sat Jan 27 16:36:06 2018 New Revision: 328481 URL: https://svnweb.freebsd.org/changeset/base/328481 Log: psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set In psmprobe(), we set the initial `syncmask` to the vendor default value if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only set it for the Elantech touchpad later in psmattach(), thus `syncmask` is always configured. Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set. This fixes Elantech touchpad support for units which have `hascrc` set. To clarify that, when we log the `syncmask` and `syncbits` fields, also mention if they are actually used. Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS` flag. PR: 225338 MFC of: r328190 Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Sat Jan 27 16:34:00 2018 (r328480) +++ stable/11/sys/dev/atkbdc/psm.c Sat Jan 27 16:36:06 2018 (r328481) @@ -1947,8 +1947,10 @@ psmattach(device_t dev) /* Elantech trackpad`s sync bit differs from touchpad`s one */ if (sc->hw.model == MOUSE_MODEL_ELANTECH && - (sc->elanhw.hascrc || sc->elanhw.hastrackpoint)) + (sc->elanhw.hascrc || sc->elanhw.hastrackpoint)) { sc->config |= PSM_CONFIG_NOCHECKSYNC; + sc->flags &= ~PSM_NEED_SYNCBITS; + } if (!verbose) printf("psm%d: model %s, device ID %d\n", @@ -1959,8 +1961,9 @@ psmattach(device_t dev) sc->hw.hwid >> 8, sc->hw.buttons); printf("psm%d: config:%08x, flags:%08x, packet size:%d\n", unit, sc->config, sc->flags, sc->mode.packetsize); - printf("psm%d: syncmask:%02x, syncbits:%02x\n", - unit, sc->mode.syncmask[0], sc->mode.syncmask[1]); + printf("psm%d: syncmask:%02x, syncbits:%02x%s\n", + unit, sc->mode.syncmask[0], sc->mode.syncmask[1], + sc->config & PSM_CONFIG_NOCHECKSYNC ? " (sync not checked)" : ""); } if (bootverbose) @@ -2976,7 +2979,8 @@ psmintr(void *arg) VLOG(2, (LOG_DEBUG, "psmintr: Sync bytes now %04x,%04x\n", sc->mode.syncmask[0], sc->mode.syncmask[0])); - } else if ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { + } else if ((sc->config & PSM_CONFIG_NOCHECKSYNC) == 0 && + (c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { VLOG(3, (LOG_DEBUG, "psmintr: out of sync " "(%04x != %04x) %d cmds since last error.\n", c & sc->mode.syncmask[0], sc->mode.syncmask[1],