Re: [PATCH v3 05/11] platform/x86: asus-wmi: Support WMI event queue
From: Andy Shevchenko
Date: Wed May 08 2019 - 09:48:26 EST
On Fri, Apr 19, 2019 at 1:10 PM Yurii Pavlovskyi
> Event codes are expected to be retrieved from a queue on at least some
> models. Specifically, very likely the ACPI WMI devices with _UID ATK are
> queued whereas those with ASUSWMI are not .
> The WMI event codes are pushed into a circular buffer queue. After the INIT
> method is called, ACPI code is allowed to push events into this buffer.
> The INIT method cannot be reverted. If the module is unloaded and an event
> (such as hotkey press) gets emitted before inserting it back the events get
> processed delayed by one or if the queue overflows, additionally delayed by
> about 3 seconds.
> It might be considered a minor issue and no normal user would likely
> observe this (there is little reason unloading the driver), but it does
> significantly frustrate a developer who is unlucky enough to encounter
> this. Therefore, the fallback to unqueued behavior occurs whenever
> something unexpected happens.
> The fix flushes the old key codes out of the queue on load. After receiving
> event the queue is read until either ..FFFF or 1 is encountered. Also as
> noted in  it is checked whether notify code is equal to 0xFF before
> enabling queue processing in WMI notify handler.
It's rather a big change. Can it be split to smaller pieces?
With Best Regards,