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


Groups > linux.kernel > #1671898

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes
Date 2017-06-21 20:20 +0200
Message-ID <tUSop-1kz-3@gated-at.bofh.it> (permalink)
References <tSRmN-3Ii-3@gated-at.bofh.it> <tSRmN-3Ii-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jun 16, 2017 at 06:40:52AM +0200, Michał Kępień wrote:
> All ACPI device notify callbacks are invoked using acpi_os_execute(),
> which causes the supplied callback to be queued to a static workqueue
> which always executes on CPU 0.  This means that there is no possibility
> for any ACPI device notify callback to be concurrently executed on
> multiple CPUs, which in the case of fujitsu-laptop means that using a
> locked kfifo for handling hotkeys is redundant: as hotkey scancodes are
> only pushed and popped from within acpi_fujitsu_laptop_notify(), no risk
> of concurrent pushing and popping exists.

Was the kfifo causing a problem currently or for the migration to separate
modules? Is this purely a simplification?

Rafael, the above rationale appears sound to me. Do you have any concerns?

...

> -#define RINGBUFFERSIZE 40
>  
>  /* Debugging */
>  #define FUJLAPTOP_DBG_ERROR	  0x0001
> @@ -146,8 +144,8 @@ struct fujitsu_laptop {
>  	struct input_dev *input;
>  	char phys[32];
>  	struct platform_device *pf_device;
> -	struct kfifo fifo;
> -	spinlock_t fifo_lock;
> +	int scancode_buf[40];

Do we know why 40 was used here? A single use magic number is fine, but it would
be good to document why it is what it is if we know.

-- 
Darren Hart
VMware Open Source Technology Center

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-21 20:20 +0200
  Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Jonathan Woithe <jwoithe@just42.net> - 2017-06-22 02:00 +0200
    Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-22 04:50 +0200
      Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Jonathan Woithe <jwoithe@just42.net> - 2017-06-22 05:10 +0200
        Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Michał Kępień <kernel@kempniu.pl> - 2017-06-22 22:50 +0200
          Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-23 02:00 +0200
            Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Jonathan Woithe <jwoithe@just42.net> - 2017-06-23 02:20 +0200
              Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-23 08:00 +0200
  Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Michał Kępień <kernel@kempniu.pl> - 2017-06-22 22:10 +0200
  Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-06-24 02:40 +0200
    Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-27 02:10 +0200
      Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Jonathan Woithe <jwoithe@just42.net> - 2017-06-27 14:20 +0200
      Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Michał Kępień <kernel@kempniu.pl> - 2017-06-28 06:40 +0200
        Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for  storing hotkey scancodes Darren Hart <dvhart@infradead.org> - 2017-06-28 18:10 +0200

csiph-web