From patchwork Tue Jan 6 21:42:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 5577791 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D8EDABF6C3 for ; Tue, 6 Jan 2015 21:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E4AA201EF for ; Tue, 6 Jan 2015 21:42:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23F392021B for ; Tue, 6 Jan 2015 21:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932555AbbAFVmN (ORCPT ); Tue, 6 Jan 2015 16:42:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50450 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932535AbbAFVmM (ORCPT ); Tue, 6 Jan 2015 16:42:12 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 69FEAAD4B; Tue, 6 Jan 2015 21:42:11 +0000 (UTC) Date: Tue, 6 Jan 2015 22:42:10 +0100 (CET) From: Jiri Kosina To: David Herrmann cc: "open list:HID CORE LAYER" , Adam Goode , Fredrik Hallenberg , Benjamin Tissoires , Dmitry Torokhov , stable Subject: Re: [PATCH] HID: input: fix confusion on conflicting mappings In-Reply-To: Message-ID: References: <1419862886-1319-1-git-send-email-dh.herrmann@gmail.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 6 Jan 2015, David Herrmann wrote: > >> On an PC-101/103/104 keyboard (American layout) the 'Enter' key and its > >> neighbours look like this: > >> > >> +---+ +---+ +-------+ > >> | 1 | | 2 | | 5 | > >> +---+ +---+ +-------+ > >> +---+ +-----------+ > >> | 3 | | 4 | > >> +---+ +-----------+ > > > > [ ... snip ... ] > > > > Alright, I can't really see this introducing any regressions. I have now > > queued this for 3.20. > > As Fredrik wrote, we need to also check for VARIABLE: Gah, that's indeed a good catch. For some reason I don't seem to be CCed on Fredrik's mail :/ I have now applied the patch below on top of for-3.20/upstream, so that we don't keep -next unnecessarily broken. From: Jiri Kosina Subject: [PATCH] HID: fixup the conflicting keyboard mappings quirk The ignore check that got added in 6ce901eb61 ("HID: input: fix confusion on conflicting mappings") needs to properly check for VARIABLE reports as well (ARRAY reports should be ignored), otherwise legitimate keyboards might break. Cc: Fixes: 6ce901eb61 ("HID: input: fix confusion on conflicting mappings") Reported-by: Fredrik Hallenberg Reported-by: David Herrmann Signed-off-by: Jiri Kosina --- drivers/hid/hid-input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 84b6899..a758900 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1113,6 +1113,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct */ if (!(field->flags & (HID_MAIN_ITEM_RELATIVE | HID_MAIN_ITEM_BUFFERED_BYTE)) && + (field->flags & HID_MAIN_ITEM_VARIABLE) && usage->usage_index < field->maxusage && value == field->value[usage->usage_index]) return;