Re: [PATCH v2 04/15] spi: Replace open coded spi_controller_xfer_timeout()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v2 04/15] spi: Replace open coded spi_controller_xfer_timeout()
- From: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
- Date: Tue, 11 Jul 2023 15:29:23 +0200
- Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx>, Yang Yingliang <yangyingliang@xxxxxxxxxx>, Amit Kumar Mahapatra via Alsa-devel <alsa-devel@xxxxxxxxxxxxxxxx>, Neil Armstrong <neil.armstrong@xxxxxxxxxx>, Tharun Kumar P <tharunkumar.pasumarthi@xxxxxxxxxxxxx>, Vijaya Krishna Nivarthi <quic_vnivarth@xxxxxxxxxxx>, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>, linux-spi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-amlogic@xxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, linux-rockchip@xxxxxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, linux-trace-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, Sanjay R Mehta <sanju.mehta@xxxxxxx>, Radu Pirea <radu_nicolae.pirea@xxxxxx>, Nicolas Ferre <nicolas.ferre@xxxxxxxxxxxxx>, Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>, Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>, Tudor Ambarus <tudor.ambarus@xxxxxxxxxx>, Serge Semin <fancer.lancer@xxxxxxxxx>, Shawn Guo <shawnguo@xxxxxxxxxx>, Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>, Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>, Fabio Estevam <festevam@xxxxxxxxx>, NXP Linux Team <linux-imx@xxxxxxx>, Kevin Hilman <khilman@xxxxxxxxxxxx>, Jerome Brunet <jbrunet@xxxxxxxxxxxx>, Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>, Matthias Brugger <matthias.bgg@xxxxxxxxx>, Andy Gross <agross@xxxxxxxxxx>, Bjorn Andersson <andersson@xxxxxxxxxx>, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>, Heiko Stuebner <heiko@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Paul Walmsley <paul.walmsley@xxxxxxxxxx>, Orson Zhai <orsonzhai@xxxxxxxxx>, Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>, Chunyan Zhang <zhang.lyra@xxxxxxxxx>, Alain Volmat <alain.volmat@xxxxxxxxxxx>, Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>, Alexandre Torgue <alexandre.torgue@xxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Masami Hiramatsu <mhiramat@xxxxxxxxxx>, Richard Cochran <richardcochran@xxxxxxxxx>
- In-reply-to: <e3688ce5-616a-4399-a4e3-c410a09f6a45@sirena.org.uk>
- References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-5-andriy.shevchenko@linux.intel.com> <83c4b75a-06d7-9fca-ffa0-f2e6a6ae7aed@collabora.com> <e3688ce5-616a-4399-a4e3-c410a09f6a45@sirena.org.uk>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0
Il 11/07/23 15:05, Mark Brown ha scritto:
On Tue, Jul 11, 2023 at 10:28:13AM +0200, AngeloGioacchino Del Regno wrote:
Il 10/07/23 17:49, Andy Shevchenko ha scritto:
+ ms = spi_controller_xfer_timeout(ctlr, xfer);
I agree on using helpers, but the logic is slightly changing here: yes it is
unlikely (and also probably useless) to get ms == UINT_MAX, but the helper is
limiting the maximum timeout value to 500mS, which may not work for some slow
controllers/devices.
The helper is limiting the *minimum* timeout value to 500ms - it's using
max() not min(). The idea is the other way around, that for a very fast
transfer we don't want to end up with such a short timeout that it false
triggers due to scheduling issues.
After reading the code again, yeah, I've totally misread it the first time. Argh!
Thanks! :-)
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|