Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7432086rdb; Wed, 3 Jan 2024 16:29:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOdTI4Jx+qfL26GRIwlKUM83IFKopGLPR39heGYrROsEbezEpyyhXzRGbrRkCwHT/5tVJw X-Received: by 2002:a17:906:2bd9:b0:a27:5f87:4d5d with SMTP id n25-20020a1709062bd900b00a275f874d5dmr4626785ejg.103.1704328188454; Wed, 03 Jan 2024 16:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704328188; cv=none; d=google.com; s=arc-20160816; b=NzfrmfI6Yl8ZDQOGE16UmK7T7qpvFag+fxXd/P/80VWnyZh1Mpxu7Hn5rOOE5yEDBK JK8qbPF+GROIGO1roWo5UqCzAaBAnV2jfExs0Mmmbg1iLDS2KX3pH4+3dPCVVpObsm42 +VXLrIUvoliMJ/bRATdo/3q01nbYg//A2/nJJYwmfMgcz6kNkG004ijMqovAh7HoO9Ut YVLPy+k4SL478r+GBeBSKImDj3+V3ovlz0Xg3bNp+W4Q2EPidaTEQkoo7MJN1ytnNVDY mp39aFVYJ4Dv/ax9ln+F0xPQzwAgYJWymcpe+2VSAcfjNTja016lMD3MHsItKXhqZpHh 2vWQ== 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=eFX55NQWA+9lL7CtE2Bgpp65JEIghVU5OMsa8HjOyp8=; fh=krIO59xsCuuLORbJVONa8WLztOPdt1WqZAIRXTVM5GE=; b=TfyQZzWvSzaMxJI/IkFv5L30D3aSsH4OaG5824WFl83xFuJVe8W+g4NPXIEIpc94LM FWaVjVpy3iuTRQKJ6oOfN+Cve+ION8ylxj6tbCyPdF51tBiv9tjTc1ZxdsmpPCwAQvXg SFX77smQuXsLeT0WhL7KBj/GvWdR3oaU5C3Sq73UDOQ+3ZmXzbCiDmSNrb9H0kPo9Ey/ OjA7qYBF7ydvLonIEKI+0g3vyQ66NdzLHZTb1idGOce6mGmZLme9QhbIjUK5wJ8uzsT3 hrOeYiuXyLm2F4TJHrvQJT7/jYc/JgoWIQ+1RF4RD2rsgkXqskpcYm7QbKAVMi6G1yQi QyLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZpaJxDI8; spf=pass (google.com: domain of linux-kernel+bounces-16146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id eu18-20020a170907299200b00a28d14467desi163033ejc.1045.2024.01.03.16.29.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 16:29:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZpaJxDI8; spf=pass (google.com: domain of linux-kernel+bounces-16146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16146-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 am.mirrors.kernel.org (Postfix) with ESMTPS id F400C1F26109 for ; Thu, 4 Jan 2024 00:29:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42FFE653; Thu, 4 Jan 2024 00:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZpaJxDI8" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 BCFBB371 for ; Thu, 4 Jan 2024 00:29:36 +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-f48.google.com with SMTP id 2adb3069b0e04-50e741123acso9116075e87.0 for ; Wed, 03 Jan 2024 16:29:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704328175; x=1704932975; 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=eFX55NQWA+9lL7CtE2Bgpp65JEIghVU5OMsa8HjOyp8=; b=ZpaJxDI8SVeVzdenMGTQZ8ekZDGt0d910p7LdD9yFJPtNogw6pRiIuU3q56T4i8ZtC IWHWlgPyZaUgknwD1+/GtIKNFL+wIs3QPyfXc4hTDjsWzGUNLuji5kPbDej3CrnLROaP vGNq1vgAFP1xivFFzplloGo5x0M3cypGfGAgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704328175; x=1704932975; 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=eFX55NQWA+9lL7CtE2Bgpp65JEIghVU5OMsa8HjOyp8=; b=W2AkhmV3GHnuma5h94vKYCKLcNMBNvQY8tklxte427RQSl9fi+X6WaQ1dU2jLiZKnT pyRqy09JJQr9f5tAl6wgIM0kGAGPvXgZlFEYj9Ds8csiFYN2GbzYlf5vxptbr3uZHlye WWeQg8ukO9g6sNdjkAWowqx1P/KIh3L6/Le3Ezh5nyEeIL/tsDkuw5PaXW6Wd+HswZmV j1EP2zQcorlmpfYIWX1BzVUdv/Yu8O0RXGFFq18tFBc9WSIVMpYaUfyP+ZNLYhHv3X2k eevBvXG/L6rqK8DLN6ttxgOq4h9EuQQMGnnQGfpVMAZXkU5upKkwNgRM4Bs/MMRB4GAC 0GHQ== X-Gm-Message-State: AOJu0YxyKfg3XWoLZOgwgXZ5N8UpvgX/WUHBEtl7/ZGBTx6KwVleToqr X8Nkq8V51jillRJzpUPPwvKT4W5TZkBE5JEwNtlaVbHq10ra X-Received: by 2002:a05:6512:3e24:b0:50e:6b5d:59fa with SMTP id i36-20020a0565123e2400b0050e6b5d59famr9614253lfv.4.1704328174770; Wed, 03 Jan 2024 16:29:34 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 3 Jan 2024 16:29:34 -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: Wed, 3 Jan 2024 16:29:34 -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-03 14:25:25) > > The DTS patch would go through the platform maintainer tree and be > > pulled into the soc tree and sent up to mainline from there. The > > platform/chrome patch would go through chrome platform tree and then to > > mainline. The bisection hole will be real. > > I thought it would all get merged in the next merge window. How are > bifurcations like this normally dealt with? Does one wait for the > first series of patches to land in mainline before submitting > dependent patches? That could take two merge windows. It's usually fine to land in the respective maintainer trees because the driver is written to be compatible with either version of the DT. > > > > > > > > Does using the pm wakeirq logic require the use of 'wakeup-source' > > > > property in DT? A quick glance makes me believe it isn't needed, so > > > > please split that part out of this patch as well. > > > > > > No, 'wakeup-source' is not required, it provides an indication to the > > > driver that the IRQ should be used for wake, which then enables the pm > > > subsystem accordingly. If 'wakup-source' is not used, we're back to > > > square one of making assumptions. Specifically in this case, it would > > > be assumed that all SPI based EC's are wake capable. > > > > Is that the wrong assumption to make? My understanding of the DT > > property is that it is used to signal that this device should be treated > > as a wakeup source, when otherwise it isn't treated as one. In this > > case, the device has always been treated as a wakeup source so adding > > the property is redundant. > > For SPI, it's not the wrong assumption. I was trying to drop the > assumption though to match ACPI/LPC behavior. Ok. Is the EC always a wakeup source? Not the EC irq, the EC device. > > > Making the patch series dependent on the > > property being present makes the driver break without the DT change. We > > try to make drivers work with older DT files, sometimes by adding > > backwards compatibility code, so the presence of the wakeup-source > > property should not be required to make this work. > > Do we have use cases where Chromebooks are running older DTBs? I get > the idea in theory, but don't grasp why it's needed here. It's to make the kernel bisectable while the DTB and driver patches are merged through different trees. > Regardless, > I can update the SPI code to assume a wake capable IRQ. But I'd like > to keep the prerequisite device tree patches unless there's a good > reason to drop them. Specifying 'wake-source' certainly doesn't hurt > anything, and there are other improvements to the OF > subsystem/documentation. I don't see any harm in having wakeup-source in the binding, but I'd prefer it is behind a different compatible string as optional, and introduced when we need to have an EC that doesn't wake up the system. Otherwise it's all future coding for a device that doesn't exist. It's also a potential landmine if the driver patch is backported somewhere without the DTS patch (maybe the DTS is not upstream?). Someone will have to debug why wakeups aren't working anymore. > > > What is the goal of this patch series? Is it to allow disabling the > > wakeup capability of the EC wake irq from userspace? I can see a > > possible problem where we want to disable wakeup for the EC dynamically > > because either it has no child devices that are wakeup sources (e.g. no > > power button, no keyboard on ARM) or userspace has disabled all the > > wakeup sources for those child devices at runtime. In that case, we > > would want to keep the EC irq from waking up the system from suspend. Is > > that what you're doing here? > > The root of this patch series stems from a bug where spurious wakes > are seen on Skyrim. Are all 24 patches needed to fix spurious wakeups? Why can't we do a DMI match table for Skyrim devices and disable the wakeirq logic on that platform? That would be a much more focused and targeted fix, no? > Copying some wording from the DTS patches: > "Some Chromebooks use a separate wake pin, while others overload the > interrupt for wake and IO. With the current assumption, spurious wakes > can occur on systems that use a separate wake pin. It is planned to > update the driver to no longer assume that the EC interrupt pin should > be enabled for wake." > > This patch series will allow us to disable the ec_sync pin as a wake > source on Skyrim as it already uses a dedicated wake gpio. Aha! This last sentence is the detail I've been looking for. Please put these details in the commit text. "Skyrim devices are experiencing spurious wakeups due to the EC driver always enabling the irq as a wakeup source but on Skyrim devices the EC wakeup signal is a dedicated gpio separate from the irq." Please be direct and specific instead of writing in general terms.