linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lina Iyer <ilina@codeaurora.org>,
	rjw@rjwysocki.net, ulf.hansson@linaro.org,
	linux-pm@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-arm-msm@vger.kernel.org,
	Lina Iyer <ilina@codeaurora.org>
Subject: Re: [PATCH 2/2] PM / Domains: use device's next wakeup to determine domain idle state
Date: Tue, 13 Oct 2020 21:46:15 +0800	[thread overview]
Message-ID: <202010132112.DIdqq8se-lkp@intel.com> (raw)
In-Reply-To: <20201012223400.23609-3-ilina@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 3865 bytes --]

Hi Lina,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pm/linux-next]
[also build test WARNING on linus/master v5.9 next-20201013]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Lina-Iyer/Better-domain-idle-from-device-wakeup-patterns/20201013-063543
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-m021-20201013 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

smatch warnings:
drivers/base/power/domain_governor.c:269 default_power_down_ok() warn: always true condition '(state_idx >= 0) => (0-u32max >= 0)'
drivers/base/power/domain_governor.c:269 default_power_down_ok() warn: always true condition '(state_idx >= 0) => (0-u32max >= 0)'
drivers/base/power/domain_governor.c:277 default_power_down_ok() warn: unsigned 'state_idx' is never less than zero.

vim +269 drivers/base/power/domain_governor.c

   245	
   246	/**
   247	 * default_power_down_ok - Default generic PM domain power off governor routine.
   248	 * @pd: PM domain to check.
   249	 *
   250	 * This routine must be executed under the PM domain's lock.
   251	 */
   252	static bool default_power_down_ok(struct dev_pm_domain *pd)
   253	{
   254		struct generic_pm_domain *genpd = pd_to_genpd(pd);
   255		struct gpd_link *link;
   256		unsigned int state_idx;
   257		ktime_t now = ktime_get();
   258	
   259		/*
   260		 * Find the next wakeup from devices that can determine their own wakeup
   261		 * to find when the domain would wakeup and do it for every device down
   262		 * the hierarchy. It is not worth while to sleep if the state's residency
   263		 * cannot be met.
   264		 */
   265		update_domain_next_wakeup(genpd, now);
   266		state_idx = genpd->state_count - 1;
   267		if (genpd->next_wakeup != KTIME_MAX) {
   268			/* Let's find out the deepest domain idle state, the devices prefer */
 > 269			while (state_idx >= 0) {
   270				if (next_wakeup_allows_state(genpd, state_idx, now)) {
   271					genpd->max_off_time_changed = true;
   272					break;
   273				}
   274				state_idx--;
   275			}
   276	
 > 277			if (state_idx < 0) {
   278				state_idx = 0;
   279				genpd->cached_power_down_ok = false;
   280				goto done;
   281			}
   282		}
   283	
   284		if (!genpd->max_off_time_changed) {
   285			genpd->state_idx = genpd->cached_power_down_state_idx;
   286			return genpd->cached_power_down_ok;
   287		}
   288	
   289		/*
   290		 * We have to invalidate the cached results for the parents, so
   291		 * use the observation that default_power_down_ok() is not
   292		 * going to be called for any parent until this instance
   293		 * returns.
   294		 */
   295		list_for_each_entry(link, &genpd->child_links, child_node)
   296			link->parent->max_off_time_changed = true;
   297	
   298		genpd->max_off_time_ns = -1;
   299		genpd->max_off_time_changed = false;
   300		genpd->cached_power_down_ok = true;
   301	
   302		/* Find a state to power down to, starting from the state
   303		 * determined by the next wakeup.
   304		 */
   305		while (!__default_power_down_ok(pd, state_idx)) {
   306			if (state_idx == 0) {
   307				genpd->cached_power_down_ok = false;
   308				break;
   309			}
   310			state_idx--;
   311		}
   312	
   313	done:
   314		genpd->state_idx = state_idx;
   315		genpd->cached_power_down_state_idx = genpd->state_idx;
   316		return genpd->cached_power_down_ok;
   317	}
   318	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40850 bytes --]

      reply	other threads:[~2020-10-13 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 22:33 [PATCH 0/2] Better domain idle from device wakeup patterns Lina Iyer
2020-10-12 22:33 ` [PATCH 1/2] PM / runtime: register device's next wakeup Lina Iyer
2020-10-14 10:28   ` Ulf Hansson
2020-10-14 16:31     ` Lina Iyer
2020-10-15 10:19       ` Ulf Hansson
2020-10-12 22:34 ` [PATCH 2/2] PM / Domains: use device's next wakeup to determine domain idle state Lina Iyer
2020-10-13 13:46   ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202010132112.DIdqq8se-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ilina@codeaurora.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).