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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 CA302C433E1 for ; Mon, 22 Jun 2020 17:17:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3D6720707 for ; Mon, 22 Jun 2020 17:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729992AbgFVRQ7 (ORCPT ); Mon, 22 Jun 2020 13:16:59 -0400 Received: from mga07.intel.com ([134.134.136.100]:45056 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729309AbgFVRQ6 (ORCPT ); Mon, 22 Jun 2020 13:16:58 -0400 IronPort-SDR: 86mAV5nhuhI2qHoZ+TnVsJ2aL9OvBy/Zw6fI7cDO/SATsH7OBXLYpabw9NQ64fjmFcRmTXWGW4 uQY9ubV4wKWw== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="209013397" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="209013397" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 10:16:58 -0700 IronPort-SDR: +l1MFBOMI9UhPmyFiCJ4R+cL2z3IkOTUTF9pRTc+CphmYwvRwUqLABqom5f94wtlmyqtCnrZds b2fHQJn3BHUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="300909504" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga004.fm.intel.com with ESMTP; 22 Jun 2020 10:16:55 -0700 Date: Tue, 23 Jun 2020 01:18:00 +0800 From: Chen Yu To: "Rafael J. Wysocki" Cc: Peter Zijlstra , Len Brown , Daniel Lezcano , Ingo Molnar , Linux PM , Linux Kernel Mailing List , Rui Zhang Subject: Re: [PATCH][v2] PM / s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle Message-ID: <20200622171759.GA26527@chenyu-office.sh.intel.com> References: <20200616040442.21515-1-yu.c.chen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Thanks, Chenyu