Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5030226yba; Wed, 8 May 2019 06:54:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV0JEcUTvW3cyVlPyGy2AxzkWFzGmLaSIUAIeeyJTRJ+1RiPTeaWB6mbIiiXcOWV+Cs0vC X-Received: by 2002:a62:5b81:: with SMTP id p123mr26127213pfb.158.1557323663499; Wed, 08 May 2019 06:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557323663; cv=none; d=google.com; s=arc-20160816; b=RthuWTxWoOP11lJJvWK7v1nws/MEaqnTKkVB/ZQxU7wAoDsdZZJAvtN6GcCTss9eyd en8RXoXreD1nG/b+Xij6C2/55mFGJPlEAsEDfN4qaLH5dSDUOiKW3zq77OtwUvrEzMO1 tIwWAi2vEaSFVA0ah05VWc75ux0JshlD3oJ45PoA/ttyhPG9SLCHxemP4pq8sE85gf6f AUdgo0iQoUIbum3IvgWGjeBSqXJD3i+E0tCB7mFB66jX3U0O91MZNU9N4jnYBUu7j6z+ h7Hh3O09axH4ll8ESjLYXfZJgPg10RX5pmUE+uRecbzIB9f2psMkaHMp1482CbCxDpV/ hg8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=abi/LI33UU4FZpJKirTDuSSuM40WUXND0+Sz3pImfKQ=; b=Z9Ead7dCl6ZT1FowR9Hl6HyjX2RQLsX5TPjShn+KF3xMBKmVumdrloYsZPEWvy9rRn H5TjZZWCAIPS3Ct4fVAUYD8RANnU7lnmltP21/Vm+USmiiWHNUvek8NWI+lQBukpDkPZ Uazqt0Z33ASYWn5r2qpoA3k6dgU7zaKAigZH3UUgjy/TE1s7PnmIRnpOTeUWGSglX+aP OGECPz8/pyTyiaxPfqVmfyAHLiR0NMANX7E9tQpnfnAXx1kt0t7w9cLGhtr5DxtKtHq7 Z7fHSCZRnnJKeDQQDDxWGlZpUf1o9vW1zYB6YCAHMEvteZhZqCJqDsvKwLt0bziTWQE5 o0pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BYSr9QJB; 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 k188si8933608pga.498.2019.05.08.06.54.07; Wed, 08 May 2019 06:54:23 -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=BYSr9QJB; 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 S1727884AbfEHNrZ (ORCPT + 99 others); Wed, 8 May 2019 09:47:25 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36541 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727840AbfEHNrY (ORCPT ); Wed, 8 May 2019 09:47:24 -0400 Received: by mail-pf1-f195.google.com with SMTP id v80so10536322pfa.3; Wed, 08 May 2019 06:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=abi/LI33UU4FZpJKirTDuSSuM40WUXND0+Sz3pImfKQ=; b=BYSr9QJBgm7KUapEFWgZ7nMiKGvAkTkqxZn9XIpxgb8UvL7NFcdo6abyQ9Kuxt4PCe W3yZ3hJ9gUxjsStaJFKk405qEyL6Jsd9FsB4L8UY6jGRhROGHqZxun2LMfbC0/dVJGtD BG9aNP/ns2ip/hNwM/pHFpbTns1/GQQ0xt7qfqkSW3fygkxQgl+/tNWr1A/YqJTkJJ76 cNX7TGEaqV0niPiGONQAsZXwtILcRMGFJHIy+0BgGi8vo+Fy9coxEB8yMio4gTKNdw+h CQY/RQEvsxQpDD/VTs4Inb83uZKJ8pcM1JL1KQeixR5VGNCjKg7etitFgT0QpegvWEga neiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=abi/LI33UU4FZpJKirTDuSSuM40WUXND0+Sz3pImfKQ=; b=cbJNbVg6JfFHIT07lEanmaRly6YRk2OEI91Z8F/MzzzS2EHtVsTC1+ARJ1qw5NiheJ vUdAXAdnazXF+4vomG8Wp40hTlu0jIh4n2u+bg4vOhQLjMgLzQWEB7akK+0BKTVNBf8g vvF65P4jfW7K2HqkFwTNdOYTgWySe3BJcPWamXvPbVVoGD9RLeF6JO2Ts/n17/LUQAgV ywEWafMrePg8FoeUKakMZ8GnE2F23Regrj8bq2OxNxP40ky518k1Ak780v6O3sIfkS5Y 79QqMxftH5fY/AyQZ9tGLnwg+FvsxNgYWSiNfQ1e+CTUNYUP8jPFAllKrPhduX8KJ3kw SM0A== X-Gm-Message-State: APjAAAV4qGjxJ0RLtixW9QtV+F1OxMZRfZbm81I0MvwmrZLooG0KFbdp mqAnIPgFhN6jfFXY/LIHnWOSdjrswr2a++FYrhWx+vNFpms= X-Received: by 2002:a62:4183:: with SMTP id g3mr49898949pfd.229.1557323243023; Wed, 08 May 2019 06:47:23 -0700 (PDT) MIME-Version: 1.0 References: <7acd57fe-604a-a96a-4ca2-a25bc88d6405@gmail.com> <22dc9bfe-af2f-7ea9-e5bc-95647d5411a8@gmail.com> In-Reply-To: <22dc9bfe-af2f-7ea9-e5bc-95647d5411a8@gmail.com> From: Andy Shevchenko Date: Wed, 8 May 2019 16:47:12 +0300 Message-ID: Subject: Re: [PATCH v3 05/11] platform/x86: asus-wmi: Support WMI event queue To: Yurii Pavlovskyi Cc: Corentin Chary , Darren Hart , Andy Shevchenko , Daniel Drake , acpi4asus-user , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 1:10 PM Yurii Pavlovskyi wrote: > > 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 [1]. > > 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 [1] 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, Andy Shevchenko