Message ID | b13e1147-c168-1163-436d-5c3fadf70191@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, 26 Apr 2018 14:40:41 +0530 Vignesh R <vigneshr@ti.com> wrote: > > +static int ti_qspi_exec_mem_op(struct spi_mem *mem, > > + const struct spi_mem_op *op) > > +{ > > + struct ti_qspi *qspi = spi_master_get_devdata(mem->spi->master); > > + u32 from = 0; > > + int ret = 0; > > + > > + /* Only optimize read path. */ > > + if (!op->data.nbytes || op->data.dir != SPI_MEM_DATA_IN || > > + !op->addr.nbytes || op->addr.nbytes > 4) > > + return -ENOTSUPP; > > + > > + /* Address exceeds MMIO window size, fall back to regular mode. */ > > + from = op->addr.val; > > + if (from + op->data.nbytes > qspi->mmap_size) > > + return -ENOTSUPP; > > + > > qspi->mmap_size turns out to be 0 if qspi->rx_chan is not NULL > (in other words when DMA is used) > Could you squash below diff into this patch? Will do. Thanks, Boris -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
=========== diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 694902dd6f70..c54b760e00ed 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -718,6 +718,7 @@ static int ti_qspi_probe(struct platform_device *pdev) "memory mapped resource not required\n"); } } + qspi->mmap_size = resource_size(res_mmap); irq = platform_get_irq(pdev, 0); if (irq < 0) { @@ -794,7 +795,6 @@ static int ti_qspi_probe(struct platform_device *pdev) no_dma: if (!qspi->rx_chan && res_mmap) { - qspi->mmap_size = resource_size(res_mmap); qspi->mmap_base = devm_ioremap_resource(&pdev->dev, res_mmap); if (IS_ERR(qspi->mmap_base)) { dev_info(&pdev->dev,