Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1350738ybl; Wed, 14 Aug 2019 15:28:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwS9GCDmguc6OLJiPKhHlHNuAapFDstjJLKyDgM5zUemACT4jqay3OcMrKMoN6kvlnhRHam X-Received: by 2002:aa7:90c9:: with SMTP id k9mr2168047pfk.171.1565821731684; Wed, 14 Aug 2019 15:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565821731; cv=none; d=google.com; s=arc-20160816; b=k+CWAEL/BExRFlxmyZTktXgOetfb5SCXDqzzueQ03Y4Ggz7sY+PXdHZATTVN9QIXCM RwXVclvqyHq3sqiQ99Sc+Q240ip+V4qSoCMNmlPOeDBGTju9W95OCOo/ivBUmbgDgZQD INhd6V9ibGSVWHV6fLthJKn6JNMbdDb4f3O+1cIlGRJ110VLeei2ILjxh0xQbfdmWgqX 4r/m1SXZQE3W36cCdZB3clxr/pEL9z3WqXq95TVub1aJal+anTk1wKi4qxC0yjuAseDa Crw0ac5Q9D/cjvhyEp8N6ZcOsR1xxD4iCSwbeKXfdR+5/KxrpG8zdLjhjbzARgBhjbiO TsxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FLFblGnxzQ1wI2QM5HelENy2vNVHmhf51uAkZDB+jpI=; b=1FdKkzb/PQgtgyLqAm3EldGrpB7FcAadm5GiYM1cxlqDMK7Xz7DHyDCDadZWaH64Ff uiVHqPS1nVE0LM2CXBwZg5H2C5ixQbeHeL1OcgjhqCZaSfKXTXSJJJMW7m5sOIynv7Om IYgSYb4JFtJvpkZtLaTHyDc338N0gqaRiM9xurMXwmMOudU7FraSbsqrxyphYHecftKw g9mnn7yHd9mfL6P5CdjSK0KrZfTACmV8p80uqaP4xJ+7P6rIuhHE+dHbxAU5oqdIrHZM W1BCY5duzqnoIikYv8B70PUC+7E9QLGrZlssq+BIko9d6VUAhYXJl9ZJIlcnwB3Mt+cD PCdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T6rUo53R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si567649pff.220.2019.08.14.15.28.35; Wed, 14 Aug 2019 15:28:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T6rUo53R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729720AbfHNWG3 (ORCPT + 99 others); Wed, 14 Aug 2019 18:06:29 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33737 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727975AbfHNWG3 (ORCPT ); Wed, 14 Aug 2019 18:06:29 -0400 Received: by mail-pg1-f196.google.com with SMTP id n190so305654pgn.0; Wed, 14 Aug 2019 15:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FLFblGnxzQ1wI2QM5HelENy2vNVHmhf51uAkZDB+jpI=; b=T6rUo53R9JDRHIkMfoGdrnDrsfMPkMGgqRTP3o5lVIOOcp2qrBarQDVb1rpfBmja8n hb29IYPLiS+4SjkOcCclg6MMZoxlIVyTqswgEgSR7V8KdraVWdIS/Y9f7EuAGynkNAUW q7mxLhX+gUtvRob9dALNvXjLvJG5SmqDsEzgqhzg+mcldPILPgMEgQ9DisII1gmhy1CL btdIuPVtWn3qLlsf15RY2HYGl/QYNwAKfpBflkrRimTHbAPcEzBdlCUpDqEI8N1wIQSP Xy9dZAyXPOS14n1PtzcJdAys2fGt8RKD+ZON5r/jZSwRi0T4BB1FTRf33dgs6plfiXK6 LSHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FLFblGnxzQ1wI2QM5HelENy2vNVHmhf51uAkZDB+jpI=; b=eh/L90nKRH9z2jqp8p0wGn7B1Vs8g4S5WA3MjPQTNQIiu8niW4CrwE8VDLzKZA+wEI UJXtzgpP21AYm9aendTIXQRe+t58+TRMgbGtyMeOfb6YRTsmXo79fNL9tesOcUp6OPLC w/infUNvQ6O2MxYdZdriWBoQMvEFEaFyTZ07RiwnS5VAsyfieVev2WRdCzpv9SqgI688 RZSGQzidNkzxwBwcgB63iiXeHAxG/s2rbIEYISS7gqXmOAZE8o2K9nb8LS6IorvsqWx7 XgTfJdniHmkExS4XrixNSI7Oev8jiDmAh6EriboAfrd5jK8Ik6FqJQbt5kAJxIeF8D5B Wq6Q== X-Gm-Message-State: APjAAAWA4Y/cguNq3u0Zau0q4PdL6pD+gCGDBYu+7DJnnOnov8/SvcjJ 1XdNEDG2+6h8zKSjNTVF58LWYbYy X-Received: by 2002:a63:40a:: with SMTP id 10mr1072437pge.317.1565820388356; Wed, 14 Aug 2019 15:06:28 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id i9sm5475pjj.2.2019.08.14.15.06.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 15:06:27 -0700 (PDT) Date: Wed, 14 Aug 2019 15:06:25 -0700 From: Dmitry Torokhov To: Nicolas Boichat Cc: Fei Shao , linux-arm Mailing List , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Ting Shen , Brian Norris , "open list:HID CORE LAYER" , lkml Subject: Re: [PATCH] Input: cros_ec_keyb: Add back missing mask for event_type Message-ID: <20190814220625.GD121898@dtor-ws> References: <20190813093821.74158-1-fshao@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 05:47:22PM +0800, Nicolas Boichat wrote: > On Tue, Aug 13, 2019 at 5:38 PM Fei Shao wrote: > > > > In the previous patch we didn't mask out event_type in case statement, > > so switches are always picked instead of buttons, which results in > > ChromeOS devices misbehaving when power button is pressed. > > This patch adds back the missing mask. > > > > Fixes: d096aa3eb604 ("Input: cros_ec_keyb: mask out extra flags in event_type") > > Signed-off-by: Fei Shao > > Reviewed-by: Nicolas Boichat Applied, thank you. > > > --- > > drivers/input/keyboard/cros_ec_keyb.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c > > index 38cb6d82d8fe..bef7bee6f05e 100644 > > --- a/drivers/input/keyboard/cros_ec_keyb.c > > +++ b/drivers/input/keyboard/cros_ec_keyb.c > > @@ -226,6 +226,8 @@ static int cros_ec_keyb_work(struct notifier_block *nb, > > { > > struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb, > > notifier); > > + uint8_t mkbp_event_type = ckdev->ec->event_data.event_type & > > + EC_MKBP_EVENT_TYPE_MASK; > > u32 val; > > unsigned int ev_type; > > > > @@ -237,7 +239,7 @@ static int cros_ec_keyb_work(struct notifier_block *nb, > > if (queued_during_suspend && !device_may_wakeup(ckdev->dev)) > > return NOTIFY_OK; > > > > - switch (ckdev->ec->event_data.event_type & EC_MKBP_EVENT_TYPE_MASK) { > > + switch (mkbp_event_type) { > > case EC_MKBP_EVENT_KEY_MATRIX: > > pm_wakeup_event(ckdev->dev, 0); > > > > @@ -264,7 +266,7 @@ static int cros_ec_keyb_work(struct notifier_block *nb, > > case EC_MKBP_EVENT_SWITCH: > > pm_wakeup_event(ckdev->dev, 0); > > > > - if (ckdev->ec->event_data.event_type == EC_MKBP_EVENT_BUTTON) { > > + if (mkbp_event_type == EC_MKBP_EVENT_BUTTON) { > > val = get_unaligned_le32( > > &ckdev->ec->event_data.data.buttons); > > ev_type = EV_KEY; > > -- > > 2.23.0.rc1.153.gdeed80330f-goog -- Dmitry