Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2668331rwb; Thu, 29 Sep 2022 13:20:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pfe9cM6ogQPUDt4DBt1iihu/BExgE2S13PseUVh21RepIGPdDD2TGK3T/Qs8v+jWlA84y X-Received: by 2002:a17:903:124b:b0:179:da2f:2457 with SMTP id u11-20020a170903124b00b00179da2f2457mr5076986plh.156.1664482826069; Thu, 29 Sep 2022 13:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664482826; cv=none; d=google.com; s=arc-20160816; b=zKdta6R81UMjFKfrBLnzpQz8Y8QHA8AYth3Hnt4Eol2UEOOOHU/kaWl8HuiQIFm6+v sGPB7CwuaYalF1V4qxKygM1lJnr0l2KG3LXUdNxb5mZFomI5uRv+9FgeHk5S+H+cJwi6 M6a9uLE4S1I5Sm/jyHOoLkMaqiRFohpZpcwJJaNPJvYgwJ1dPtvhnEyCQD2qjidP5BkY m680qDZTGcrBJVw7qPXev7aQpBebU10ge0JF9onPuMbGCWh4+UA42VXO3lUsuhzNvnRF yCpLfnw7NXXJs2kaSyLOEeu9RTt6f+ZkwtKYtnyLOzoYaBgoWIpVF5dtN9uyXLNGV6iC 4Y8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=/e4BN6wCiFfjQq1fb+urfl5niKh5OtFO/d3wsAnUbtU=; b=KHzrnXLyu2WdNSdn4bIy8pERlpKbY/U3S3YnZMSKeOTpwU7pjTt/tdEnWum+Q4IDEb 8Vys5DDkp66xeLYdb7bIIn9aHc3TOipN76yAKLY4stktP4yBGYgBAXpo37maigQwQqJm jS20uIY56Jsx3A30cZm4LsvsN59adfUCt5l+bYXqGwnwXwnDzWeMZxk6QQSBjD2GOqAW jmKvzlWBDphAUyLnPolgCBaVEtMebYED3h7VdzwzbRRKwbxUWNIaUuZJi6mbAcMsac/n 6VObd5Wf8iSpMIe3hvDYhd7gKtts9rh9Z8IA85OQZbH5nv0UG7oJaY6ip8fPxT8tcBLG 8gfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a635850000000b00439ba88f93dsi817634pgm.274.2022.09.29.13.20.14; Thu, 29 Sep 2022 13:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbiI2THL (ORCPT + 99 others); Thu, 29 Sep 2022 15:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbiI2THJ (ORCPT ); Thu, 29 Sep 2022 15:07:09 -0400 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEDF914DAD0; Thu, 29 Sep 2022 12:07:08 -0700 (PDT) Received: by mail-qt1-f175.google.com with SMTP id c11so1378123qtw.8; Thu, 29 Sep 2022 12:07:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=/e4BN6wCiFfjQq1fb+urfl5niKh5OtFO/d3wsAnUbtU=; b=zWnOPQvvRpMvWMn0D/sw5LUl3JPKhfw1TyEP4hiuqaje/RhohgUu/Q44D8SJuMQXJ7 X0rdEFhiTXtTd/xrK4UqQWBu4H40MaGh66fRpE5bOlDnQa3IolC8i+Mpm+50hBP/H3Ls on1cUtK/KLJoO5mfyEebeFC3E4iod6T/Y4UDJRs3wF42aU9VdLbeId8UYmu+CSqpLyam sD8bbD8ZZcigDhrHzW6nso+4xdvmcBxx16vJlCmZop7vneaY57JsRJ1a97hZKYdbCNe/ kGOI5XuoPfMGkhWJ8adzfcvNzev0CC8pj5RW6rwh0Z1K0St0CePDmfch92Qe7hD7v3Ig 3PUQ== X-Gm-Message-State: ACrzQf0xU4C1ZtiuLZajmEBCCSKAp8N/uDqfc6sGGqCSaLzP7r0wC2u7 EgU7QqV6HKaI8MzsX8rHvSUe3ClVVff4Mlm5C3k= X-Received: by 2002:a05:622a:64e:b0:35d:5213:284f with SMTP id a14-20020a05622a064e00b0035d5213284fmr3737115qtb.49.1664478427856; Thu, 29 Sep 2022 12:07:07 -0700 (PDT) MIME-Version: 1.0 References: <20220929161917.2348231-1-rrangel@chromium.org> <20220929093200.v6.8.I7d9202463f08373feccd6e8fd87482c4f40ece5d@changeid> In-Reply-To: <20220929093200.v6.8.I7d9202463f08373feccd6e8fd87482c4f40ece5d@changeid> From: "Rafael J. Wysocki" Date: Thu, 29 Sep 2022 21:06:56 +0200 Message-ID: Subject: Re: [PATCH v6 08/13] ACPI: PM: Take wake IRQ into consideration when entering suspend-to-idle To: Raul E Rangel Cc: ACPI Devel Maling List , linux-input , Andy Shevchenko , Dmitry Torokhov , Hans de Goede , "Rafael J. Wysocki" , Mika Westerberg , Mario Limonciello , Tim Van Patten , Linus Walleij , "jingle.wu" , Len Brown , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 29, 2022 at 6:19 PM Raul E Rangel wrote: > > This change adds support for ACPI devices that use ExclusiveAndWake or > SharedAndWake in their _CRS GpioInt definition (instead of using _PRW), > and also provide power resources. Previously the ACPI subsystem had no > idea if the device had a wake capable interrupt armed. This resulted > in the ACPI device PM system placing the device into D3Cold, and thus > cutting power to the device. With this change we will now query the > _S0W method to figure out the appropriate wake capable D-state. > > Signed-off-by: Raul E Rangel > --- > > Changes in v6: > - Refactored to leave else clause > > Changes in v5: > - Go back to using adev->wakeup.flags.valid to keep the diff cleaner > - Fix a typo in comment > > drivers/acpi/device_pm.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c > index 9dce1245689ca25..b657998ce728e4c 100644 > --- a/drivers/acpi/device_pm.c > +++ b/drivers/acpi/device_pm.c > @@ -681,7 +681,22 @@ static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev, > d_min = ret; > wakeup = device_may_wakeup(dev) && adev->wakeup.flags.valid > && adev->wakeup.sleep_state >= target_state; > + } else if (device_may_wakeup(dev) && dev->power.wakeirq) { > + /* > + * The ACPI subsystem doesn't manage the wake bit for IRQs > + * defined with ExclusiveAndWake and SharedAndWake. Instead we > + * expect them to be managed via the PM subsystem. Drivers > + * should call dev_pm_set_wake_irq to register an IRQ as a wake > + * source. > + * > + * If a device has a wake IRQ attached we need to check the > + * _S0W method to get the correct wake D-state. Otherwise we > + * end up putting the device into D3Cold which will more than > + * likely disable wake functionality. > + */ > + wakeup = true; > } else { > + /* ACPI GPE is specified in _PRW. */ > wakeup = adev->wakeup.flags.valid; > } > > -- I can apply this one readily if that helps. It doesn't depend on anything else in the series AFAICS. It looks like patch [01/13] could also be applied right away, but probably it is not for the ACPI tree. I have a small comment to patch [06/13], and after that is addressed it could be applied right away too I suppose, but the rest of the patches need ACKs from the respective maintainers.