All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH RFC v3 7/9] power: supply: core: add locking around extension access
Date: Sun, 8 Sep 2024 03:44:15 +0800	[thread overview]
Message-ID: <202409080331.btTYCUQL-lkp@intel.com> (raw)
In-Reply-To: <20240904-power-supply-extensions-v3-7-62efeb93f8ec@weissschuh.net>

Hi Thomas,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on d8abb73f584772eaafa95a447c90f1c02dba0dec]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/power-supply-core-rename-psy_has_property-to-psy_desc_has_property/20240905-032916
base:   d8abb73f584772eaafa95a447c90f1c02dba0dec
patch link:    https://lore.kernel.org/r/20240904-power-supply-extensions-v3-7-62efeb93f8ec%40weissschuh.net
patch subject: [PATCH RFC v3 7/9] power: supply: core: add locking around extension access
config: i386-buildonly-randconfig-001-20240907 (https://download.01.org/0day-ci/archive/20240908/202409080331.btTYCUQL-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240908/202409080331.btTYCUQL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409080331.btTYCUQL-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/power/supply/power_supply_sysfs.c:502:3: error: cannot jump from this goto statement to its label
     502 |                 goto out;
         |                 ^
   drivers/power/supply/power_supply_sysfs.c:504:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
     504 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:75:1: note: expanded from here
      75 | __UNIQUE_ID_guard178
         | ^
   1 error generated.
--
>> drivers/power/supply/power_supply_core.c:1579:3: error: cannot jump from this goto statement to its label
    1579 |                 goto register_thermal_failed;
         |                 ^
   drivers/power/supply/power_supply_core.c:1581:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1581 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:79:1: note: expanded from here
      79 | __UNIQUE_ID_guard216
         | ^
   drivers/power/supply/power_supply_core.c:1575:3: error: cannot jump from this goto statement to its label
    1575 |                 goto wakeup_init_failed;
         |                 ^
   drivers/power/supply/power_supply_core.c:1581:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1581 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:79:1: note: expanded from here
      79 | __UNIQUE_ID_guard216
         | ^
   drivers/power/supply/power_supply_core.c:1571:3: error: cannot jump from this goto statement to its label
    1571 |                 goto device_add_failed;
         |                 ^
   drivers/power/supply/power_supply_core.c:1581:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1581 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:79:1: note: expanded from here
      79 | __UNIQUE_ID_guard216
         | ^
   drivers/power/supply/power_supply_core.c:1562:4: error: cannot jump from this goto statement to its label
    1562 |                         goto check_supplies_failed;
         |                         ^
   drivers/power/supply/power_supply_core.c:1581:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1581 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:79:1: note: expanded from here
      79 | __UNIQUE_ID_guard216
         | ^
   drivers/power/supply/power_supply_core.c:1551:3: error: cannot jump from this goto statement to its label
    1551 |                 goto check_supplies_failed;
         |                 ^
   drivers/power/supply/power_supply_core.c:1581:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1581 |         guard(rwsem_read)(&psy->extensions_sem);
         |         ^
   include/linux/cleanup.h:167:15: note: expanded from macro 'guard'
     167 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b


vim +502 drivers/power/supply/power_supply_sysfs.c

2ad3d74e3c69fb drivers/power/supply/power_supply_sysfs.c Mathew King         2020-05-04  473  
23680f0b7d7f67 drivers/power/supply/power_supply_sysfs.c Greg Kroah-Hartman  2022-11-23  474  int power_supply_uevent(const struct device *dev, struct kobj_uevent_env *env)
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  475  {
aeab24ab7f1d7d drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2024-09-04  476  	struct power_supply *psy = dev_get_drvdata(dev);
7eff2e7a8b65c2 drivers/power/power_supply_sysfs.c        Kay Sievers         2007-08-14  477  	int ret = 0, j;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  478  	char *prop_buf;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  479  
297d716f6260cc drivers/power/power_supply_sysfs.c        Krzysztof Kozlowski 2015-03-12  480  	if (!psy || !psy->desc) {
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  481  		dev_dbg(dev, "No power supply yet\n");
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  482  		return ret;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  483  	}
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  484  
297d716f6260cc drivers/power/power_supply_sysfs.c        Krzysztof Kozlowski 2015-03-12  485  	ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name);
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  486  	if (ret)
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  487  		return ret;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  488  
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  489  	/*
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  490  	 * Kernel generates KOBJ_REMOVE uevent in device removal path, after
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  491  	 * resources have been freed. Exit early to avoid use-after-free.
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  492  	 */
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  493  	if (psy->removing)
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  494  		return 0;
3dc0bab23dba53 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-09-19  495  
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  496  	prop_buf = (char *)get_zeroed_page(GFP_KERNEL);
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  497  	if (!prop_buf)
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  498  		return -ENOMEM;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  499  
2ad3d74e3c69fb drivers/power/supply/power_supply_sysfs.c Mathew King         2020-05-04  500  	ret = add_prop_uevent(dev, env, POWER_SUPPLY_PROP_TYPE, prop_buf);
2ad3d74e3c69fb drivers/power/supply/power_supply_sysfs.c Mathew King         2020-05-04  501  	if (ret)
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04 @502  		goto out;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  503  
b3fcf7aeab01f6 drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2024-09-04  504  	guard(rwsem_read)(&psy->extensions_sem);
b3fcf7aeab01f6 drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2024-09-04  505  
aeab24ab7f1d7d drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2024-09-04  506  	for (j = 0; j < POWER_SUPPLY_ATTR_CNT; j++) {
aeab24ab7f1d7d drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2024-09-04  507  		ret = add_prop_uevent(dev, env, j, prop_buf);
27a2195efa8d26 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-03-17  508  		if (ret)
27a2195efa8d26 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-03-17  509  			goto out;
27a2195efa8d26 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-03-17  510  	}
27a2195efa8d26 drivers/power/supply/power_supply_sysfs.c Sebastian Reichel   2023-03-17  511  
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  512  out:
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  513  	free_page((unsigned long)prop_buf);
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  514  
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  515  	return ret;
4a11b59d828366 drivers/power/power_supply_sysfs.c        Anton Vorontsov     2007-05-04  516  }
539b9c94ac8356 drivers/power/supply/power_supply_sysfs.c Thomas Weißschuh    2021-11-24  517  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-09-07 19:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 19:25 [PATCH RFC v3 0/9] power: supply: extension API Thomas Weißschuh
2024-09-04 19:25 ` [PATCH RFC v3 1/9] power: supply: core: rename psy_has_property() to psy_desc_has_property() Thomas Weißschuh
2024-09-04 19:56   ` Hans de Goede
2024-09-14  9:30   ` Sebastian Reichel
2024-09-04 19:25 ` [PATCH RFC v3 2/9] power: supply: core: register thermal zone for battery Thomas Weißschuh
2024-09-04 19:56   ` Hans de Goede
2024-09-14  9:29   ` Sebastian Reichel
2024-09-14  9:55     ` Thomas Weißschuh
2024-09-04 19:25 ` [PATCH RFC v3 3/9] power: supply: hwmon: register battery properties Thomas Weißschuh
2024-09-04 19:57   ` Hans de Goede
2024-09-14  9:35   ` Sebastian Reichel
2024-09-04 19:25 ` [PATCH RFC v3 4/9] power: supply: sysfs: " Thomas Weißschuh
2024-09-04 19:57   ` Hans de Goede
2024-09-14  9:43   ` Sebastian Reichel
2024-09-04 19:25 ` [PATCH RFC v3 5/9] power: supply: sysfs: rework uevent property loop Thomas Weißschuh
2024-09-04 19:58   ` Hans de Goede
2024-09-14  9:59   ` Sebastian Reichel
2024-09-04 19:25 ` [PATCH RFC v3 6/9] power: supply: core: implement extension API Thomas Weißschuh
2024-09-14 10:50   ` Sebastian Reichel
2024-09-14 14:25     ` Thomas Weißschuh
2024-09-16 10:58       ` Sebastian Reichel
2024-09-04 19:25 ` [PATCH RFC v3 7/9] power: supply: core: add locking around extension access Thomas Weißschuh
2024-09-07 19:44   ` kernel test robot [this message]
2024-09-04 19:25 ` [PATCH RFC v3 8/9] power: supply: test-power: implement a power supply extension Thomas Weißschuh
2024-09-04 19:25 ` [PATCH RFC v3 9/9] power: supply: cros_charge-control: use power_supply extensions Thomas Weißschuh

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=202409080331.btTYCUQL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux@weissschuh.net \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.