CC: [email protected] CC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Marc Zyngier <[email protected]>
Hi Marc, I love your patch! Perhaps something to improve: [auto build test WARNING on linusw-pinctrl/devel] [also build test WARNING on v5.17-rc2 next-20220202] [cannot apply to tip/irq/core linusw-gpio/for-next] [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/Marc-Zyngier/genirq-Move-irqchip-runtime-PM-over-to-irq-domain/20220201-202124 base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel :::::: branch date: 2 days ago :::::: commit date: 2 days ago config: riscv-randconfig-c006-20220201 (https://download.01.org/0day-ci/archive/20220203/[email protected]/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6b1e844b69f15bb7dffaf9365cd2b355d2eb7579) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://github.com/0day-ci/linux/commit/1c989f3d9b5302895c7b31b2c2462d2096b39231 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Marc-Zyngier/genirq-Move-irqchip-runtime-PM-over-to-irq-domain/20220201-202124 git checkout 1c989f3d9b5302895c7b31b2c2462d2096b39231 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; ^~~~~~ include/linux/dcache.h:400:9: note: Calling '__d_entry_type' return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; ^~~~~~~~~~~~~~~~~~~~~~ include/linux/dcache.h:385:9: note: Access to field 'd_flags' results in a dereference of a null pointer (loaded from variable 'dentry') return dentry->d_flags & DCACHE_ENTRY_TYPE; ^~~~~~ Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. kernel/locking/locktorture.c:749:17: warning: Dereference of null pointer [clang-analyzer-core.NullDereference] if (data_race(statp[i].n_lock_fail)) ^ kernel/locking/locktorture.c:818:2: note: Assuming 'verbose' is 0 VERBOSE_TOROUT_STRING("lock_torture_stats task started"); ^ include/linux/torture.h:36:6: note: expanded from macro 'VERBOSE_TOROUT_STRING' if (verbose) { \ ^~~~~~~ kernel/locking/locktorture.c:818:2: note: Taking false branch VERBOSE_TOROUT_STRING("lock_torture_stats task started"); ^ include/linux/torture.h:36:2: note: expanded from macro 'VERBOSE_TOROUT_STRING' if (verbose) { \ ^ kernel/locking/locktorture.c:818:2: note: Loop condition is false. Exiting loop VERBOSE_TOROUT_STRING("lock_torture_stats task started"); ^ include/linux/torture.h:34:34: note: expanded from macro 'VERBOSE_TOROUT_STRING' #define VERBOSE_TOROUT_STRING(s) \ ^ kernel/locking/locktorture.c:821:3: note: Calling 'lock_torture_stats_print' lock_torture_stats_print(); ^~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:781:6: note: Assuming field 'readlock' is null if (cxt.cur_ops->readlock) ^~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:781:2: note: Taking false branch if (cxt.cur_ops->readlock) ^ kernel/locking/locktorture.c:784:8: note: Calling 'kmalloc' buf = kmalloc(size, GFP_KERNEL); ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:569:2: note: Taking false branch if (__builtin_constant_p(size)) { ^ include/linux/slab.h:586:9: note: Value assigned to 'cxt.lwsa' return __kmalloc(size, flags); ^~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:586:2: note: Returning pointer, which participates in a condition later return __kmalloc(size, flags); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:784:8: note: Returning from 'kmalloc' buf = kmalloc(size, GFP_KERNEL); ^~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:785:6: note: Assuming 'buf' is non-null if (!buf) { ^~~~ kernel/locking/locktorture.c:785:2: note: Taking false branch if (!buf) { ^ kernel/locking/locktorture.c:791:29: note: Passing value via 2nd parameter 'statp' __torture_print_stats(buf, cxt.lwsa, true); ^~~~~~~~ kernel/locking/locktorture.c:791:2: note: Calling '__torture_print_stats' __torture_print_stats(buf, cxt.lwsa, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/locking/locktorture.c:744:22: note: Assuming 'statp' is null long max = 0, min = statp ? data_race(statp[0].n_lock_acquired) : 0; ^~~~~ kernel/locking/locktorture.c:744:22: note: '?' condition is false kernel/locking/locktorture.c:747:13: note: 'write' is true n_stress = write ? cxt.nrealwriters_stress : cxt.nrealreaders_stress; ^~~~~ kernel/locking/locktorture.c:747:13: note: '?' condition is true kernel/locking/locktorture.c:748:14: note: Assuming 'i' is < 'n_stress' for (i = 0; i < n_stress; i++) { ^~~~~~~~~~~~ kernel/locking/locktorture.c:748:2: note: Loop condition is true. Entering loop body for (i = 0; i < n_stress; i++) { ^ kernel/locking/locktorture.c:749:17: note: Dereference of null pointer if (data_race(statp[i].n_lock_fail)) ^ include/linux/compiler.h:218:3: note: expanded from macro 'data_race' expr; \ ^~~~ kernel/locking/locktorture.c:758:2: warning: Value stored to 'page' is never read [clang-analyzer-deadcode.DeadStores] page += sprintf(page, ^ ~~~~~~~~~~~~~ kernel/locking/locktorture.c:758:2: note: Value stored to 'page' is never read page += sprintf(page, ^ ~~~~~~~~~~~~~ Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. >> drivers/gpio/gpio-tqmx86.c:318:27: warning: Access to field 'domain' results >> in a dereference of an undefined pointer value (loaded from variable 'girq') >> [clang-analyzer-core.NullDereference] irq_domain_set_pm_device(girq->domain, dev); ^~~~ drivers/gpio/gpio-tqmx86.c:234:2: note: 'girq' declared without an initial value struct gpio_irq_chip *girq; ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpio/gpio-tqmx86.c:240:6: note: Assuming 'irq' is >= 0 if (irq < 0 && irq != -ENXIO) ^~~~~~~ drivers/gpio/gpio-tqmx86.c:240:14: note: Left side of '&&' is false if (irq < 0 && irq != -ENXIO) ^ drivers/gpio/gpio-tqmx86.c:244:6: note: Assuming 'res' is non-null if (!res) { ^~~~ drivers/gpio/gpio-tqmx86.c:244:2: note: Taking false branch if (!res) { ^ drivers/gpio/gpio-tqmx86.c:250:6: note: Assuming 'io_base' is non-null if (!io_base) ^~~~~~~~ drivers/gpio/gpio-tqmx86.c:250:2: note: Taking false branch if (!io_base) ^ drivers/gpio/gpio-tqmx86.c:254:6: note: Assuming 'gpio' is non-null if (!gpio) ^~~~~ drivers/gpio/gpio-tqmx86.c:254:2: note: Taking false branch if (!gpio) ^ drivers/gpio/gpio-tqmx86.c:257:2: note: Loop condition is false. Exiting loop raw_spin_lock_init(&gpio->spinlock); ^ include/linux/spinlock.h:102:39: note: expanded from macro 'raw_spin_lock_init' # define raw_spin_lock_init(lock) \ ^ drivers/gpio/gpio-tqmx86.c:279:6: note: Assuming 'irq' is <= 0 if (irq > 0) { ^~~~~~~ drivers/gpio/gpio-tqmx86.c:279:2: note: Taking false branch if (irq > 0) { ^ drivers/gpio/gpio-tqmx86.c:313:6: note: Assuming 'ret' is 0 if (ret) { ^~~ drivers/gpio/gpio-tqmx86.c:313:2: note: Taking false branch if (ret) { ^ drivers/gpio/gpio-tqmx86.c:318:27: note: Access to field 'domain' results in a dereference of an undefined pointer value (loaded from variable 'girq') irq_domain_set_pm_device(girq->domain, dev); ^~~~ Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. fs/ext4/fast_commit.c:1623:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = ext4_fc_record_modified_inode(sb, inode->i_ino); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ext4/fast_commit.c:1623:2: note: Value stored to 'ret' is never read ret = ext4_fc_record_modified_inode(sb, inode->i_ino); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ext4/fast_commit.c:1748:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = ext4_fc_record_modified_inode(sb, inode->i_ino); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ext4/fast_commit.c:1748:2: note: Value stored to 'ret' is never read ret = ext4_fc_record_modified_inode(sb, inode->i_ino); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. vim +318 drivers/gpio/gpio-tqmx86.c 5fbe5b5883f8473 Linus Walleij 2019-09-04 228 b868db94a6a7047 Andrew Lunn 2019-01-25 229 static int tqmx86_gpio_probe(struct platform_device *pdev) b868db94a6a7047 Andrew Lunn 2019-01-25 230 { b868db94a6a7047 Andrew Lunn 2019-01-25 231 struct device *dev = &pdev->dev; b868db94a6a7047 Andrew Lunn 2019-01-25 232 struct tqmx86_gpio_data *gpio; b868db94a6a7047 Andrew Lunn 2019-01-25 233 struct gpio_chip *chip; 74639d66e1ec069 Linus Walleij 2019-08-09 234 struct gpio_irq_chip *girq; b868db94a6a7047 Andrew Lunn 2019-01-25 235 void __iomem *io_base; b868db94a6a7047 Andrew Lunn 2019-01-25 236 struct resource *res; b868db94a6a7047 Andrew Lunn 2019-01-25 237 int ret, irq; b868db94a6a7047 Andrew Lunn 2019-01-25 238 9b87f43537acfa2 Matthias Schiffer 2021-07-16 239 irq = platform_get_irq_optional(pdev, 0); 9b87f43537acfa2 Matthias Schiffer 2021-07-16 240 if (irq < 0 && irq != -ENXIO) b868db94a6a7047 Andrew Lunn 2019-01-25 241 return irq; b868db94a6a7047 Andrew Lunn 2019-01-25 242 b868db94a6a7047 Andrew Lunn 2019-01-25 243 res = platform_get_resource(pdev, IORESOURCE_IO, 0); b868db94a6a7047 Andrew Lunn 2019-01-25 244 if (!res) { b868db94a6a7047 Andrew Lunn 2019-01-25 245 dev_err(&pdev->dev, "Cannot get I/O\n"); b868db94a6a7047 Andrew Lunn 2019-01-25 246 return -ENODEV; b868db94a6a7047 Andrew Lunn 2019-01-25 247 } b868db94a6a7047 Andrew Lunn 2019-01-25 248 b868db94a6a7047 Andrew Lunn 2019-01-25 249 io_base = devm_ioport_map(&pdev->dev, res->start, resource_size(res)); b868db94a6a7047 Andrew Lunn 2019-01-25 250 if (!io_base) b868db94a6a7047 Andrew Lunn 2019-01-25 251 return -ENOMEM; b868db94a6a7047 Andrew Lunn 2019-01-25 252 b868db94a6a7047 Andrew Lunn 2019-01-25 253 gpio = devm_kzalloc(dev, sizeof(*gpio), GFP_KERNEL); b868db94a6a7047 Andrew Lunn 2019-01-25 254 if (!gpio) b868db94a6a7047 Andrew Lunn 2019-01-25 255 return -ENOMEM; b868db94a6a7047 Andrew Lunn 2019-01-25 256 b868db94a6a7047 Andrew Lunn 2019-01-25 257 raw_spin_lock_init(&gpio->spinlock); b868db94a6a7047 Andrew Lunn 2019-01-25 258 gpio->io_base = io_base; b868db94a6a7047 Andrew Lunn 2019-01-25 259 b868db94a6a7047 Andrew Lunn 2019-01-25 260 tqmx86_gpio_write(gpio, (u8)~TQMX86_DIR_INPUT_MASK, TQMX86_GPIODD); b868db94a6a7047 Andrew Lunn 2019-01-25 261 b868db94a6a7047 Andrew Lunn 2019-01-25 262 platform_set_drvdata(pdev, gpio); b868db94a6a7047 Andrew Lunn 2019-01-25 263 b868db94a6a7047 Andrew Lunn 2019-01-25 264 chip = &gpio->chip; b868db94a6a7047 Andrew Lunn 2019-01-25 265 chip->label = "gpio-tqmx86"; b868db94a6a7047 Andrew Lunn 2019-01-25 266 chip->owner = THIS_MODULE; b868db94a6a7047 Andrew Lunn 2019-01-25 267 chip->can_sleep = false; b868db94a6a7047 Andrew Lunn 2019-01-25 268 chip->base = -1; b868db94a6a7047 Andrew Lunn 2019-01-25 269 chip->direction_input = tqmx86_gpio_direction_input; b868db94a6a7047 Andrew Lunn 2019-01-25 270 chip->direction_output = tqmx86_gpio_direction_output; b868db94a6a7047 Andrew Lunn 2019-01-25 271 chip->get_direction = tqmx86_gpio_get_direction; b868db94a6a7047 Andrew Lunn 2019-01-25 272 chip->get = tqmx86_gpio_get; b868db94a6a7047 Andrew Lunn 2019-01-25 273 chip->set = tqmx86_gpio_set; b868db94a6a7047 Andrew Lunn 2019-01-25 274 chip->ngpio = TQMX86_NGPIO; b868db94a6a7047 Andrew Lunn 2019-01-25 275 chip->parent = pdev->dev.parent; b868db94a6a7047 Andrew Lunn 2019-01-25 276 b868db94a6a7047 Andrew Lunn 2019-01-25 277 pm_runtime_enable(&pdev->dev); b868db94a6a7047 Andrew Lunn 2019-01-25 278 9b87f43537acfa2 Matthias Schiffer 2021-07-16 279 if (irq > 0) { b868db94a6a7047 Andrew Lunn 2019-01-25 280 struct irq_chip *irq_chip = &gpio->irq_chip; b868db94a6a7047 Andrew Lunn 2019-01-25 281 u8 irq_status; b868db94a6a7047 Andrew Lunn 2019-01-25 282 b868db94a6a7047 Andrew Lunn 2019-01-25 283 irq_chip->name = chip->label; b868db94a6a7047 Andrew Lunn 2019-01-25 284 irq_chip->irq_mask = tqmx86_gpio_irq_mask; b868db94a6a7047 Andrew Lunn 2019-01-25 285 irq_chip->irq_unmask = tqmx86_gpio_irq_unmask; b868db94a6a7047 Andrew Lunn 2019-01-25 286 irq_chip->irq_set_type = tqmx86_gpio_irq_set_type; b868db94a6a7047 Andrew Lunn 2019-01-25 287 b868db94a6a7047 Andrew Lunn 2019-01-25 288 /* Mask all interrupts */ b868db94a6a7047 Andrew Lunn 2019-01-25 289 tqmx86_gpio_write(gpio, 0, TQMX86_GPIIC); b868db94a6a7047 Andrew Lunn 2019-01-25 290 b868db94a6a7047 Andrew Lunn 2019-01-25 291 /* Clear all pending interrupts */ b868db94a6a7047 Andrew Lunn 2019-01-25 292 irq_status = tqmx86_gpio_read(gpio, TQMX86_GPIIS); b868db94a6a7047 Andrew Lunn 2019-01-25 293 tqmx86_gpio_write(gpio, irq_status, TQMX86_GPIIS); b868db94a6a7047 Andrew Lunn 2019-01-25 294 74639d66e1ec069 Linus Walleij 2019-08-09 295 girq = &chip->irq; 74639d66e1ec069 Linus Walleij 2019-08-09 296 girq->chip = irq_chip; 74639d66e1ec069 Linus Walleij 2019-08-09 297 girq->parent_handler = tqmx86_gpio_irq_handler; 74639d66e1ec069 Linus Walleij 2019-08-09 298 girq->num_parents = 1; 74639d66e1ec069 Linus Walleij 2019-08-09 299 girq->parents = devm_kcalloc(&pdev->dev, 1, 74639d66e1ec069 Linus Walleij 2019-08-09 300 sizeof(*girq->parents), 74639d66e1ec069 Linus Walleij 2019-08-09 301 GFP_KERNEL); 74639d66e1ec069 Linus Walleij 2019-08-09 302 if (!girq->parents) { 74639d66e1ec069 Linus Walleij 2019-08-09 303 ret = -ENOMEM; 96be65d12d792b3 Wei Yongjun 2019-02-01 304 goto out_pm_dis; b868db94a6a7047 Andrew Lunn 2019-01-25 305 } 74639d66e1ec069 Linus Walleij 2019-08-09 306 girq->parents[0] = irq; 74639d66e1ec069 Linus Walleij 2019-08-09 307 girq->default_type = IRQ_TYPE_NONE; 74639d66e1ec069 Linus Walleij 2019-08-09 308 girq->handler = handle_simple_irq; 5fbe5b5883f8473 Linus Walleij 2019-09-04 309 girq->init_valid_mask = tqmx86_init_irq_valid_mask; 74639d66e1ec069 Linus Walleij 2019-08-09 310 } b868db94a6a7047 Andrew Lunn 2019-01-25 311 74639d66e1ec069 Linus Walleij 2019-08-09 312 ret = devm_gpiochip_add_data(dev, chip, gpio); 74639d66e1ec069 Linus Walleij 2019-08-09 313 if (ret) { 74639d66e1ec069 Linus Walleij 2019-08-09 314 dev_err(dev, "Could not register GPIO chip\n"); 74639d66e1ec069 Linus Walleij 2019-08-09 315 goto out_pm_dis; b868db94a6a7047 Andrew Lunn 2019-01-25 316 } b868db94a6a7047 Andrew Lunn 2019-01-25 317 1c989f3d9b53028 Marc Zyngier 2022-02-01 @318 irq_domain_set_pm_device(girq->domain, dev); 1c989f3d9b53028 Marc Zyngier 2022-02-01 319 b868db94a6a7047 Andrew Lunn 2019-01-25 320 dev_info(dev, "GPIO functionality initialized with %d pins\n", b868db94a6a7047 Andrew Lunn 2019-01-25 321 chip->ngpio); b868db94a6a7047 Andrew Lunn 2019-01-25 322 b868db94a6a7047 Andrew Lunn 2019-01-25 323 return 0; b868db94a6a7047 Andrew Lunn 2019-01-25 324 b868db94a6a7047 Andrew Lunn 2019-01-25 325 out_pm_dis: b868db94a6a7047 Andrew Lunn 2019-01-25 326 pm_runtime_disable(&pdev->dev); b868db94a6a7047 Andrew Lunn 2019-01-25 327 b868db94a6a7047 Andrew Lunn 2019-01-25 328 return ret; b868db94a6a7047 Andrew Lunn 2019-01-25 329 } b868db94a6a7047 Andrew Lunn 2019-01-25 330 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
