]> git.baikalelectronics.ru Git - kernel.git/commit
spi: aspeed: Fix division by zero
authorCédric Le Goater <clg@kaod.org>
Wed, 22 Jun 2022 16:16:17 +0000 (18:16 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 29 Jun 2022 17:10:12 +0000 (18:10 +0100)
commit2d1cf2c7513984679ce7a0e92b75f220db7ed56c
tree7c98f28246a0f2d610857804b0d9f84471707f77
parent66eb0e878e1400434c885a3a14ecef49c077d5e2
spi: aspeed: Fix division by zero

When using the normal read operation for data transfers, the dummy bus
width is zero. In that case, they are no dummy bytes to transfer and
setting the dummy field in the controller register becomes useless.

Issue was found on a custom "Bifrost" board based on the AST2500 SoC
and using a MX25L51245GMI-08G SPI Flash.

Reported-by: Ian Woloschin <ian.woloschin@akamai.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Tested-by: Ian Woloschin <iwolosch@akamai.com>
Fixes: 6f19857d28fcdbfa7 ("spi: aspeed: Add support for direct mapping")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Link: https://lore.kernel.org/r/20220622161617.3719096-3-clg@kaod.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-aspeed-smc.c