Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1613896 > unrolled thread

Re: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap for hotkey event generation

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-03-31 13:30 +0200
Last post2017-04-02 11:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap  for hotkey event generation Michał Kępień <kernel@kempniu.pl> - 2017-03-31 13:30 +0200
    Re: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap  for hotkey event generation Darren Hart <dvhart@infradead.org> - 2017-04-01 22:10 +0200
      Re: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap  for hotkey event generation Jonathan Woithe <jwoithe@just42.net> - 2017-04-02 11:10 +0200

#1613896 — Re: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap for hotkey event generation

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-31 13:30 +0200
SubjectRe: [PATCH 6/8] platform/x86: fujitsu-laptop: use a sparse keymap for hotkey event generation
Message-ID<tr2UG-3Xe-35@gated-at.bofh.it>
> @@ -1098,14 +1075,8 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
>  	 * handled in software; its state is queried using FUNC_FLAGS
>  	 */
>  	if ((fujitsu_laptop->flags_supported & BIT(26)) &&
> -	    (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26))) {
> -		keycode = KEY_TOUCHPAD_TOGGLE;
> -		input_report_key(input, keycode, 1);
> -		input_sync(input);
> -		input_report_key(input, keycode, 0);
> -		input_sync(input);
> -	}
> -
> +	    (call_fext_func(FLAG_RFKILL, 0x1, 0x0, 0x0) & BIT(26)))
> +		sparse_keymap_report_event(input, BIT(26), 1, true);

I have only just now noticed that a typo crept in here, causing a bug.
The original call to call_fext_func() passed FUNC_FLAGS as the first
argument while the added one uses FLAG_RFKILL instead.  This is wrong as
call_fext_func() arguments should be left intact by this patch.

Darren, could you please amend this in testing?  The call_fext_func()
call added by the above patch chunk should pass FUNC_FLAGS as the first
argument, not FLAG_RFKILL.

Thanks and sorry for the trouble.

-- 
Best regards,
Michał Kępień

[toc] | [next] | [standalone]


#1614591

FromDarren Hart <dvhart@infradead.org>
Date2017-04-01 22:10 +0200
Message-ID<trxvr-7q2-7@gated-at.bofh.it>
In reply to#1613896
On Fri, Mar 31, 2017 at 01:22:02PM +0200, Michał Kępień wrote:
> > @@ -1098,14 +1075,8 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
> >  	 * handled in software; its state is queried using FUNC_FLAGS
> >  	 */
> >  	if ((fujitsu_laptop->flags_supported & BIT(26)) &&
> > -	    (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26))) {
> > -		keycode = KEY_TOUCHPAD_TOGGLE;
> > -		input_report_key(input, keycode, 1);
> > -		input_sync(input);
> > -		input_report_key(input, keycode, 0);
> > -		input_sync(input);
> > -	}
> > -
> > +	    (call_fext_func(FLAG_RFKILL, 0x1, 0x0, 0x0) & BIT(26)))
> > +		sparse_keymap_report_event(input, BIT(26), 1, true);
> 
> I have only just now noticed that a typo crept in here, causing a bug.
> The original call to call_fext_func() passed FUNC_FLAGS as the first
> argument while the added one uses FLAG_RFKILL instead.  This is wrong as
> call_fext_func() arguments should be left intact by this patch.
> 
> Darren, could you please amend this in testing?  The call_fext_func()
> call added by the above patch chunk should pass FUNC_FLAGS as the first
> argument, not FLAG_RFKILL.
> 
> Thanks and sorry for the trouble.

Gah, I didn't catch that either :(

I've updated this patch with:

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 52d6d21..f66da4b 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -1074,7 +1074,7 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
         * handled in software; its state is queried using FUNC_FLAGS
         */
        if ((fujitsu_laptop->flags_supported & BIT(26)) &&
-           (call_fext_func(FLAG_RFKILL, 0x1, 0x0, 0x0) & BIT(26)))
+           (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26)))
                sparse_keymap_report_event(input, BIT(26), 1, true);
 }

in pdx86/testing, I'll push to for-next today, just as soon as CI confirms no
issues.

Thank you for catching it,

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1614677

FromJonathan Woithe <jwoithe@just42.net>
Date2017-04-02 11:10 +0200
Message-ID<trJGh-6VN-15@gated-at.bofh.it>
In reply to#1614591
On Sat, Apr 01, 2017 at 01:00:23PM -0700, Darren Hart wrote:
> On Fri, Mar 31, 2017 at 01:22:02PM +0200, Micha?? K??pie?? wrote:
> > > @@ -1098,14 +1075,8 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
> > >  	 * handled in software; its state is queried using FUNC_FLAGS
> > >  	 */
> > >  	if ((fujitsu_laptop->flags_supported & BIT(26)) &&
> > > -	    (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26))) {
> > > -		keycode = KEY_TOUCHPAD_TOGGLE;
> > > -		input_report_key(input, keycode, 1);
> > > -		input_sync(input);
> > > -		input_report_key(input, keycode, 0);
> > > -		input_sync(input);
> > > -	}
> > > -
> > > +	    (call_fext_func(FLAG_RFKILL, 0x1, 0x0, 0x0) & BIT(26)))
> > > +		sparse_keymap_report_event(input, BIT(26), 1, true);
> > 
> > I have only just now noticed that a typo crept in here, causing a bug.
> > The original call to call_fext_func() passed FUNC_FLAGS as the first
> > argument while the added one uses FLAG_RFKILL instead.  This is wrong as
> > call_fext_func() arguments should be left intact by this patch.
> > 
> > Darren, could you please amend this in testing?  The call_fext_func()
> > call added by the above patch chunk should pass FUNC_FLAGS as the first
> > argument, not FLAG_RFKILL.
> > 
> > Thanks and sorry for the trouble.
> 
> Gah, I didn't catch that either :(

And I missed it too. :-(  Thanks for catching this Michael.  The reason it
never showed up in my testing is that my Fujitsu hardware doesn't have the
feature which exercises this code branch.

> I've updated this patch with:
> 
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 52d6d21..f66da4b 100644

Thanks Darren.

Regards
  jonathan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web