Message ID | 20220622161617.3719096-3-clg@kaod.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | spi: aspeed: Fix division by zero | expand |
On Wed, Jun 22, 2022 at 06:16:17PM +0200, Cédric Le Goater wrote:
> Fixes: 54613fc6659b ("spi: aspeed: Add support for direct mapping")
This commit isn't in mainline.
On 6/29/22 19:09, Mark Brown wrote: > On Wed, Jun 22, 2022 at 06:16:17PM +0200, Cédric Le Goater wrote: > >> Fixes: 54613fc6659b ("spi: aspeed: Add support for direct mapping") > > This commit isn't in mainline. drat. It's the OpenBMC kernel. I will resend. Sorry about that. C.
On Wed, Jun 29, 2022 at 07:21:08PM +0200, Cédric Le Goater wrote: > On 6/29/22 19:09, Mark Brown wrote: > > On Wed, Jun 22, 2022 at 06:16:17PM +0200, Cédric Le Goater wrote: > > > > > Fixes: 54613fc6659b ("spi: aspeed: Add support for direct mapping") > > > > This commit isn't in mainline. > drat. It's the OpenBMC kernel. I will resend. Sorry about that. It's OK, I fixed it up locally.
On 6/29/22 19:27, Mark Brown wrote: > On Wed, Jun 29, 2022 at 07:21:08PM +0200, Cédric Le Goater wrote: >> On 6/29/22 19:09, Mark Brown wrote: >>> On Wed, Jun 22, 2022 at 06:16:17PM +0200, Cédric Le Goater wrote: >>> >>>> Fixes: 54613fc6659b ("spi: aspeed: Add support for direct mapping") >>> >>> This commit isn't in mainline. > >> drat. It's the OpenBMC kernel. I will resend. Sorry about that. > > It's OK, I fixed it up locally. Thanks, C.
diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index ac64be289e59..3e891bf22470 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -582,9 +582,11 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc) ctl_val = readl(chip->ctl) & ~CTRL_IO_CMD_MASK; ctl_val |= aspeed_spi_get_io_mode(op) | op->cmd.opcode << CTRL_COMMAND_SHIFT | - CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth) | CTRL_IO_MODE_READ; + if (op->dummy.nbytes) + ctl_val |= CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth); + /* Tune 4BYTE address mode */ if (op->addr.nbytes) { u32 addr_mode = readl(aspi->regs + CE_CTRL_REG);