Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1483879ybb; Fri, 29 Mar 2019 05:33:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0Tl/jG2xAaiiAZD+ID5ujpxO17337RwUTXjIamDt+V47DIusEOY21GjMclX5MkvIsxNZx X-Received: by 2002:a63:88c3:: with SMTP id l186mr45960650pgd.148.1553862819316; Fri, 29 Mar 2019 05:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553862819; cv=none; d=google.com; s=arc-20160816; b=hj8726cmTFR+IlnLT5rbPWUP6CzCTPQnBD+cnlSo4KjOzuxEQKmrACkqgIy5yLQOns sSrMtDCmj+N5jZtFWRD+rG/QK3Xqb3So79nQrHl1LY0dycVvp+jzS27PlO6SH52tMHZ4 O27KYIi5rMssclspuaqwlz9nUJDouTkcFVQZ35BGIWENBJArCMv3Zv0mZDpRl//pBIoY TgUKjQOBErjk5zrIqIbfI18liMELIbeLJRKh8a67wiu7ZLCO1AVmoW1Sjece+vt7jUBb witAcFBiDtcw0SlLuRPDKsueBApZqMi8mSuZBvFs8cQhRO3sGRvmovWmMr20eOM/MqOZ q1zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1Sz81Kig8EQU5KaUETLRoD6RajNWOfWqn1eRTncAMJQ=; b=KpfvUJqk9ybHPXQumOKRweKnSxldgUno1MF5SL4HKOwpirkWcT+ODg9Voxx1WMxMCU LrQXJxp4ISXfJS7MgahRrkQR0jppWvv1vXXWBfI8Max/GT9t2+nsuTdeYHR4Sfg7cLED uC6ki8pqnhtUSMVU7iAH27rrs0CfRZ2T2toMXVv4kckkqI44WWbNvWC8Req2mIuKdn2G QXLazcNld7EJ6CTugX9qsjSlmUc0EvsagLqY11fYWzKXclhUjF8V92Y6OuCZspILCR8T pysGPXpAixctQVJ9k5RH/cv/WUKN26Wbc0X5XSg8zFiNxQioXjRPTdBitptycpOHpPZl AO4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si1835589ple.299.2019.03.29.05.33.23; Fri, 29 Mar 2019 05:33:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729522AbfC2Mcs (ORCPT + 99 others); Fri, 29 Mar 2019 08:32:48 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41423 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729484AbfC2Mcr (ORCPT ); Fri, 29 Mar 2019 08:32:47 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E499C8073A; Fri, 29 Mar 2019 13:32:37 +0100 (CET) Date: Fri, 29 Mar 2019 13:32:44 +0100 From: Pavel Machek To: Hans de Goede Cc: "Chen, Hu" , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ACPI / PM: Propagate KEY_POWER to user space when resume Message-ID: <20190329123244.GA20104@amd> References: <20190328103448.20335-1-hu1.chen@intel.com> <20190329102519.GA11784@atrey.karlin.mff.cuni.cz> <23bc59ef-fc25-440b-ab1c-c5db6b5cf6d2@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <23bc59ef-fc25-440b-ab1c-c5db6b5cf6d2@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2019-03-29 12:38:39, Hans de Goede wrote: > Hi, >=20 > On 3/29/19 11:25 AM, Pavel Machek wrote: > >>I run Android on x86 PC (it's a NUC). Everytime I press the power button > >>to wake the system, it suspends right away. After some debug, I find > >>that Android wants to see KEY_POWER at resume. Otherwise, its > >>opportunistic suspend will kick in shortly. > >> > >>However, other OS such as Ubuntu doesn't like KEY_POWER at resume. So > >>add a knob "/sys/module/button/parameters/key_power_at_resume" for users > >>to select. > >> > >>Signed-off-by: Chen, Hu > > > >NAK. > > > >Fix android, lets not break kernel. >=20 > It is not that simple, as I explained in my other reply to this > patch, we alreayd have inconsistent behavior here inside the kernel. >=20 > When KEY_POWER is handled by the gpio-keys driver it does explicitly > send a KET_POWER press event when the system is woken up through the > power-button. Which may be okay. > Arguably that is more consistent, e.g. some systems can also be woken > up through a home-button press and in that case we do want the KEY_HOMEPA= GE > to be propagated to userspace after the wakeup so that we not only wake > but also switch to the homescreen (whatever that might be). Which may also be okay. > Note I'm not saying that I'm happy with any of this, but simply NACK-ing > this patch is IMHO not the answer. Well, to add a knob "/sys/module/button/parameters/key_power_at_resume" is really not acceptable. Android does not know that it needs to set it, so it will not set it, and the problem remains. Plus, we get a great mess in future. But yes, we might want userland to know why the system woke up. And it would be good if everything also worked with wake-on-lan. Hmm. It is also possible that PC's ACPI power button should generate something else than KEY_POWER. Power button on my USB keyboard generates that, and that is really quite different button the one on the box. I'm not saying I know what the solution is. But we should have one solution, not a knob to select between different solutions. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlyeEGwACgkQMOfwapXb+vIeZgCfUC8q4+n31T3i6R7APn52ZVnW ei0An22NKrpngC6KAJZhnySIy5Ngkkud =NPzD -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--