From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Binbin Zhou <zhoubinbin@loongson.cn>,
Binbin Zhou <zhoubb.aaron@gmail.com>,
Huacai Chen <chenhuacai@loongson.cn>, Lee Jones <lee@kernel.org>,
Corey Minyard <minyard@acm.org>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Xuerui Wang <kernel@xen0n.name>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
openipmi-developer@lists.sourceforge.net, jeffbai@aosc.io,
kexybiscuit@aosc.io, wangyao@lemote.com,
Chong Qiao <qiaochong@loongson.cn>
Subject: Re: [PATCH v9 2/3] mfd: ls2kbmc: Add Loongson-2K BMC reset function support
Date: Tue, 19 Aug 2025 12:53:30 +0300 [thread overview]
Message-ID: <202508191519.uT5io1jk-lkp@intel.com> (raw)
In-Reply-To: <1809103a948545df93b7b439df46ca6393995aa1.1754999365.git.zhoubinbin@loongson.cn>
Hi Binbin,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Binbin-Zhou/mfd-ls2kbmc-Introduce-Loongson-2K-BMC-core-driver/20250812-200258
base: 006aa8f57f55dd5bf68c4ada1e0d3f4e59027d71
patch link: https://lore.kernel.org/r/1809103a948545df93b7b439df46ca6393995aa1.1754999365.git.zhoubinbin%40loongson.cn
patch subject: [PATCH v9 2/3] mfd: ls2kbmc: Add Loongson-2K BMC reset function support
config: loongarch-randconfig-r073-20250818 (https://download.01.org/0day-ci/archive/20250819/202508191519.uT5io1jk-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 15.1.0
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202508191519.uT5io1jk-lkp@intel.com/
smatch warnings:
drivers/mfd/ls2k-bmc-core.c:389 ls2k_bmc_pdata_initial() warn: passing zero to 'PTR_ERR'
vim +/PTR_ERR +389 drivers/mfd/ls2k-bmc-core.c
71ff6b050ad788 Binbin Zhou 2025-08-12 360 static int ls2k_bmc_pdata_initial(struct ls2k_bmc_pdata *ddata)
71ff6b050ad788 Binbin Zhou 2025-08-12 361 {
71ff6b050ad788 Binbin Zhou 2025-08-12 362 struct pci_dev *pdev = to_pci_dev(ddata->dev);
71ff6b050ad788 Binbin Zhou 2025-08-12 363 int gsi = 16 + (LS2K_BMC_RESET_GPIO & 7);
71ff6b050ad788 Binbin Zhou 2025-08-12 364 void __iomem *gpio_base;
71ff6b050ad788 Binbin Zhou 2025-08-12 365 int irq, ret, val;
71ff6b050ad788 Binbin Zhou 2025-08-12 366
71ff6b050ad788 Binbin Zhou 2025-08-12 367 ls2k_bmc_save_pci_data(pdev, ddata);
71ff6b050ad788 Binbin Zhou 2025-08-12 368
71ff6b050ad788 Binbin Zhou 2025-08-12 369 INIT_WORK(&ddata->bmc_reset_work, ls2k_bmc_events_fn);
71ff6b050ad788 Binbin Zhou 2025-08-12 370
71ff6b050ad788 Binbin Zhou 2025-08-12 371 ret = devm_request_irq(&pdev->dev, pdev->irq, ls2k_bmc_interrupt,
71ff6b050ad788 Binbin Zhou 2025-08-12 372 IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc pcie", ddata);
71ff6b050ad788 Binbin Zhou 2025-08-12 373 if (ret) {
71ff6b050ad788 Binbin Zhou 2025-08-12 374 dev_err(ddata->dev, "Failed to request LS2KBMC PCI-E IRQ %d.\n", pdev->irq);
71ff6b050ad788 Binbin Zhou 2025-08-12 375 return ret;
71ff6b050ad788 Binbin Zhou 2025-08-12 376 }
71ff6b050ad788 Binbin Zhou 2025-08-12 377
71ff6b050ad788 Binbin Zhou 2025-08-12 378 /*
71ff6b050ad788 Binbin Zhou 2025-08-12 379 * Since gpio_chip->to_irq is not implemented in the Loongson-3 GPIO driver,
71ff6b050ad788 Binbin Zhou 2025-08-12 380 * acpi_register_gsi() is used to obtain the GPIO IRQ. The GPIO interrupt is a
71ff6b050ad788 Binbin Zhou 2025-08-12 381 * watchdog interrupt that is triggered when the BMC resets.
71ff6b050ad788 Binbin Zhou 2025-08-12 382 */
71ff6b050ad788 Binbin Zhou 2025-08-12 383 irq = acpi_register_gsi(NULL, gsi, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW);
71ff6b050ad788 Binbin Zhou 2025-08-12 384 if (irq < 0)
71ff6b050ad788 Binbin Zhou 2025-08-12 385 return irq;
71ff6b050ad788 Binbin Zhou 2025-08-12 386
71ff6b050ad788 Binbin Zhou 2025-08-12 387 gpio_base = ioremap(LOONGSON_GPIO_REG_BASE, LOONGSON_GPIO_REG_SIZE);
71ff6b050ad788 Binbin Zhou 2025-08-12 388 if (!gpio_base) {
71ff6b050ad788 Binbin Zhou 2025-08-12 @389 ret = PTR_ERR(gpio_base);
This PTR_ERR(NULL) is success. It should be "ret = -ENOMEM;"
71ff6b050ad788 Binbin Zhou 2025-08-12 390 goto acpi_failed;
71ff6b050ad788 Binbin Zhou 2025-08-12 391 }
71ff6b050ad788 Binbin Zhou 2025-08-12 392
71ff6b050ad788 Binbin Zhou 2025-08-12 393 /* Disable GPIO output */
71ff6b050ad788 Binbin Zhou 2025-08-12 394 val = readl(gpio_base + LOONGSON_GPIO_OEN);
71ff6b050ad788 Binbin Zhou 2025-08-12 395 writel(val | BIT(LS2K_BMC_RESET_GPIO), gpio_base + LOONGSON_GPIO_OEN);
71ff6b050ad788 Binbin Zhou 2025-08-12 396
71ff6b050ad788 Binbin Zhou 2025-08-12 397 /* Enable GPIO functionality */
71ff6b050ad788 Binbin Zhou 2025-08-12 398 val = readl(gpio_base + LOONGSON_GPIO_FUNC);
71ff6b050ad788 Binbin Zhou 2025-08-12 399 writel(val & ~BIT(LS2K_BMC_RESET_GPIO), gpio_base + LOONGSON_GPIO_FUNC);
71ff6b050ad788 Binbin Zhou 2025-08-12 400
71ff6b050ad788 Binbin Zhou 2025-08-12 401 /* Set GPIO interrupts to low-level active */
71ff6b050ad788 Binbin Zhou 2025-08-12 402 val = readl(gpio_base + LOONGSON_GPIO_INTPOL);
71ff6b050ad788 Binbin Zhou 2025-08-12 403 writel(val & ~BIT(LS2K_BMC_RESET_GPIO), gpio_base + LOONGSON_GPIO_INTPOL);
71ff6b050ad788 Binbin Zhou 2025-08-12 404
71ff6b050ad788 Binbin Zhou 2025-08-12 405 /* Enable GPIO interrupts */
71ff6b050ad788 Binbin Zhou 2025-08-12 406 val = readl(gpio_base + LOONGSON_GPIO_INTEN);
71ff6b050ad788 Binbin Zhou 2025-08-12 407 writel(val | BIT(LS2K_BMC_RESET_GPIO), gpio_base + LOONGSON_GPIO_INTEN);
71ff6b050ad788 Binbin Zhou 2025-08-12 408
71ff6b050ad788 Binbin Zhou 2025-08-12 409 ret = devm_request_irq(ddata->dev, irq, ls2k_bmc_interrupt,
71ff6b050ad788 Binbin Zhou 2025-08-12 410 IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc gpio", ddata);
71ff6b050ad788 Binbin Zhou 2025-08-12 411 if (ret)
71ff6b050ad788 Binbin Zhou 2025-08-12 412 dev_err(ddata->dev, "Failed to request LS2KBMC GPIO IRQ %d.\n", irq);
71ff6b050ad788 Binbin Zhou 2025-08-12 413
71ff6b050ad788 Binbin Zhou 2025-08-12 414 iounmap(gpio_base);
71ff6b050ad788 Binbin Zhou 2025-08-12 415
71ff6b050ad788 Binbin Zhou 2025-08-12 416 acpi_failed:
71ff6b050ad788 Binbin Zhou 2025-08-12 417 acpi_unregister_gsi(gsi);
71ff6b050ad788 Binbin Zhou 2025-08-12 418 return ret;
71ff6b050ad788 Binbin Zhou 2025-08-12 419 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-08-19 9:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 11:59 [PATCH v9 0/3] LoongArch: Add Loongson-2K BMC support Binbin Zhou
2025-08-12 11:59 ` [PATCH v9 1/3] mfd: ls2kbmc: Introduce Loongson-2K BMC core driver Binbin Zhou
2025-08-12 11:59 ` [PATCH v9 2/3] mfd: ls2kbmc: Add Loongson-2K BMC reset function support Binbin Zhou
2025-08-19 9:53 ` Dan Carpenter [this message]
2025-08-12 11:59 ` [PATCH v9 3/3] ipmi: Add Loongson-2K BMC support Binbin Zhou
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=202508191519.uT5io1jk-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=chenhuacai@loongson.cn \
--cc=jeffbai@aosc.io \
--cc=kernel@xen0n.name \
--cc=kexybiscuit@aosc.io \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=loongarch@lists.linux.dev \
--cc=minyard@acm.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=qiaochong@loongson.cn \
--cc=wangyao@lemote.com \
--cc=zhoubb.aaron@gmail.com \
--cc=zhoubinbin@loongson.cn \
/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
all inboxes | Powered by JetHome®