From patchwork Thu Sep 5 22:02:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 13793037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17F6DCE7A9F for ; Thu, 5 Sep 2024 22:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FGF3ZvR6Fk1EmILbsDBIodK1mVWIH3FK2lGT48LkIFc=; b=lInSpx8cOzoMZevxBmoln6/xht WMDylOci4UtdE+5r6VZwIGP3ZEZnJ09hxPjqlXMcewrJEo5H1oFXJydpBJjMeaOoxLSZ0IQITznIE /vSzebs3Dc01k2IHxEHbjyD6mIbge/xFwXoNGbN0bjvro4MZYS2qjvmilbfzpJ46j9YrZ4+EQKRB9 RQUcITbKc0Wd5VaWBISBwZjRxxMZfBVsPAZ8Ijdy1O2eia7cMFY6cGYC+YyjKmqucRj+WYZyDogBQ 8+1bDIAKLRSB52M71hJd2SD9bt1/f6eBtZh5NtOuSZJK7F/42jf31it8Tg0chu1cVezxNNn/okNEZ TDMyClFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKeX-00000009y4B-3DF3; Thu, 05 Sep 2024 22:08:33 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKZt-00000009xP6-0uJI for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Sep 2024 22:03:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=FGF3ZvR6Fk1EmILbsDBIodK1mVWIH3FK2lGT48LkIFc=; b=TFu1eklfdDf1TmoYPW7W7JM7v1 lcL90FFyLA1Jh5HkpLkhxs5j4PI5DqfmmV5ScvtoRXg6KW0gtQ2hpHaaeByNf+PQVmVrydfEuVdXA CF4Ol9TYzNfFINXCxdMwmitZzUv6mgAb0DzVqF0anUKzHQAjKvDH6fscNJj0AwNbf5DrgVcgirETq yVGExqMFSxZ38GUY8P7W2Zs1PHjL7QMo29KVQ6TZSsV90cvgM2iMHFD3Sw9+RUjOEII7+7AtoF5UM Hjpmd1FQzv8xwkwPvKtN2ddfz6lrvYREcPLfc3sKyE+RxFb0Gm7woZ+/6fhxma7w+GO9xprfm9xXW Z8SxgTNA==; Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1smKZb-00000000Yso-2CzC for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 22:03:42 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-7d4fbe62bf5so1017424a12.0 for ; Thu, 05 Sep 2024 15:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725573805; x=1726178605; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FGF3ZvR6Fk1EmILbsDBIodK1mVWIH3FK2lGT48LkIFc=; b=Tb3ksvT3zrWClHa8J0xgpi7BpLtHXGLKh2OlbuB8pvzH6BhF/wHKpweH0PHbPzX5+C 1HKmHmUjig3+NPtrmkyL6+IzVwT8UAW2q7W+xrq/G9xOHuSt9HdP096FbumVP+JoplPJ irqnFDVTFoVwpSaL64JqKbIgMFS+/LNFc7ljS6aIpQKroiTE/iouP/e6jK2OPiwQpBsI vBKtEcKuzmNmIaqxQkx1G4InYWrJWRNYBUbWr7hcgHu1JQjQ4O2JYKtZixWLcCS5tS26 jlX9K2ASUW8vOD0UQaez5HB0xm1pfXYYqi1xW7tcaBK+lfTPQJyCGkOk893LDB8lRIkE 1k3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725573805; x=1726178605; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FGF3ZvR6Fk1EmILbsDBIodK1mVWIH3FK2lGT48LkIFc=; b=mQXr6eVPguL1JdqV46fB3ikQfp+6qadl/0VbTjR+kY3kPS224ohcDHY/SDOqwz5xVe SZN05fj9v697CgcEhANeQShIzjGTWZ6vC7muSPzFjfPCiBngLNCe4Z3BI8OaJZ6LU4DS dMr8+YJpO/wd+i7l3fBNjooT6IYhi7BWW6i1zoQTEpT2SOtzwbf6pzAKfI48ML0QloHL 9VuEuRDkfUIi17PR9kbcHEz4jIUH2LwUoHYM0skth51zmggEyUAnCh/8/myi3DPNPUaa 0RNR/TTVgUd1NkiwUjqsGggUBn0JbnBdGQ1nXwCgB20TvQaxDOeu3JMJ0jo+MjHbS8So Ppnw== X-Forwarded-Encrypted: i=1; AJvYcCWLGhL/BK16a/4mhJm90rx9KiZB9dy+/M2yzzM2KupJ+kmfpfB19AOBc0TZoA24REcJ7+gFISaFKjTW4gtKvMD5@lists.infradead.org X-Gm-Message-State: AOJu0YwpGMooDPzFviDyNMGh4WMJDmQfMdvJol5KeaQXA6v2t59oPMrJ i829DyiXJfZk8TJxy42g/szZhjeQ94F1VvARahtFTJDouOVwQC5vRtESO7Uc2a4= X-Google-Smtp-Source: AGHT+IEEZQJ3BYRsD9DEp8JNQ2/hJbu7/Bjm8uuHapoacYf7CN7DfNZaZ1J2hXEGctMGI+oUfBCHvA== X-Received: by 2002:a17:90b:2315:b0:2cc:f538:7cf0 with SMTP id 98e67ed59e1d1-2dad4de4cf2mr938741a91.4.1725573804645; Thu, 05 Sep 2024 15:03:24 -0700 (PDT) Received: from localhost ([71.212.170.185]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadc110c90sm5156a91.41.2024.09.05.15.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 15:03:24 -0700 (PDT) From: Kevin Hilman Date: Thu, 05 Sep 2024 15:02:51 -0700 Subject: [PATCH v3 3/3] pmdomain: ti_sci: handle wake IRQs for IO daisy chain wakeups MIME-Version: 1.0 Message-Id: <20240905-lpm-v6-10-constraints-pmdomain-v3-3-e359cbb39654@baylibre.com> References: <20240905-lpm-v6-10-constraints-pmdomain-v3-0-e359cbb39654@baylibre.com> In-Reply-To: <20240905-lpm-v6-10-constraints-pmdomain-v3-0-e359cbb39654@baylibre.com> To: Ulf Hansson , linux-pm@vger.kernel.org Cc: Nishanth Menon , Vibhore Vardhan , Dhruva Gole , Akashdeep Kaur , Sebin Francis , Markus Schneider-Pargmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1516; i=khilman@baylibre.com; h=from:subject:message-id; bh=19dVWBfAz2qQyZpfPFRGd9UeDDF7grrhUskEDkVzmzY=; b=owEBbQKS/ZANAwAKAVk3GJrT+8ZlAcsmYgBm2iqp5OPapR5bQHp7ItAEA/sVZFXbOQcpAExfx 4p/eKOdq/WJAjMEAAEKAB0WIQR7h0YOFpJ/qfW/8QxZNxia0/vGZQUCZtoqqQAKCRBZNxia0/vG Ze+kD/9kvy4WEnApYeODVoUBr1Mgsmt5CwDgDFM8VvblBDeepFM2EET3Dx2SlF1wzOh5BhlfFJ5 N8AOOchs1mCxPNBao6sIHxiShE+aKu5BFmcvJHGrvaPoxkLSvFYI9Y4sKUCmg9jlxkN/cbIEhGr 1OsJpFaZaXZDEzJc0yj5Xk0Vym9eV6F8wpGCtZRj53XSXwizvc7oL3kVXasfokc80hNDdLo70fH eJ4TSihviTqFEEfNSPfp1jPLwRTX4vYoxAa4OgdVeyWINN+9ActgTmrX85VuG6rbqg7aDAUluNA btUoLoiEjTLRAxLJhLpVY7fE9PhygcTXAaIbS6GB4R0E2mEIEP00F92Lk9KuCV09SKLcIhrc66x poPC5s++GKwQUUGJqIf7Wub8Q5gp6msOeZYkTzCgPlj36usjFLdPQKMYHEkvw+CxVuIazRQUeHc 7SGlKiU1rU7Wa6rwvr5olf5krLoUipV8dDFiEu3YGkb0tnLKGnbi5npa201SBjnxmCI9IHjm6kI cgFqsOOFPM9sgDy4YYfZYPwhdJlehRsq2kxWNjxyqELEpF5NZRG3BjS8Nd4u9y8YMVxZjmbdQrZ /SwLnGzrdUXfGOp3L2NYwnTPAmKCxb+vVXWDWwSyu/lUDxcVmyP97+HTjnErXYZCWN1fNt0Mq2m OJhwciWUdKdq5og== X-Developer-Key: i=khilman@baylibre.com; a=openpgp; fpr=7B87460E16927FA9F5BFF10C5937189AD3FBC665 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_230334_559319_2A2E19CE X-CRM114-Status: GOOD ( 13.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When a device supports IO daisy-chain wakeups, it uses a dedicated wake IRQ. Devices with IO daisy-chain wakeups enabled should not set wakeup constraints since these can happen even from deep power states, so should not prevent the DM from picking deep power states. Wake IRQs are set with dev_pm_set_wake_irq() or dev_pm_set_dedicated_wake_irq(). The latter is used by the serial driver used on K3 platforms (drivers/tty/serial/8250/8250_omap.c) when the interrupts-extended property is used to describe the dedicated wakeup interrupt. Detect these wake IRQs in the suspend path, and if set, skip sending constraint. Signed-off-by: Kevin Hilman --- drivers/pmdomain/ti/ti_sci_pm_domains.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c index 1ab1e46924ab..747a7a33c0a9 100644 --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c @@ -82,6 +82,13 @@ static inline void ti_sci_pd_set_wkup_constraint(struct device *dev) int ret; if (device_may_wakeup(dev)) { + /* + * If device can wakeup using IO daisy chain wakeups, + * we do not want to set a constraint. + */ + if (dev->power.wakeirq) + dev_dbg(dev, "%s: has wake IRQ, not setting constraints\n", __func__); + ret = ti_sci->ops.pm_ops.set_device_constraint(ti_sci, pd->idx, TISCI_MSG_CONSTRAINT_SET); if (!ret)