Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp644780ybz; Wed, 15 Apr 2020 15:50:41 -0700 (PDT) X-Google-Smtp-Source: APiQypImI8/ryjovfoQquaWkhjNx5DFm1YEBE9sg0MYyDyZ0/nT9d14CHVYGmqpFhXddnMAfQOQt X-Received: by 2002:a05:6402:705:: with SMTP id w5mr25026557edx.379.1586991041330; Wed, 15 Apr 2020 15:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586991041; cv=none; d=google.com; s=arc-20160816; b=o1fJT8/v4ToN7ZvA2fRys11qzlL6X/NOO82+bJN6yVv+/udhvWwYiNeICxLccUVrWG M2X9JnPe0Y4vJ/Ov/aCojUVKxvIhjZoMz7g2vGnilVM9e0+flmKtPCjbItjfmlvEOuJ0 SJkUQtKTER0upCRSeT0sd0HOqiz7Jrjlp0v/WzkJeSbtpO190qujnCULpOA5tUD/BGYG OJDw6DfoFouaYqMi1vPltGu3/DmVH4Pv/lRwcHJTlsWXDxcDRQz2eApQ25w8EUDtLJwx ZHsyD3REyF+QPSnqMrvHQOgXzDwwxbvgLi83dxkO8ldQk0nceAFga+Vlvp4yEzXcz1lr HOkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=EEyUNAw9CMe8aRFk9TIuAat59B55j/VV/t4YDKq6LnM=; b=AL1xi44udN4LoDNZcoiCV4i4DRbx/a+Yg4KGLan5kId/DQV0A/nOhcXBlXaGN6RoKH 3UlnkOUzq1iEsUzzQyTVJ8WBaTVsgLU6sFoTDnQBgxLSbYmiQBfPPWf3dMFsRHGj7g2f 1o3lFcJbP/LtiFP2dwoPAzzgGRdLmHsM7dUTUEMzQhMxoac9sEtGdunqQqWtY9KJOhN8 yARpvLwBRolWKHTVwcSNSY9f/rY51MFvnomNol4hjDNTwOLjd5LPG2EVo43DMO0pzn9n GB+B4vfeZcbWrekQBqbbNV5pGcu6plKfV9cNbp7N3YYzmDmblT9i6Kf3VpPI25CLEwwL djkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si12501416edn.385.2020.04.15.15.50.18; Wed, 15 Apr 2020 15:50:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895772AbgDOJpS (ORCPT + 99 others); Wed, 15 Apr 2020 05:45:18 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:44126 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895743AbgDOJpG (ORCPT ); Wed, 15 Apr 2020 05:45:06 -0400 Received: from 185.80.35.16 (185.80.35.16) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id f6ab41578b3b780a; Wed, 15 Apr 2020 11:45:02 +0200 From: "Rafael J. Wysocki" To: Hans de Goede Cc: Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Mikityanskiy , "5 . 3+" Subject: Re: [PATCH v2] platform/x86: intel_int0002_vgpio: Only bind to the INT0002 dev when using s2idle Date: Wed, 15 Apr 2020 11:45:01 +0200 Message-ID: <4380034.KJPSqyn9gG@kreacher> In-Reply-To: <20200414131953.131533-1-hdegoede@redhat.com> References: <20200414131953.131533-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, April 14, 2020 3:19:53 PM CEST Hans de Goede wrote: > Commit 871f1f2bcb01 ("platform/x86: intel_int0002_vgpio: Only implement > irq_set_wake on Bay Trail") stopped passing irq_set_wake requests on to > the parents IRQ because this was breaking suspend (causing immediate > wakeups) on an Asus E202SA. > > This workaround for this issue is mostly fine, on most Cherry Trail > devices where we need the INT0002 device for wakeups by e.g. USB kbds, > the parent IRQ is shared with the ACPI SCI and that is marked as wakeup > anyways. > > But not on all devices, specifically on a Medion Akoya E1239T there is > no SCI at all, and because the irq_set_wake request is not passed on to > the parent IRQ, wake up by the builtin USB kbd does not work here. > > So the workaround for the Asus E202SA immediate wake problem is causing > problems elsewhere; and in hindsight it is not the correct fix, > the Asus E202SA uses Airmont CPU cores, but this does not mean it is a > Cherry Trail based device, Brasswell uses Airmont CPU cores too and this > actually is a Braswell device. > > Most (all?) Braswell devices use classic S3 mode suspend rather then > s2idle suspend and in this case directly dealing with PME events as > the INT0002 driver does likely is not the best idea, so that this is > causing issues is not surprising. > > Replace the workaround of not passing irq_set_wake requests on to the > parents IRQ, by not binding to the INT0002 device when s2idle is not used. > This fixes USB kbd wakeups not working on some Cherry Trail devices, > while still avoiding mucking with the wakeup flags on the Asus E202SA > (and other Brasswell devices). > > Cc: Maxim Mikityanskiy > Cc: 5.3+ # 5.3+ > Fixes: 871f1f2bcb01 ("platform/x86: intel_int0002_vgpio: Only implement irq_set_wake on Bay Trail") > Tested-by: Maxim Mikityanskiy > Signed-off-by: Hans de Goede > --- > Changes in v2: > - Rebase on top of 5.7-rc1 > --- > drivers/platform/x86/intel_int0002_vgpio.c | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > > diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c > index 289c6655d425..30806046b664 100644 > --- a/drivers/platform/x86/intel_int0002_vgpio.c > +++ b/drivers/platform/x86/intel_int0002_vgpio.c > @@ -143,21 +143,9 @@ static struct irq_chip int0002_byt_irqchip = { > .irq_set_wake = int0002_irq_set_wake, > }; > > -static struct irq_chip int0002_cht_irqchip = { > - .name = DRV_NAME, > - .irq_ack = int0002_irq_ack, > - .irq_mask = int0002_irq_mask, > - .irq_unmask = int0002_irq_unmask, > - /* > - * No set_wake, on CHT the IRQ is typically shared with the ACPI SCI > - * and we don't want to mess with the ACPI SCI irq settings. > - */ > - .flags = IRQCHIP_SKIP_SET_WAKE, > -}; > - > static const struct x86_cpu_id int0002_cpu_ids[] = { > X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT, &int0002_byt_irqchip), > - X86_MATCH_INTEL_FAM6_MODEL(ATOM_AIRMONT, &int0002_cht_irqchip), > + X86_MATCH_INTEL_FAM6_MODEL(ATOM_AIRMONT, &int0002_byt_irqchip), > {} > }; > > @@ -181,6 +169,10 @@ static int int0002_probe(struct platform_device *pdev) > if (!cpu_id) > return -ENODEV; > > + /* We only need to directly deal with PMEs when using s2idle */ > + if (!pm_suspend_default_s2idle()) > + return -ENODEV; > + What if the system supports s2idle which is not the default suspend option and then it is selected by user space (overriding the default)? > irq = platform_get_irq(pdev, 0); > if (irq < 0) > return irq; >