2019-06-14 06:56:43

by Ting Shen

[permalink] [raw]
Subject: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
the event_type field, the receiver side should mask out this extra bit when
processing the event.

Signed-off-by: Ting Shen <[email protected]>

---

drivers/input/keyboard/cros_ec_keyb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index d5600118159835..38cb6d82d8fe67 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -237,7 +237,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) {
+ switch (ckdev->ec->event_data.event_type & EC_MKBP_EVENT_TYPE_MASK) {
case EC_MKBP_EVENT_KEY_MATRIX:
pm_wakeup_event(ckdev->dev, 0);

--
2.22.0.rc2.383.gf4fbbf30c2-goog


2019-06-14 18:30:21

by Enrico Granata

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

On Thu, Jun 13, 2019 at 11:54 PM Ting Shen <[email protected]> wrote:
>
> http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> the event_type field, the receiver side should mask out this extra bit when
> processing the event.
>
> Signed-off-by: Ting Shen <[email protected]>

Reviewed-by: Enrico Granata <[email protected]>

>
> ---
>
> drivers/input/keyboard/cros_ec_keyb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index d5600118159835..38cb6d82d8fe67 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -237,7 +237,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) {
> + switch (ckdev->ec->event_data.event_type & EC_MKBP_EVENT_TYPE_MASK) {
> case EC_MKBP_EVENT_KEY_MATRIX:
> pm_wakeup_event(ckdev->dev, 0);
>
> --
> 2.22.0.rc2.383.gf4fbbf30c2-goog
>

2019-06-14 18:56:08

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

On Fri, Jun 14, 2019 at 11:27:03AM -0700, Enrico Granata wrote:
> On Thu, Jun 13, 2019 at 11:54 PM Ting Shen <[email protected]> wrote:
> >
> > http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> > the event_type field, the receiver side should mask out this extra bit when
> > processing the event.
> >
> > Signed-off-by: Ting Shen <[email protected]>
>
> Reviewed-by: Enrico Granata <[email protected]>

EC_MKBP_EVENT_TYPE_MASK is not in Linus' tree. It would be better to
merge this path through whatever tree that is bringing in that
definition.

Acked-by: Dmitry Torokhov <[email protected]>

Thanks.

--
Dmitry

2019-06-14 19:10:30

by Benson Leung

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

Hi Dmitry,

On Fri, Jun 14, 2019 at 11:55:33AM -0700, Dmitry Torokhov wrote:
> On Fri, Jun 14, 2019 at 11:27:03AM -0700, Enrico Granata wrote:
> > On Thu, Jun 13, 2019 at 11:54 PM Ting Shen <[email protected]> wrote:
> > >
> > > http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> > > the event_type field, the receiver side should mask out this extra bit when
> > > processing the event.
> > >
> > > Signed-off-by: Ting Shen <[email protected]>
> >
> > Reviewed-by: Enrico Granata <[email protected]>
>
> EC_MKBP_EVENT_TYPE_MASK is not in Linus' tree. It would be better to
> merge this path through whatever tree that is bringing in that
> definition.
>
> Acked-by: Dmitry Torokhov <[email protected]>

Yup, this looks like it's coming in through Lee's MFD tree, a series from
Gwendal to update cros_ec_commands.h.

784dd15c930f mfd: cros_ec: Fix event processing API

That commit is in the immutable branch for v5.3 here:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-cros-v5.3

I'd recommend the chrome-platform tree since we'll be pulling in that IB too
for some other refactoring Enric is working on.

Thanks,
Benson

>
> Thanks.
>
> --
> Dmitry

--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]


Attachments:
(No filename) (1.37 kB)
signature.asc (235.00 B)
Download all attachments

2019-06-14 19:19:48

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

On Fri, Jun 14, 2019 at 12:09:57PM -0700, Benson Leung wrote:
> Hi Dmitry,
>
> On Fri, Jun 14, 2019 at 11:55:33AM -0700, Dmitry Torokhov wrote:
> > On Fri, Jun 14, 2019 at 11:27:03AM -0700, Enrico Granata wrote:
> > > On Thu, Jun 13, 2019 at 11:54 PM Ting Shen <[email protected]> wrote:
> > > >
> > > > http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> > > > the event_type field, the receiver side should mask out this extra bit when
> > > > processing the event.
> > > >
> > > > Signed-off-by: Ting Shen <[email protected]>
> > >
> > > Reviewed-by: Enrico Granata <[email protected]>
> >
> > EC_MKBP_EVENT_TYPE_MASK is not in Linus' tree. It would be better to
> > merge this path through whatever tree that is bringing in that
> > definition.
> >
> > Acked-by: Dmitry Torokhov <[email protected]>
>
> Yup, this looks like it's coming in through Lee's MFD tree, a series from
> Gwendal to update cros_ec_commands.h.
>
> 784dd15c930f mfd: cros_ec: Fix event processing API
>
> That commit is in the immutable branch for v5.3 here:
> git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-cros-v5.3
>
> I'd recommend the chrome-platform tree since we'll be pulling in that IB too
> for some other refactoring Enric is working on.

Yeah, I'm fine with this going through chrome-platform.

Thanks.

--
Dmitry

2019-06-14 19:33:03

by Benson Leung

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type

Hi Ting,
On Fri, Jun 14, 2019 at 02:54:38PM +0800, Ting Shen wrote:
> http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> the event_type field, the receiver side should mask out this extra bit when
> processing the event.
>
> Signed-off-by: Ting Shen <[email protected]>
>
Reviewed-by: Benson Leung <[email protected]>

Looks good for chrome-platform, once ib-mfd-cros-v5.3 is merged.

Thanks,
Benson

--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]


Attachments:
(No filename) (584.00 B)
signature.asc (235.00 B)
Download all attachments

2019-06-18 08:43:53

by Enric Balletbo i Serra

[permalink] [raw]
Subject: Re: [PATCH] Input: cros_ec_keyb: mask out extra flags in event_type



On 14/6/19 8:54, Ting Shen wrote:
> http://crosreview.com/1341159 added a EC_MKBP_HAS_MORE_EVENTS flag to
> the event_type field, the receiver side should mask out this extra bit when
> processing the event.
>
> Signed-off-by: Ting Shen <[email protected]>
>
> ---
>
> drivers/input/keyboard/cros_ec_keyb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index d5600118159835..38cb6d82d8fe67 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -237,7 +237,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) {
> + switch (ckdev->ec->event_data.event_type & EC_MKBP_EVENT_TYPE_MASK) {
> case EC_MKBP_EVENT_KEY_MATRIX:
> pm_wakeup_event(ckdev->dev, 0);
>
>

Applied for chrome-platform-5.3

Thanks,
~ Enric