Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2357538rwb; Fri, 5 Aug 2022 19:42:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZBQgEanQS2WBcCTTz7/d+ibcAhobVUkrmy6+0GZwtdzysiEZJ3H0XwbDO6Z3XPBJNsv0L X-Received: by 2002:a05:6402:51d4:b0:43d:9c8e:2617 with SMTP id r20-20020a05640251d400b0043d9c8e2617mr9346243edd.146.1659753730433; Fri, 05 Aug 2022 19:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659753730; cv=none; d=google.com; s=arc-20160816; b=WXzpS0pg9NBL17hm14fGImAOOyf7e3OgOXeC1xcVEhwtp+5Pr/OkmpXc4BCbsmy30O uNU16TjOiwMDZd3JMYBW9ImHhbBQWVQg6ftoW2O9EcbhC5Q4mQu818cr4TOEAwyG201T yU/EemswQxnHqQZ/qyBIyEOLTQX8dBmfz+V9Fvg6bhz1tADaf0T/G9+Dsi4Qy4MT5TGv hwefQsWb2tBpwHMEvjKuqUDKULvIeXErFUwrcmynrEnGqyKDyeDmSY1EnIzIQVPkCd4o 75i6XHLkuGxpxcqw4fKTb1yF0NQbk/b5+P8NqAgVTXxyxJKD6tk3LU81syKXTL34vcuS dOiA== 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:dkim-signature; bh=hpL2SD3c6BbQtJILsmAr9lDTBlieQYxegWxZpRuWWIo=; b=uxDdvuEwf6IDz6vy65aPsZqPk8XtvCP2WoLC5tVUJ16HKzquGbI7Rv53hIISt+hlk+ DeWH/5vOz4RXI9c8ACstPPqnvVxp/AUsakTtaGIymIhKs+ogyhdbtcNRH8oQRXbW0jqX l/Sp6jT5yz6/+6B1QvPybUfXNpo5uw0jzdRCBMVvF3kI9HMU8OW+SW0DChGaVqiDO/C2 PTb0fxB1ZPzHF/+M2dNh5wijQ3Urnws4WgyG2voXegWcVFl4wBTUK6FKmOBBWm7u+pOn 7gju5hBYyoBwhSDIpNNYH5gKjGPbvI/L9yt8LTxsCLsxQn1VpYUDMYsq6WLenLu6El9k Cekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M43HUrj5; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go31-20020a1709070d9f00b0072edee8a633si6666279ejc.187.2022.08.05.19.41.45; Fri, 05 Aug 2022 19:42:10 -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; dkim=pass header.i=@chromium.org header.s=google header.b=M43HUrj5; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241596AbiHFCUO (ORCPT + 99 others); Fri, 5 Aug 2022 22:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238141AbiHFCUM (ORCPT ); Fri, 5 Aug 2022 22:20:12 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E7B8E2 for ; Fri, 5 Aug 2022 19:20:10 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id z3so3265636qtv.5 for ; Fri, 05 Aug 2022 19:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=hpL2SD3c6BbQtJILsmAr9lDTBlieQYxegWxZpRuWWIo=; b=M43HUrj5YwVccl1wPw3h6jdTTliD4PDE2p4BBvZrsdk6ng5PRnUdcSW33vChDkOoyB FrNZm2U91gE+23UMDJQWzEIpgtlQw6ntW9HdAP/isq7bEMhAVz8hFJYWLBySvcmbBOH0 hQAaTRn31YJ2Zv/rwLvz78JeKO4ftpi+ml9EM= 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; bh=hpL2SD3c6BbQtJILsmAr9lDTBlieQYxegWxZpRuWWIo=; b=tY8CMKlKs0S1yjo8qhmwWx3HVxuEBQDOyLi3o7M4kMv3f7kAX5gCihtNe3a2RpZegx bRcnrSBwnFN0iVwqj/cKvfgOqkMobQcKGgkhf8Cas0b8fI+9GVz/N0muzEiHQLjTYxnC A7M18HNDCxf0o9nRvYkiUmHAAZfyUVh8uyziGKpTbWA4O1JgIy0L0pX/REEd0kdhkjL/ m9reIK6hLcskuqxFT1TOexdKBGGBrIp52d1H0fijzvWgPGFgL0wqoT9hrnCQta4gQDSw v+v+klG4qCB+fDW/tP5exadnMUqFLUEej9AN8d5mhHPgS56Xtu9Y/rY/bI5tnePTPzMD iFGg== X-Gm-Message-State: ACgBeo3RNL7GSkE9kZ1XHpTDUy/fZvvgeb/gXZcSvw+enrCtAkNmFZs0 cygQa1Co84OH6+BoYE73WxbHcvcdinIqVIwT X-Received: by 2002:a05:622a:1c6:b0:342:ea37:387b with SMTP id t6-20020a05622a01c600b00342ea37387bmr1719285qtw.672.1659752409376; Fri, 05 Aug 2022 19:20:09 -0700 (PDT) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com. [209.85.222.176]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a430400b006b5988b2ca8sm4154940qko.40.2022.08.05.19.20.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Aug 2022 19:20:08 -0700 (PDT) Received: by mail-qk1-f176.google.com with SMTP id i24so3075726qkg.13 for ; Fri, 05 Aug 2022 19:20:07 -0700 (PDT) X-Received: by 2002:a05:620a:129b:b0:6b9:211e:aff0 with SMTP id w27-20020a05620a129b00b006b9211eaff0mr2862012qki.552.1659752407244; Fri, 05 Aug 2022 19:20:07 -0700 (PDT) MIME-Version: 1.0 References: <12042830.O9o76ZdvQC@kreacher> <1c7fa65d-47ab-b064-9087-648bcfbf4ab5@amd.com> In-Reply-To: From: Raul Rangel Date: Fri, 5 Aug 2022 20:19:56 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] i2c: ACPI: Do not check ACPI_FADT_LOW_POWER_S0 To: Hans de Goede Cc: "Rafael J. Wysocki" , "Limonciello, Mario" , "Rafael J. Wysocki" , Jiri Kosina , Benjamin Tissoires , LKML , Linux ACPI , Mika Westerberg , linux-input , Kai-Heng Feng Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 I do plan on coming back and updating those patches. I got derailed with other priorities. But as Hans pointed out, we wanted to use `ExclusiveAndWake` to make the decision since not all IRQs can be wake sources while in s0i3. On Fri, Aug 5, 2022 at 12:54 PM Hans de Goede wrote: > > Hi, > > On 8/5/22 19:08, Rafael J. Wysocki wrote: > > On Fri, Aug 5, 2022 at 6:59 PM Limonciello, Mario > > wrote: > >> > >> On 8/5/2022 11:51, Rafael J. Wysocki wrote: > >>> From: Rafael J. Wysocki > >>> > >>> The ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to > >>> use low-power S0 idle on the given platform than S3 (provided that > >>> the latter is supported) and it doesn't preclude using either of > >>> them (which of them will be used depends on the choices made by user > >>> space). > >>> > >>> Because of that, ACPI_FADT_LOW_POWER_S0 is generally not sufficient > >>> for making decisions in device drivers and so i2c_hid_acpi_probe() > >>> should not use it. > >>> > >>> Moreover, Linux always supports suspend-to-idle, so if a given > >>> device can wake up the system from suspend-to-idle, then it can be > >>> marked as wakeup capable unconditionally, so make that happen in > >>> i2c_hid_acpi_probe(). > >>> > >>> Signed-off-by: Rafael J. Wysocki > >> > >> +Raul > >> +Hans > >> +KH > >> > >> Raul had a patch that was actually going to just tear out this code > >> entirely: > >> https://lkml.kernel.org/lkml/20211220163823.1.Ie20ca47a26d3ea68124d8197b67bb1344c67f650@changeid/ > >> > >> As part of that patch series discussion another suggestion had > >> transpired > >> (https://patchwork.kernel.org/project/linux-input/patch/20211220163823.2.Id022caf53d01112188308520915798f08a33cd3e@changeid/#24681016): > >> > >> ``` > >> if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) && > >> !adev->flags.power_manageable) { > >> device_set_wakeup_capable(dev, true); > >> device_set_wakeup_enable(dev, false); > >> } > >> ``` > >> > >> If this is being changed, maybe consider that suggestion to > >> check `adev->flags.power_manageable`. > > > > Fair enough, I'll send a v2 with this check added. > > Re-reading the original thread: > https://lkml.kernel.org/lkml/20211220163823.1.Ie20ca47a26d3ea68124d8197b67bb1344c67f650@changeid/T/#u > > The conclusion there was that the : > > device_set_wakeup_capable(dev, true); > device_set_wakeup_enable(dev, false); > > Calls should be made conditional on the IRQ being > marked ExclusiveAndWake instead of the ACPI_FADT_LOW_POWER_S0 > check. > > Regards, > > Hans >