From: Pei Xiao <xiaopei01@kylinos.cn>
To: Mark Brown <broonie@kernel.org>
Cc: shenyang39@huawei.com, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo
Date: Thu, 19 Mar 2026 09:18:13 +0800 [thread overview]
Message-ID: <aab5d40b-bc5b-4fab-b687-b7e2a8dd703b@kylinos.cn> (raw)
In-Reply-To: <ac696e0b-530f-48f3-88bf-334f2dbf43b2@sirena.org.uk>
在 2026/3/18 21:17, Mark Brown 写道:
> On Wed, Mar 18, 2026 at 04:02:43PM +0800, Pei Xiao wrote:
>
>> Also add a ratelimited warning when the outer limit expires, to aid in
>> debugging hardware stalls.
> That's a bit of a separate change, should really have been a separate
> patch...
ok.
>> } while (hisi_spi_busy(hs) && limit--);
>> +
>> + if (!limit)
>> + dev_warn_ratelimited(hs->dev, "SPI busy timeout\n");
>> }
> The limit check is a postdecrement so we read the value, compare it to
> 0, subtract 1 and then break out of the loop - that means that when we
> come out of the loop the value of limit is non-zero again and the
> warning won't trigger.
yes, my fault! I will use '--limit'.
Thanks for your review and response!
Pei.
next prev parent reply other threads:[~2026-03-19 1:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 8:02 Pei Xiao
2026-03-18 13:17 ` Mark Brown
2026-03-19 1:18 ` Pei Xiao [this message]
2026-03-19 15:50 ` Dan Carpenter
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=aab5d40b-bc5b-4fab-b687-b7e2a8dd703b@kylinos.cn \
--to=xiaopei01@kylinos.cn \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=shenyang39@huawei.com \
/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®