From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25AB0C433B4 for ; Fri, 9 Apr 2021 11:14:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE2E4610F9 for ; Fri, 9 Apr 2021 11:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234006AbhDILPF (ORCPT ); Fri, 9 Apr 2021 07:15:05 -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-Google-Smtp-Source: ABdhPJzqQwV2RLtxpvy3bdjEZbTiGwM6R2VqAkJLIvDpOTRgfz1/jDCWilo+43fl261e+3ylK2QTCgBnzn1M84H/KAA= 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-pm@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?