Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2501692imb; Mon, 4 Mar 2019 06:49:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwPTk8ltufcCVoLs1IOCL3vUBribBsm9fJXkwYWr48e51xnHYpJQfYAn/lJsG0dzkAA081E X-Received: by 2002:a63:1766:: with SMTP id 38mr18942993pgx.204.1551710974691; Mon, 04 Mar 2019 06:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551710974; cv=none; d=google.com; s=arc-20160816; b=fem29Ctl4f6TBBsVU1aExB6V6wcKp/XDgGrZFajIEd0RR0ccx9JhRW9Y7Gfbs5hW8V 9TjneNkogcdtW1AqqZhR9x7YDLq8rCsHBJRpDWojkHsKQr9kAy9q+HdhqXMTacjIU3FX wsGsR1uiOXJXS2PmECjIN/K9Fxc4grh416wj2wEzZDV3KrBMiqKcRe6c1Iv3zltzBVJP 7JIb723LoifqqwLHbGFIo+hqX52wTmmKAK75o9+2dl2WEka1lnVfN7l+/5MAPbypN47l F/fMDGIJfXVWyHOrFmEnZ3O6eWKG2ATX7Ajx/oAknVGxaYIkWUdmqQwyOK5PpdK8ONiY nb4A== 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=C5mFuk88I6KfZegvGxuSdnap/hipWiDG4cWBkWx3aGU=; b=g/v7Z1MVW7YFWV+C8EJqTbIPBjEBmnxZp9CdobGmUzvSOMkO5vm5IPrbReI0hgMLLx BRoXeNAkTnBmcufySHRSdmU8WyB2Gg5IRyaGKD1RfFnYk3swUewAPf0DVdFrcvuApGHR xaehLi7lOSFa6/EFhr56O6ZOKlc/vc7MVDKLx2DU4uYzsnFiXV/mJlu2JhULkiU2JQwe yXpUd8ElYSrAAB8KhgMwrymZXXEH1YKZtQuoz2sh6L2wGBIpBAKNWfnTGMIqPkuVtWKk o5v9hjHHBvUrj2E05Jsmgg46krDxv91DGBwvgrPzzXclTS3hOaeyDtQS6cwlLbnDrh26 juXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eZWp8C7Y; 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 cv2si6087129plb.192.2019.03.04.06.49.19; Mon, 04 Mar 2019 06:49:34 -0800 (PST) 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=eZWp8C7Y; 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 S1726878AbfCDOd5 (ORCPT + 99 others); Mon, 4 Mar 2019 09:33:57 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33676 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726095AbfCDOd5 (ORCPT ); Mon, 4 Mar 2019 09:33:57 -0500 Received: by mail-pf1-f194.google.com with SMTP id i19so3163816pfd.0; Mon, 04 Mar 2019 06:33:56 -0800 (PST) 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=C5mFuk88I6KfZegvGxuSdnap/hipWiDG4cWBkWx3aGU=; b=eZWp8C7YdrUrdgzxvaXBTacGFJFTUExyL8wsj9eLv4NUie0qhVuxS4K+WnKYahKVqg gZRtrXKDCqKKVFfUL0Dmq8cnFvaSsEWBa8UxS4Aop/WtQ3TiN/5CDh9QDkIsz/a6RBjR DOJDZ965KPYjSUiUGLUeoZKKg4lPPvrpGXH3hGDQWrFGAWPMXALgz7jPgEygN4iORZpj hpRKhdqZJA5Y/sOMf+xYd4m6XGbfopx/2DjcPVlrG8SCVW3hh8oQDc25i6XoQaDF3/0f N/STa4Lfrz4G/jceFvLIa2skmfcTsMOeEZO6yteeZJi3oxly+B5kFyIb9/1SimI9ilQn apMA== 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=C5mFuk88I6KfZegvGxuSdnap/hipWiDG4cWBkWx3aGU=; b=LV/RjfmAzzN1lAvWSQ/kD4DflkogXNd/xGgw03ZkHV7jirGixLea/ogONuS3U71uUB d5KiemFocvIa3YYRE5QMUlUkGGW9ByBMhIbJJXdIo0reNNHCUBoxgQFEtpIUT7WaIPIK Ddle6SBmnAnoVoGgEZP0VxSyG7gUpZAFoxbZLJo8D9BsEeb+2pc6499f+jeHDPhY+uBN sfq2h4f4LSqEJsZH3K0UwSw8TqNVZhasfJEo2zSoegSMIOU8iojdEzXgia/uF3gsynv0 2IDxBsVlSI71QrA34Yt4fs5wDqe/N0gGPPMwf+H0vNvb/o/jFgUP3bv2zTgBAmXLBH3N AAnA== X-Gm-Message-State: APjAAAVWtj0nt7KT8ZeN3WT5oePccc3BDM2ZWW8HdmEINT7iN8GS5FID efr1ZBp7VQi1JvriUTzoc6Lxeti3rPffo2O3k2BMVhpU X-Received: by 2002:a63:2004:: with SMTP id g4mr18807293pgg.337.1551710035342; Mon, 04 Mar 2019 06:33:55 -0800 (PST) MIME-Version: 1.0 References: <20190203094233.12177-1-hdegoede@redhat.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 4 Mar 2019 16:33:43 +0200 Message-ID: Subject: Re: [PATCH] platform/x86: intel_int0002_vgpio: Only implement irq_set_wake on Bay Trail To: Maxim Mikityanskiy Cc: Hans de Goede , Darren Hart , Andy Shevchenko , 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 Mon, Mar 4, 2019 at 4:09 PM Maxim Mikityanskiy wrote: > > On Tue, Feb 5, 2019 at 8:20 PM Andy Shevchenko > wrote: > > > > On Sun, Feb 3, 2019 at 11:42 AM Hans de Goede wrote: > > > > > > Commit c3b8e884defa ("platform/x86: intel_int0002_vgpio: Implement > > > irq_set_wake"), was written to fix some wakeup issues on Bay Trail (BYT) > > > devices. > > > > > > We've received a bug report that this causes a suspend regression on some > > > Cherry Trail (CHT) based devices. > > > > > > To fix the issues this causes on CHT devices, this commit modifies the > > > irq_set_wake support so that we only implement irq_set_wake on BYT devices, > > > > > > > Pushed to my review and testing queue, thanks! > > Kernel 5.0 was released without this patch, is it still planned to merge it? It will be in 5.1-rc1 and then we may send it to stable trees. > > > > Fixes: c3b8e884defa ("platform/x86: intel_int0002_vgpio: ... irq_set_wake") > > > Reported-and-tested-by: Maxim Mikityanskiy > > > Signed-off-by: Hans de Goede > > > --- > > > drivers/platform/x86/intel_int0002_vgpio.c | 32 ++++++++++++++++++---- > > > 1 file changed, 26 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c > > > index 4b8f7305fc8a..78787934b572 100644 > > > --- a/drivers/platform/x86/intel_int0002_vgpio.c > > > +++ b/drivers/platform/x86/intel_int0002_vgpio.c > > > @@ -51,11 +51,14 @@ > > > #define GPE0A_STS_PORT 0x420 > > > #define GPE0A_EN_PORT 0x428 > > > > > > -#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } > > > +#define BAYTRAIL 0x01 > > > +#define CHERRYTRAIL 0x02 > > > + > > > +#define ICPU(model, data) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, data} > > > > > > static const struct x86_cpu_id int0002_cpu_ids[] = { > > > - ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */ > > > - ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */ > > > + ICPU(INTEL_FAM6_ATOM_SILVERMONT, BAYTRAIL), /* Valleyview, Bay Trail */ > > > + ICPU(INTEL_FAM6_ATOM_AIRMONT, CHERRYTRAIL), /* Braswell, Cherry Trail */ > > > {} > > > }; > > > > > > @@ -135,7 +138,7 @@ static irqreturn_t int0002_irq(int irq, void *data) > > > return IRQ_HANDLED; > > > } > > > > > > -static struct irq_chip int0002_irqchip = { > > > +static struct irq_chip int0002_byt_irqchip = { > > > .name = DRV_NAME, > > > .irq_ack = int0002_irq_ack, > > > .irq_mask = int0002_irq_mask, > > > @@ -143,10 +146,22 @@ static struct irq_chip int0002_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. > > > + */ > > > +}; > > > + > > > static int int0002_probe(struct platform_device *pdev) > > > { > > > struct device *dev = &pdev->dev; > > > const struct x86_cpu_id *cpu_id; > > > + struct irq_chip *irq_chip; > > > struct gpio_chip *chip; > > > int irq, ret; > > > > > > @@ -195,14 +210,19 @@ static int int0002_probe(struct platform_device *pdev) > > > return ret; > > > } > > > > > > - ret = gpiochip_irqchip_add(chip, &int0002_irqchip, 0, handle_edge_irq, > > > + if (cpu_id->driver_data == BAYTRAIL) > > > + irq_chip = &int0002_byt_irqchip; > > > + else > > > + irq_chip = &int0002_cht_irqchip; > > > + > > > + ret = gpiochip_irqchip_add(chip, irq_chip, 0, handle_edge_irq, > > > IRQ_TYPE_NONE); > > > if (ret) { > > > dev_err(dev, "Error adding irqchip: %d\n", ret); > > > return ret; > > > } > > > > > > - gpiochip_set_chained_irqchip(chip, &int0002_irqchip, irq, NULL); > > > + gpiochip_set_chained_irqchip(chip, irq_chip, irq, NULL); > > > > > > return 0; > > > } > > > -- > > > 2.20.1 > > > > > > > > > -- > > With Best Regards, > > Andy Shevchenko -- With Best Regards, Andy Shevchenko