From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Pei Xiao <xiaopei01@kylinos.cn>,
shenyang39@huawei.com, broonie@kernel.org,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Pei Xiao <xiaopei01@kylinos.cn>
Subject: Re: [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo
Date: Thu, 19 Mar 2026 18:50:59 +0300 [thread overview]
Message-ID: <202603192159.S0PIjhlg-lkp@intel.com> (raw)
In-Reply-To: <d50f1f46b2ee2bba05de9e2d4199353b545194e3.1773820898.git.xiaopei01@kylinos.cn>
Hi Pei,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pei-Xiao/spi-hisi-kunpeng-prevent-infinite-while-loop-in-hisi_spi_flush_fifo/20260318-211321
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link: https://lore.kernel.org/r/d50f1f46b2ee2bba05de9e2d4199353b545194e3.1773820898.git.xiaopei01%40kylinos.cn
patch subject: [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo
config: s390-randconfig-r072-20260319 (https://download.01.org/0day-ci/archive/20260319/202603192159.S0PIjhlg-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
smatch: v0.5.0-9004-gb810ac53
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/202603192159.S0PIjhlg-lkp@intel.com/
smatch warnings:
drivers/spi/spi-hisi-kunpeng.c:206 hisi_spi_flush_fifo() warn: should this be 'inner_limit == -1'
vim +206 drivers/spi/spi-hisi-kunpeng.c
c770d8631e1810 Jay Fang 2021-03-27 193
c770d8631e1810 Jay Fang 2021-03-27 194 static void hisi_spi_flush_fifo(struct hisi_spi *hs)
c770d8631e1810 Jay Fang 2021-03-27 195 {
c770d8631e1810 Jay Fang 2021-03-27 196 unsigned long limit = loops_per_jiffy << 1;
c770d8631e1810 Jay Fang 2021-03-27 197
c770d8631e1810 Jay Fang 2021-03-27 198 do {
e8821f559fed86 Pei Xiao 2026-03-18 199 unsigned long inner_limit = loops_per_jiffy;
e8821f559fed86 Pei Xiao 2026-03-18 200
e8821f559fed86 Pei Xiao 2026-03-18 201 while (hisi_spi_rx_not_empty(hs) && inner_limit--) {
c770d8631e1810 Jay Fang 2021-03-27 202 readl(hs->regs + HISI_SPI_DOUT);
e8821f559fed86 Pei Xiao 2026-03-18 203 cpu_relax();
e8821f559fed86 Pei Xiao 2026-03-18 204 }
e8821f559fed86 Pei Xiao 2026-03-18 205
e8821f559fed86 Pei Xiao 2026-03-18 @206 if (!inner_limit) {
This test is wrong. Maybe change inner_limit-- to
--inner_limit.
e8821f559fed86 Pei Xiao 2026-03-18 207 dev_warn_ratelimited(hs->dev, "RX FIFO flush timeout\n");
e8821f559fed86 Pei Xiao 2026-03-18 208 break;
e8821f559fed86 Pei Xiao 2026-03-18 209 }
e8821f559fed86 Pei Xiao 2026-03-18 210
c770d8631e1810 Jay Fang 2021-03-27 211 } while (hisi_spi_busy(hs) && limit--);
e8821f559fed86 Pei Xiao 2026-03-18 212
e8821f559fed86 Pei Xiao 2026-03-18 213 if (!limit)
e8821f559fed86 Pei Xiao 2026-03-18 214 dev_warn_ratelimited(hs->dev, "SPI busy timeout\n");
c770d8631e1810 Jay Fang 2021-03-27 215 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-03-19 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 8:02 [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo Pei Xiao
2026-03-18 13:17 ` Mark Brown
2026-03-19 1:18 ` Pei Xiao
2026-03-19 15:50 ` Dan Carpenter [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=202603192159.S0PIjhlg-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=shenyang39@huawei.com \
--cc=xiaopei01@kylinos.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