Skip to content
Unverified Commit 88e70569 authored by Ivan Bornyakov's avatar Ivan Bornyakov Committed by Xu Yilun
Browse files

fpga: microchip-spi: rewrite status polling in a time measurable way



Original busy loop with retries count in mpf_poll_status() is not too
reliable, as it takes different times on different systems. Replace it
with read_poll_timeout() macro.

While at it, fix polling stop condition to met function's original
intention declared in the comment. The issue with original polling stop
condition is that it stops if any of mask bits is set, while intention
was to stop if all mask bits is set. This was not noticible because only
MPF_STATUS_READY is passed as mask argument and it is BIT(1).

Fixes: 5f8d4a90 ("fpga: microchip-spi: add Microchip MPF FPGA manager")
Signed-off-by: default avatarIvan Bornyakov <i.bornyakov@metrotek.ru>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
Acked-by: default avatarXu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20221230092922.18822-3-i.bornyakov@metrotek.ru


Signed-off-by: default avatarXu Yilun <yilun.xu@intel.com>
parent 1da53d23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment