The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: kbuild-all@lists.01.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	David Collins <quic_collinsd@quicinc.com>,
	Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>,
	Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
Subject: Re: [PATCH] power_supply: Register cooling device outside of probe
Date: Tue, 14 Dec 2021 00:12:33 +0800	[thread overview]
Message-ID: <202112132307.mubGFyNy-lkp@intel.com> (raw)
In-Reply-To: <1639393841-17444-1-git-send-email-quic_manafm@quicinc.com>

Hi Manaf,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on v5.16-rc5]
[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/Manaf-Meethalavalappu-Pallikunhi/power_supply-Register-cooling-device-outside-of-probe/20211213-191238
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: i386-randconfig-s001-20211213 (https://download.01.org/0day-ci/archive/20211213/202112132307.mubGFyNy-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/e5930a7ed9ae1b121e0dde177184ff74abbf0371
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Manaf-Meethalavalappu-Pallikunhi/power_supply-Register-cooling-device-outside-of-probe/20211213-191238
        git checkout e5930a7ed9ae1b121e0dde177184ff74abbf0371
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/power/supply/

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

All warnings (new ones prefixed by >>):

   drivers/power/supply/power_supply_core.c:1086:12: error: conflicting types for 'psy_register_cooler'
    1086 | static int psy_register_cooler(struct power_supply *psy)
         |            ^~~~~~~~~~~~~~~~~~~
   drivers/power/supply/power_supply_core.c:129:12: note: previous declaration of 'psy_register_cooler' was here
     129 | static int psy_register_cooler(struct device *dev, struct power_supply *psy);
         |            ^~~~~~~~~~~~~~~~~~~
>> drivers/power/supply/power_supply_core.c:129:12: warning: 'psy_register_cooler' used but never defined
   drivers/power/supply/power_supply_core.c:1086:12: warning: 'psy_register_cooler' defined but not used [-Wunused-function]
    1086 | static int psy_register_cooler(struct power_supply *psy)
         |            ^~~~~~~~~~~~~~~~~~~


vim +/psy_register_cooler +129 drivers/power/supply/power_supply_core.c

   128	
 > 129	static int psy_register_cooler(struct device *dev, struct power_supply *psy);
   130	/*
   131	 * Notify that power supply was registered after parent finished the probing.
   132	 *
   133	 * Often power supply is registered from driver's probe function. However
   134	 * calling power_supply_changed() directly from power_supply_register()
   135	 * would lead to execution of get_property() function provided by the driver
   136	 * too early - before the probe ends.
   137	 * Also, registering cooling device from the probe will execute the
   138	 * get_property() function. So register the cooling device after the probe.
   139	 *
   140	 * Avoid that by waiting on parent's mutex.
   141	 */
   142	static void power_supply_deferred_register_work(struct work_struct *work)
   143	{
   144		struct power_supply *psy = container_of(work, struct power_supply,
   145							deferred_register_work.work);
   146	
   147		if (psy->dev.parent) {
   148			while (!mutex_trylock(&psy->dev.parent->mutex)) {
   149				if (psy->removing)
   150					return;
   151				msleep(10);
   152			}
   153		}
   154	
   155		power_supply_changed(psy);
   156		psy_register_cooler(psy->dev.parent, psy);
   157	
   158		if (psy->dev.parent)
   159			mutex_unlock(&psy->dev.parent->mutex);
   160	}
   161	

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

  reply	other threads:[~2021-12-13 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 11:10 [PATCH] power_supply: Register cooling device outside of probe Manaf Meethalavalappu Pallikunhi
2021-12-13 16:12 ` kernel test robot [this message]
2021-12-13 16:53 ` kernel test robot

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=202112132307.mubGFyNy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_manafm@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    --cc=sre@kernel.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