Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3028388ybt; Mon, 22 Jun 2020 13:04:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNKLpw/OWkadZOo5+qH/asOEk8bkAE2jTjwocuSnjKF17lCUeBKle7v3cX64zauRUtTF1J X-Received: by 2002:a17:906:3152:: with SMTP id e18mr3452892eje.137.1592856263264; Mon, 22 Jun 2020 13:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592856263; cv=none; d=google.com; s=arc-20160816; b=h51XKVHw6CoO91COxpQFGLDi5e05KHRPLzpB/qu293mCfM6dcV07kxhzANX3yehPzZ C0CBrHDbRjEJ9VvGoQ1L8h7v+b+Nb/6iiA+0ymGztBr/pmwPp/Aq/DldFsV4i0pVBQUJ 4QoebSgIBWxGuBOEqO0P9V/pQVE6B3kf+nKqpBn/cPR74CR4ORCrJzPGtmOq8sMmZh6l bKhQvfBRVUkbPjMkIXPUd+BrImKarhyrprnOP6umLjVNSZfT1voPedezzPyZPZq37wO3 N3kQMzTA4jNbHQi+CbOC91zdhlJLeJTKX4GAZ1M2oVGGqCPbYdmrQXsex0Fg1ub9pLws r7Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=JFdwqUBGOKpOca1lCZxVxlB36FkBn0nL9aGlhv7LobQ=; b=Vqo/PL/Xg31m8vtVQWGlGa/OLXXPoD7/sCcHAMO0KpCR1exOxYWm6Jy73rs2AjDtgI zll6AI9sDKDn8pMIiIMKyaydifLURJVZHjSAHT4AGyDTpmbOTxIDvPsQdGFAsqrtmU92 f7c4MqupNBIUytYO3NIEanCFQjemASjn+QwzqbmT/Mu0m9GEszsrYwGiIyy9wJy3pKcE 0rbb2B+LhzPrkzl0aoML5DAsln6QUNY40uQDQFNgAngIhS/UzmI0CrRW1noJXSZRZJDW bBEpBpoMxLYKGj9ehWAdLH6gZ1BV3q3TAbsHVjrKPHXmJCnrKvylGXGfTLWodVd7XcEa eNdQ== 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 os21si2317071ejb.205.2020.06.22.13.04.00; Mon, 22 Jun 2020 13:04:23 -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 S1728363AbgFVUCQ (ORCPT + 99 others); Mon, 22 Jun 2020 16:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbgFVUCO (ORCPT ); Mon, 22 Jun 2020 16:02:14 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A44C061799; Mon, 22 Jun 2020 12:45:48 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id g5so14134167otg.6; Mon, 22 Jun 2020 12:45:48 -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=JFdwqUBGOKpOca1lCZxVxlB36FkBn0nL9aGlhv7LobQ=; b=mrE8dhiZyWSJCooMpy21gElfdlMaAnNp9S4hl13ZtuiGMzf/ygBGunFbF5dmV5mM/p QEdNGQRCRelWjMeSbRkrB4Ee6T1l+Mn3IQ5BUOYLLwJrrOhvNctfo9SBqIP1g9JZRJ1j W3zZ0LZyjLHsJRiW39Nfr3s0zrPOhvq3fbaCj/gvTwEeWuvy3sd6Orbmw7/JyuB+Bvvb +pRSPATYij9WIgepBHhadboL9Hdq4LJNn589ASrqxthDNQsXR6ZdhbTmYajRu0hvu1BP XBURiO+zCKMPHVDvFxGW4KEtasblhBHwfAy5VwWVK/ryo9VP1d+PVTFFHHdaD3ab/5t+ Ouuw== X-Gm-Message-State: AOAM531gnZC40uY2G0YSCwLmpYu2aFkcbX7ALzSx85vORPkRfWkz9c/F 7zCEVNRVBm1m9OFLDEBmzDhOZwM79yj0BvAZPy4= X-Received: by 2002:a4a:6513:: with SMTP id y19mr15673738ooc.75.1592855147614; Mon, 22 Jun 2020 12:45:47 -0700 (PDT) MIME-Version: 1.0 References: <20200616040442.21515-1-yu.c.chen@intel.com> <20200622171759.GA26527@chenyu-office.sh.intel.com> In-Reply-To: <20200622171759.GA26527@chenyu-office.sh.intel.com> From: "Rafael J. Wysocki" Date: Mon, 22 Jun 2020 21:45:35 +0200 Message-ID: Subject: Re: [PATCH][v2] PM / s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle To: Chen Yu Cc: "Rafael J. Wysocki" , Peter Zijlstra , Len Brown , Daniel Lezcano , Ingo Molnar , Linux PM , Linux Kernel Mailing List , Rui Zhang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 7:16 PM Chen Yu wrote: > > Hi Rafael, > On Mon, Jun 22, 2020 at 06:19:35PM +0200, Rafael J. Wysocki wrote: > [cut] > > > +{ > > > + if (!current_clr_polling_and_test()) > > > + s2idle_enter(drv, dev, index); > > > + > > > + return index; > > > > Is the value returned here used at all? > > > It is not used for now IMO. > > > */ > > > index = find_deepest_state(drv, dev, U64_MAX, 0, true); > > > if (index > 0) > > > - enter_s2idle_proper(drv, dev, index); > > > + call_s2idle(drv, dev, index); > > > > I'm wondering why this can't be > > > > if (index > 0 && !current_clr_polling_and_test()) > > enter_s2idle_proper(drv, dev, index); > > > Yes, it should be simpler, but I guess Peter was trying to > make call_s2idle() consistent with call_cpuidle(), > and also s2idle_enter() is analogous to cpuidle_enter(). So IMO it would be better to do the simplest fix first and then do the cleanup on top of it. Thanks!