Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2923831ybt; Mon, 22 Jun 2020 10:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybxELJo5CzQSBeEcK5MI+fkg25Ej9145Ph2Bb+ToL0f4sEAPAf0IwJbCIf6kuozcLCVsZl X-Received: by 2002:a17:906:6dca:: with SMTP id j10mr11986915ejt.64.1592846361602; Mon, 22 Jun 2020 10:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592846361; cv=none; d=google.com; s=arc-20160816; b=q3G6Iel6UCHAGhpZ69yBgcHVUdwdJX2XE4fSrK3ZoaOQlIu7BhbMlChBgW+xgWOnDX dTqBUkOM1m0uo6YY8xaGdFlDXfHVBV2e+DNUpkXlkslaDQzd9gKtrJe0HgEkQtKETsmm +oscjIfZWxGqboL3Deep/b/Xx3r88rEHi2p3LyU4XnmTMYbJQihOdumgbXml4DnD7a1L zqD+/Sz2wWyPEmiWPYpMXEyp22VDMNGZKSPVsRZMsiuDS+Um90hiTbWw8YbLgVexhETM mgVFjBkEU1rinx8IAsKiq9btEGWXeQX441ct22M9ik8rshyTJIMlMq5p1XIT/YTBkEJE j0zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=t1yTyIDrNfy2H6CKPPt3zb+vuoxTSyU3seJh4xJ421A=; b=uJTe79zv7WLMDqx1KnZ6NOBxqq8Od4JpAmD7coFBAuKPzr0F6QVBVlNKWym5q5NgxA p1EOENJtfmjRM7O9za1r6S23RiuLDbK1fsrw1JKsC2+f/6YXP1nJnqH88ELpi4DyrTPf gVivUIPOLVIWi2345c2bneHi8VCIaXSJFOoxO2V2QjxJB60ToOl1Vb3zwjCyM55T8zXS h9gDM8bS55y5Z2DQo+FJEDDcIUsZd0d7XsoTRl1WU2P+b73+grXCYYnhvDX2+IaCU2kB zPuhZvVNzGB+fxYSbsy8xk/ZvEfi28kKZ4/oSUOifgXHYtBTV5ry+SKxbAtNnFIE0PVw hyhA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si9475374ejc.462.2020.06.22.10.18.58; Mon, 22 Jun 2020 10:19:21 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729978AbgFVRQ7 (ORCPT + 99 others); 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