Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3228267ybt; Mon, 22 Jun 2020 19:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPczwgXNR4oh3RlWGAjqxKRjH78QWKE6TcWwSQQ1+UrytUP2b2MVaoZwdkUjwzrmorforq X-Received: by 2002:a05:6402:1604:: with SMTP id f4mr20427699edv.379.1592878097001; Mon, 22 Jun 2020 19:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592878096; cv=none; d=google.com; s=arc-20160816; b=hqkmKpBhayTpoEaXMgwwmP7mOET9RWts/IokKeZcDdM5BHo61q5aP3lAZ1zl/gzpFY kLjN6dUGs5elIo4LvvrQUNvxefolbr/gVIDUtQIBJFQLcv+/L+/NPhl1xqyIpeckhcZT zYZktYCFeHWwzY+dLLxEZwAFXKKKPPLWENq3kYS0zHHxbORrlgPPLB+6FQScg+pjOaMc p7b5k1HCGpQRUJNwigd+IAE6Y9Jmz7TMGnN0b/0KnA1NV6hRK5867pOLFv5Z6pUfJpFb G2z0CndYvxmXiEPVw2LFkhSLZl0aZfoey40+DePMVDlz7+n8XvSsKjXcpDPanJ91EOHH hhmw== 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=yFrjkiOU5pxAQQlsyvdZo0R6jMGPbYIN6uQfpFC4H2s=; b=j5u7YZJs9bLYsvN+tofGySrKvU6m7YjqyTjk5sZYIMkSQxCXyGPQ8GgoY02oVaQiEC tLF59Ys+hicesw+DbvQ0Wcxu7uZiw15MSaLsEAzhY+RaKzjMN1kMA7pXbKHTeZ7/0uz4 A4vr3CNbbORhlR9Zi4j6glKii7uBZNc34LKUKb5WUg2eiMxSM5KaTSXpQg50Q8+gfngr 44p92sYCOcw+4IOm59uEdEhqJS3twCji9feZSXkiEZzee97q88Fh7efdO+o5l5aKWJ65 PjKbNNjWyWpdA/vGx/4/+9RkvnHf4Ld/bGA4UeA6R7nbtSNMmGp6cTmiSMHW2xpvh4S1 0e/w== 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 pw24si10638148ejb.518.2020.06.22.19.07.54; Mon, 22 Jun 2020 19:08:16 -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 S1730650AbgFWB4P (ORCPT + 99 others); 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