summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2021-07-26 12:01:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 13:20:56 +0200
commitf588d4b7be92c4367fc7b63764bf6105083d33e0 (patch)
tree5505f5c569237f379a57fd914f64d4716e63e5d9 /drivers/scsi
parentb58e3d59a5d8bf548c241cc55127f1efd5150a5b (diff)
spi: imx: mx51-ecspi: Fix low-speed CONFIGREG delay calculation
[ Upstream commit 53ca18acbe645656132fb5a329833db711067e54 ] The spi_imx->spi_bus_clk may be uninitialized and thus also zero in mx51_ecspi_prepare_message(), which would lead to division by zero in kernel. Since bitbang .setup_transfer callback which initializes the spi_imx->spi_bus_clk is called after bitbang prepare_message callback, iterate over all the transfers in spi_message, find the one with lowest bus frequency, and use that bus frequency for the delay calculation. Note that it is not possible to move this CONFIGREG delay back into the .setup_transfer callback, because that is invoked too late, after the GPIO chipselects were already configured. Fixes: 135cbd378eab ("spi: imx: mx51-ecspi: Reinstate low-speed CONFIGREG delay") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210726100102.5188-1-marex@denx.de Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/scsi')
0 files changed, 0 insertions, 0 deletions