[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <mafs0a56yrodq.fsf@kernel.org>
Date: Tue, 27 May 2025 18:48:17 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: "William A. Kennington III" <william@...nnington.com>
Cc: Tudor Ambarus <tudor.ambarus@...aro.org>, Pratyush Yadav
<pratyush@...nel.org>, Michael Walle <mwalle@...nel.org>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] mtd: spi-nor: Sleep between ready checks
Hi William,
On Thu, May 22 2025, William A. Kennington III wrote:
> We have SPI NOR devices that respond very slowly (200ms+) to some
> commands. This causes our CPU to stall while repeatedly polling the NOR
> with no cooldown in between attempts. In order to reduce overhead, this
> patch introduces an exponential backoff in SPI readiness polling, that
> self tunes the polling interval to match the speed of most transactions.
>
> Signed-off-by: William A. Kennington III <william@...nnington.com>
I didn't read the code too deeply, but it seems full of magic values and
I am honestly not a big fan of how it reads. At the very least the logic
should be less black-magic. But since I didn't spend too much time
understanding the code, I don't have specific feedback for you.
BTW, you say it causes CPU stalls. The loop has a cond_resched() after
every iteration which I think gives the scheduler a chance to run other
tasks. Does that not work for some reason?
[...]
--
Regards,
Pratyush Yadav
Powered by blists - more mailing lists