Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1863058rdb; Mon, 8 Jan 2024 12:48:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXKbYXcYJ6bD3PU45geAyx2t8tsjq1kyzq4zX4PCpdl4N4/08vWxz0bxXZpY3ykH5dG6WR X-Received: by 2002:a05:620a:45a8:b0:783:29b3:bf1a with SMTP id bp40-20020a05620a45a800b0078329b3bf1amr1073530qkb.107.1704746881935; Mon, 08 Jan 2024 12:48:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704746881; cv=none; d=google.com; s=arc-20160816; b=zD21iNqrRhZ3r5fOHecCUAOGrc5pj8MvEtDaVvSvE5UIV+C2/E50/Z0NbttXM6P9lx T6LjqqwJQHoJP6mBWkX7LiwyNAGwpXGT7hpTy38qVFUs4ukD7z66urpo9uNu6LtURGnY TpKZhvNvTjv3jsjZ6YZxAa4C+z1N0lxoICkvlIjS1uL8cpBngqx3C+dluC2PDKZwR8Px lqt9d1G9SPu2Le5TKcSbZX+5JkOSuN6LaVsUSX3GRBDNd5ZglyhAD2a8+uTQx/VghKHv R6pWMxrYtWNwUrAU/NiUpRDoSfM35cYfCEAWbRgNwMkzpNQQb5SfWIUcluJIdTaUNeL7 IIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=4j2m9ttyYBnQGcELMK0PzOZL5BgPNtka95T8FKd/tY0=; fh=krIO59xsCuuLORbJVONa8WLztOPdt1WqZAIRXTVM5GE=; b=JC5tpxHfC5msWbrCItp/D9lgkkATWhxj0srnqTNaVX15XjxDXVPXPewpbeoiV7CnqJ UgzCtGZfVurgGkziI4MWHZ3liVw+l397Co8XZPSMuy44/nIMhYivdl/p5685xSzeqSDT LQplczn8Hr54AksyhM8BK8fRPjg15qhlhbZyh/ADcAwkjP92+X7PHGT6LxDAHugr9t69 nTwX2CUYYNPlwlKZRjf62whifDJ2etioGYWBNM7Sp2Tt95fNhot6SuK5M+T6SQkww1Fr 3A0Q6u9+P+2MnEhaHjLuXpwUvnZpp0gG1alulmvmfNTEoCBpluhenOXnIko+B9HCdrkf Lhvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HQ1Hwazy; spf=pass (google.com: domain of linux-kernel+bounces-20107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m13-20020a05620a290d00b007819e1e4697si552984qkp.646.2024.01.08.12.48.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 12:48:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HQ1Hwazy; spf=pass (google.com: domain of linux-kernel+bounces-20107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A0B6E1C22F31 for ; Mon, 8 Jan 2024 20:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 399A555E55; Mon, 8 Jan 2024 20:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HQ1Hwazy" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C25FE55E46 for ; Mon, 8 Jan 2024 20:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-50e5a9bcec9so2719471e87.3 for ; Mon, 08 Jan 2024 12:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704746871; x=1705351671; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=4j2m9ttyYBnQGcELMK0PzOZL5BgPNtka95T8FKd/tY0=; b=HQ1HwazymMZ+ThalIPCz24sdwuZkhn0OeBUe1WSuMq+S4ahNO3VV9hc6CIkmshgmIk mhrwgZ9LrG/mMmfcmLcQgs/i/u7rTwVAUvxP8SndqJ+qreTd4QBCEiyP1VVk28avBSMW ghse6x7eXCqoJrIPls/jj/2KEwYOGkOxLEmZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704746871; x=1705351671; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4j2m9ttyYBnQGcELMK0PzOZL5BgPNtka95T8FKd/tY0=; b=APIwP//BziiM66x+QN9NLCpIfemPCFo3CrVOtMYfne5yMWF8vzrOk6i/4LQm28N64r Aa1PIqudfpj7ckyM/pwiAnoPLluag+hj9+1a3pHzck2OYL6Uz+0XXe05MHNVwj9Q+thY xN5XVJ4DXWXdf5N7qhyIwxUS9xfMTAydTkHnfKOPJ+TqNNEoN9THM7UaNGdP7U5lSAGg nhUrbva0/YBYswZiKyvJ+7QRaRV5Az4BgogJkR3vwTmfgDijAj/VvXgqGsGw9Y70xvGL 053q1YzwBP7bG69EKfqVtsq/P8Npm60sNd7G2UiZsuljnOFurWirLF/Ch6vV0X8peKVx FxVw== X-Gm-Message-State: AOJu0YwZ3bkWjYfQfudcTZL1v2r0K7fu+6mcxKscowaKyKmwGWrn5xJF YzVlEweplzz3nc5l/BIXWQ4uZEidvrT7zP8OUkZ6GRFIxb7A X-Received: by 2002:ac2:5de1:0:b0:50e:6032:984b with SMTP id z1-20020ac25de1000000b0050e6032984bmr1754251lfq.110.1704746870844; Mon, 08 Jan 2024 12:47:50 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 8 Jan 2024 12:47:50 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: References: <20240102210820.2604667-1-markhas@chromium.org> <20240102140734.v4.24.Ieee574a0e94fbaae01fd6883ffe2ceeb98d7df28@changeid> From: Stephen Boyd User-Agent: alot/0.10 Date: Mon, 8 Jan 2024 12:47:50 -0800 Message-ID: Subject: Re: [PATCH v4 24/24] platform/chrome: cros_ec: Use PM subsystem to manage wakeirq To: Mark Hasemeyer Cc: LKML , Sudeep Holla , AngeloGioacchino Del Regno , Rob Herring , Andy Shevchenko , Krzysztof Kozlowski , Konrad Dybcio , Raul Rangel , Tzung-Bi Shih , Benson Leung , Bhanu Prakash Maiya , Chen-Yu Tsai , Guenter Roeck , Prashant Malani , Rob Barnes , chrome-platform@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Quoting Mark Hasemeyer (2024-01-08 11:56:44) > > Isn't this patch series making the wakeup-source DT property required > > for all existing DT nodes? I'm saying that the property is implicit > > based on the compatible string "google,cros-ec-{spi,rpmsg,uart}", so > > we shouldn't add the property explicitly. Just rely on the compatible > > string to convey the property's existence. > > The current wording in 'wakeup-source.txt' states: "Nodes that > describe devices which has wakeup capability must contain a > "wakeup-source" boolean property." According to that wording, the > existing DTS does not match the expectation. This is what led me to > add the property. However, feedback from KML mentioned the wording may > be a little strong and it should be updated. Hence patch 04 in this > series. > > I can revert the SPI driver to assume wake capability, which will no > longer make the wakeup-source property required. At that point, > leaving the property in the DTS simply provides an indication. Considering it > won't be required, I can drop the DTS patches that add the property. > > > I'm no expert in ACPI so sorry if I'm misunderstanding. The driver > > unconditionally enables wake on the irq. > > Yes. > > > Most other chromebooks have > > added some other interrupt (GPE?) for wakeup purposes, which is > > different from the irq used for IO? > > The GPE is used for wake and IO (It processes ACPI notify alerts). > AFAIK, the separate IRQ was introduced for latency reasons as the GPE > path was too slow. Alright, I don't know what ACPI notify alerts are so most likely that is causing me confusion. > > > And this patch series tries to > > figure out if enable_irq_wake() is going to fail on those devices so it > > can only enable irq wake if the irq supports it? When does calling > > enable_irq_wake() not return an error to properly indicate that the irq > > can't wake? On skyrim devices, where presumably it needed to be marked > > in ACPI differently? Or does that platform really support wake on the > > irq, but we also have a GPE so enabling wake on the irq is not failing? > > The patch series does two things: > 1. Determines whether the irq should be enabled for wake, as opposed > to assuming (at least for LPC/ACPI). > 2. Moves enable_irq_wake() logic to the PM subsystem. > > Skyrim does _not_ support wake on irq. It uses a GPE. So the patch > series drops the assumption that irqwake should be enabled. Does the call to enable_irq_wake() on skyrim succeed? It seems like the driver considers failure to enable wake on the irq as the way to figure out if the irq supports wakeup or not. I'm trying to understand why anything needs to be changed. > Instead, > it polls the ACPI tables to determine whether or not the IRQ should be > enabled for wake. > > > Having to backport 24 patches to fix a bug is not good. > > Some of the patches were DTS related as a result of my interpretation > of 'wakeup-source.txt' (see above comment). Other patches are > tangential based on KML feedback to fix things that are orthogonal to > the bug itself. Fair enough. The fix should be isolated and be early in the series so that we don't need to backport the whole stack to fix a bug. > > > Can the driver > > look for both an IO interrupt and a GPE and then assume the GPE is for > > wakeup and the interrupt is for IO? > > No, some boards need the IO based irq to wake, and may use both. Ok. > > > > 3. Leave the existing solution > > > > How is 3 an option? I thought this patch series was fixing a bug. > > I meant the solution in the existing patch train. Got it.