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,URIBL_BLOCKED,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 120A9C433DF for ; Tue, 23 Jun 2020 01:56:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECCDD2075A for ; Tue, 23 Jun 2020 01:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730804AbgFWB4P (ORCPT ); Mon, 22 Jun 2020 21:56:15 -0400 Received: from mga07.intel.com ([134.134.136.100]:25133 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730458AbgFWB4P (ORCPT ); Mon, 22 Jun 2020 21:56:15 -0400 IronPort-SDR: mnkc2gtWSsxFihg+R3qdq6HCEDl8N/UZMcAlzPMH16Lh1MVKp9mCezzojnpxs1ZjfBgxn0DlDp ed5UFuSkVONA== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="209123801" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="209123801" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 18:55:26 -0700 IronPort-SDR: c7fQlezvt9UUct1YKe9X4P7jCCWicimvxVRgDSFVd67T7uaPCDncj+d4Pj/U1iCPzJcXiRB+Bo qePFxiETuZeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="452047841" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by orsmga005.jf.intel.com with ESMTP; 22 Jun 2020 18:55:24 -0700 Date: Tue, 23 Jun 2020 09:56:28 +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: <20200623015628.GA28671@chenyu-office.sh.intel.com> References: <20200616040442.21515-1-yu.c.chen@intel.com> <20200622171759.GA26527@chenyu-office.sh.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 On Mon, Jun 22, 2020 at 09:45:35PM +0200, Rafael J. Wysocki wrote: > 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. > Okay, I'll do that. Thanks, Chenyu