Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1260296pxf; Fri, 9 Apr 2021 04:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIT+OHvU9lDgGWLeIlRIn42iQ0Yevxh4X7ZpwNRDAEGIeFXg+53tdHi4oCFWnX2hvSrt7s X-Received: by 2002:a17:90b:1e0f:: with SMTP id pg15mr13479766pjb.51.1617966970485; Fri, 09 Apr 2021 04:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617966970; cv=none; d=google.com; s=arc-20160816; b=z+nouv05ej5qLLCmUVxPa26HVmntkttmgM6UsoE6Tv1ZQ1/BM32xX1tcmjKirI+P6K 46NJOa2vOGz5bTwOn9KX2k5gSUNoSK7mYXVRjdSgT9wTNqqFJFF+kRnnUIShlGYJiHrp 0GDgUAB4SOyJ8avFvGYnA0qHZ9HM8Dwwfopse9DglqKSxnTXdRYultkLuYawqLGOmFNm CVEflbyYdAhSWHSyytaDqTFv+W8kqdEVAGStr9PW9lSNErJaL99z9aFBMWtB9xaDmBAP cswNSbN+v4s1pAuxA2kRgl9j3ArBChnL9vTgS6++0M0vi505wU6SmyvXCaBV9g6gtg9X XUKg== 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=Rxjs0bOzud5jPgrtCrFonjn8TrOn+6BSTDUNWNa5VkA=; b=xDoL0wQNI/eWPPgBggpnS6Y5x/V0Q+UyTahONl4BriLpVBEzCcpucG59n0Ao2ZsoZ3 NWhQ+bxaPl4xfMaCJFIz4X4MRHM7phBr5lFCv3W/9WRQh79yZRDxQlEQF/KKLDzRRkX4 gD0eRGAs672Xn/CQT65HrPEegv8wpHV9NzYOeowtqury8KxTmwy9wFVQF05SUJlGl0lF QOFbTdLs1v8cBSXUPf2A+IlLERd63eD6FbCG8VL6POJOergvzsQYkyV5auU65zFAZWaS qSFZWOLuUzSM+Cm8VAtSN5KT3wvWiTgI11hlKnO7FT6LuVaL5OrMzk/AfNn30iPLlXR5 ZU5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si2750302pls.90.2021.04.09.04.15.57; Fri, 09 Apr 2021 04:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234012AbhDILPG (ORCPT + 99 others); Fri, 9 Apr 2021 07:15:06 -0400 Received: from mail-oi1-f173.google.com ([209.85.167.173]:39707 "EHLO mail-oi1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233995AbhDILPF (ORCPT ); Fri, 9 Apr 2021 07:15:05 -0400 Received: by mail-oi1-f173.google.com with SMTP id i81so5384636oif.6; Fri, 09 Apr 2021 04:14:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rxjs0bOzud5jPgrtCrFonjn8TrOn+6BSTDUNWNa5VkA=; b=XeF9AXNlN/rmxxhZVdABNMCYq13Y2K8LaepjVmT0/dzS+ckWkUZZPeYlO+KpSK87uA yW7uWVnJxOGAaPu4JZpBF7tPYEALKyzLOIVjW7Dtk6aCcy+AqHfTKCriG0wUoteS3OqW ws/yyVXuwrTUsrvTutwu5x9qYxa0UUJP+HdQ7h/VuhRLOxTlKeRsSwq8noF+AysM9jI4 csswg75J51YUijgFeZqvCARUHqLP8gXMJgeP76WxbJL43utgxjV0466kxIUZ570aakRi L7FXcJnkbwIrOjToAf39q6Y2rvNMTLdZem2SO+n4vZdVUhFSrtNIgorEmBig1XKDYvFu WZcw== X-Gm-Message-State: AOAM531f67wHBDbcDgsGY+sj3/PKGVvFE2+8Ve4q19njXS3MYnJUThV/ Z1lQC8kc3smMupehTD/dkTB4Z/Zlemvuy3THo64= X-Received: by 2002:aca:5fc3:: with SMTP id t186mr9286785oib.69.1617966892336; Fri, 09 Apr 2021 04:14:52 -0700 (PDT) MIME-Version: 1.0 References: <1617874514-12282-1-git-send-email-chunfeng.yun@mediatek.com> <1617933211.12105.22.camel@mhfsdcap03> <1617957362.12105.27.camel@mhfsdcap03> In-Reply-To: <1617957362.12105.27.camel@mhfsdcap03> From: "Rafael J. Wysocki" Date: Fri, 9 Apr 2021 13:14:40 +0200 Message-ID: Subject: Re: [PATCH 1/6] PM: runtime: enable wake irq after runtime_suspend hook called To: Chunfeng Yun Cc: Tony Lindgren , "Rafael J. Wysocki" , Rob Herring , Mathias Nyman , Greg Kroah-Hartman , Matthias Brugger , "Rafael J. Wysocki" , Len Brown , Pavel Machek , "open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:" , Linux ARM , "moderated list:ARM/Mediatek SoC..." , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Linux PM , Tianping Fang , Eddie Hung , Ikjoon Jang , Nicolas Boichat Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 9, 2021 at 10:36 AM Chunfeng Yun wrote: > > On Fri, 2021-04-09 at 08:39 +0300, Tony Lindgren wrote: > > * Chunfeng Yun [210409 01:54]: > > > On Thu, 2021-04-08 at 19:41 +0200, Rafael J. Wysocki wrote: > > > > On Thu, Apr 8, 2021 at 11:35 AM Chunfeng Yun wrote: > > > > > > > > > > When the dedicated wake irq is level trigger, enable it before > > > > > calling runtime_suspend, will trigger an interrupt. > > > > > > > > > > e.g. > > > > > for a low level trigger type, it's low level at running time (0), > > > > > and becomes high level when enters suspend (runtime_suspend (1) is > > > > > called), a wakeup signal at (2) make it become low level, wake irq > > > > > will be triggered. > > > > > > > > > > ------------------ > > > > > | ^ ^| > > > > > ---------------- | | -------------- > > > > > |<---(0)--->|<--(1)--| (3) (2) (4) > > > > > > > > > > if we enable the wake irq before calling runtime_suspend during (0), > > > > > an interrupt will arise, it causes resume immediately; > > > > > > > > But that's necessary to avoid missing a wakeup interrupt, isn't it? > > > That's also what I worry about. > > > > Yeah sounds like this patch will lead into missed wakeirqs. > If miss level trigger wakeirqs, that means HW doesn't latch it? is it HW > limitation? If it's level-triggered, it won't be missed, but then it is just pointless to suspend the device when wakeup is being signaled in the first place. I'm not sure if I understand the underlying problem correctly. Is it about addressing spurious wakeups?