From 16482c28bcdb75f363878d85a1d51cafd904961d Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 22 Mar 2020 15:38:21 -0400 Subject: [PATCH] Drop spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch Signed-off-by: Sasha Levin --- queue-5.4/series | 1 - ...spi-handle-dma-size-restriction-on-a.patch | 103 ------------------ queue-5.5/series | 1 - ...spi-handle-dma-size-restriction-on-a.patch | 103 ------------------ 4 files changed, 208 deletions(-) delete mode 100644 queue-5.4/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch delete mode 100644 queue-5.5/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch diff --git a/queue-5.4/series b/queue-5.4/series index baf88ba6ecf..3de2447c6a6 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,6 +1,5 @@ locks-fix-a-potential-use-after-free-problem-when-wa.patch locks-reinstate-locks_delete_block-optimization.patch -spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch spi-spi-omap2-mcspi-support-probe-deferral-for-dma-c.patch drm-mediatek-find-the-cursor-plane-instead-of-hard-c.patch phy-ti-gmii-sel-fix-set-of-copy-paste-errors.patch diff --git a/queue-5.4/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch b/queue-5.4/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch deleted file mode 100644 index e9cd6b19704..00000000000 --- a/queue-5.4/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch +++ /dev/null @@ -1,103 +0,0 @@ -From dcafe026ee3cf57fe27a16f8426ac1eb21dc113e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 4 Feb 2020 18:18:15 +0530 -Subject: spi: spi-omap2-mcspi: Handle DMA size restriction on AM65x - -From: Vignesh Raghavendra - -[ Upstream commit e4e8276a4f652be2c7bb783a0155d4adb85f5d7d ] - -On AM654, McSPI can only support 4K - 1 bytes per transfer when DMA is -enabled. Therefore populate master->max_transfer_size callback to -inform client drivers of this restriction when DMA channels are -available. - -Signed-off-by: Vignesh Raghavendra -Link: https://lore.kernel.org/r/20200204124816.16735-2-vigneshr@ti.com -Signed-off-by: Mark Brown -Signed-off-by: Sasha Levin ---- - drivers/spi/spi-omap2-mcspi.c | 26 +++++++++++++++++++ - include/linux/platform_data/spi-omap2-mcspi.h | 1 + - 2 files changed, 27 insertions(+) - -diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c -index 848e03e5f42d5..8e435da730996 100644 ---- a/drivers/spi/spi-omap2-mcspi.c -+++ b/drivers/spi/spi-omap2-mcspi.c -@@ -130,6 +130,7 @@ struct omap2_mcspi { - int fifo_depth; - bool slave_aborted; - unsigned int pin_dir:1; -+ size_t max_xfer_len; - }; - - struct omap2_mcspi_cs { -@@ -1316,6 +1317,18 @@ static bool omap2_mcspi_can_dma(struct spi_master *master, - return (xfer->len >= DMA_MIN_BYTES); - } - -+static size_t omap2_mcspi_max_xfer_size(struct spi_device *spi) -+{ -+ struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); -+ struct omap2_mcspi_dma *mcspi_dma = -+ &mcspi->dma_channels[spi->chip_select]; -+ -+ if (mcspi->max_xfer_len && mcspi_dma->dma_rx) -+ return mcspi->max_xfer_len; -+ -+ return SIZE_MAX; -+} -+ - static int omap2_mcspi_controller_setup(struct omap2_mcspi *mcspi) - { - struct spi_master *master = mcspi->master; -@@ -1384,6 +1397,11 @@ static struct omap2_mcspi_platform_config omap4_pdata = { - .regs_offset = OMAP4_MCSPI_REG_OFFSET, - }; - -+static struct omap2_mcspi_platform_config am654_pdata = { -+ .regs_offset = OMAP4_MCSPI_REG_OFFSET, -+ .max_xfer_len = SZ_4K - 1, -+}; -+ - static const struct of_device_id omap_mcspi_of_match[] = { - { - .compatible = "ti,omap2-mcspi", -@@ -1393,6 +1411,10 @@ static const struct of_device_id omap_mcspi_of_match[] = { - .compatible = "ti,omap4-mcspi", - .data = &omap4_pdata, - }, -+ { -+ .compatible = "ti,am654-mcspi", -+ .data = &am654_pdata, -+ }, - { }, - }; - MODULE_DEVICE_TABLE(of, omap_mcspi_of_match); -@@ -1450,6 +1472,10 @@ static int omap2_mcspi_probe(struct platform_device *pdev) - mcspi->pin_dir = pdata->pin_dir; - } - regs_offset = pdata->regs_offset; -+ if (pdata->max_xfer_len) { -+ mcspi->max_xfer_len = pdata->max_xfer_len; -+ master->max_transfer_size = omap2_mcspi_max_xfer_size; -+ } - - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mcspi->base = devm_ioremap_resource(&pdev->dev, r); -diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h -index 0bf9fddb83064..3b400b1919a9b 100644 ---- a/include/linux/platform_data/spi-omap2-mcspi.h -+++ b/include/linux/platform_data/spi-omap2-mcspi.h -@@ -11,6 +11,7 @@ struct omap2_mcspi_platform_config { - unsigned short num_cs; - unsigned int regs_offset; - unsigned int pin_dir:1; -+ size_t max_xfer_len; - }; - - struct omap2_mcspi_device_config { --- -2.20.1 - diff --git a/queue-5.5/series b/queue-5.5/series index 320b7092077..e532e6dd0f3 100644 --- a/queue-5.5/series +++ b/queue-5.5/series @@ -1,6 +1,5 @@ locks-fix-a-potential-use-after-free-problem-when-wa.patch locks-reinstate-locks_delete_block-optimization.patch -spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch spi-spi-omap2-mcspi-support-probe-deferral-for-dma-c.patch drm-mediatek-find-the-cursor-plane-instead-of-hard-c.patch drm-mediatek-ensure-the-cursor-plane-is-on-top-of-ot.patch diff --git a/queue-5.5/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch b/queue-5.5/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch deleted file mode 100644 index 7f2e538131e..00000000000 --- a/queue-5.5/spi-spi-omap2-mcspi-handle-dma-size-restriction-on-a.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 313b21b44208424e5e8ce0e683ffbb7bd387a92b Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 4 Feb 2020 18:18:15 +0530 -Subject: spi: spi-omap2-mcspi: Handle DMA size restriction on AM65x - -From: Vignesh Raghavendra - -[ Upstream commit e4e8276a4f652be2c7bb783a0155d4adb85f5d7d ] - -On AM654, McSPI can only support 4K - 1 bytes per transfer when DMA is -enabled. Therefore populate master->max_transfer_size callback to -inform client drivers of this restriction when DMA channels are -available. - -Signed-off-by: Vignesh Raghavendra -Link: https://lore.kernel.org/r/20200204124816.16735-2-vigneshr@ti.com -Signed-off-by: Mark Brown -Signed-off-by: Sasha Levin ---- - drivers/spi/spi-omap2-mcspi.c | 26 +++++++++++++++++++ - include/linux/platform_data/spi-omap2-mcspi.h | 1 + - 2 files changed, 27 insertions(+) - -diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c -index 7e2292c11d120..e9bc9cf984d60 100644 ---- a/drivers/spi/spi-omap2-mcspi.c -+++ b/drivers/spi/spi-omap2-mcspi.c -@@ -130,6 +130,7 @@ struct omap2_mcspi { - int fifo_depth; - bool slave_aborted; - unsigned int pin_dir:1; -+ size_t max_xfer_len; - }; - - struct omap2_mcspi_cs { -@@ -1305,6 +1306,18 @@ static bool omap2_mcspi_can_dma(struct spi_master *master, - return (xfer->len >= DMA_MIN_BYTES); - } - -+static size_t omap2_mcspi_max_xfer_size(struct spi_device *spi) -+{ -+ struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); -+ struct omap2_mcspi_dma *mcspi_dma = -+ &mcspi->dma_channels[spi->chip_select]; -+ -+ if (mcspi->max_xfer_len && mcspi_dma->dma_rx) -+ return mcspi->max_xfer_len; -+ -+ return SIZE_MAX; -+} -+ - static int omap2_mcspi_controller_setup(struct omap2_mcspi *mcspi) - { - struct spi_master *master = mcspi->master; -@@ -1373,6 +1386,11 @@ static struct omap2_mcspi_platform_config omap4_pdata = { - .regs_offset = OMAP4_MCSPI_REG_OFFSET, - }; - -+static struct omap2_mcspi_platform_config am654_pdata = { -+ .regs_offset = OMAP4_MCSPI_REG_OFFSET, -+ .max_xfer_len = SZ_4K - 1, -+}; -+ - static const struct of_device_id omap_mcspi_of_match[] = { - { - .compatible = "ti,omap2-mcspi", -@@ -1382,6 +1400,10 @@ static const struct of_device_id omap_mcspi_of_match[] = { - .compatible = "ti,omap4-mcspi", - .data = &omap4_pdata, - }, -+ { -+ .compatible = "ti,am654-mcspi", -+ .data = &am654_pdata, -+ }, - { }, - }; - MODULE_DEVICE_TABLE(of, omap_mcspi_of_match); -@@ -1439,6 +1461,10 @@ static int omap2_mcspi_probe(struct platform_device *pdev) - mcspi->pin_dir = pdata->pin_dir; - } - regs_offset = pdata->regs_offset; -+ if (pdata->max_xfer_len) { -+ mcspi->max_xfer_len = pdata->max_xfer_len; -+ master->max_transfer_size = omap2_mcspi_max_xfer_size; -+ } - - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mcspi->base = devm_ioremap_resource(&pdev->dev, r); -diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h -index 0bf9fddb83064..3b400b1919a9b 100644 ---- a/include/linux/platform_data/spi-omap2-mcspi.h -+++ b/include/linux/platform_data/spi-omap2-mcspi.h -@@ -11,6 +11,7 @@ struct omap2_mcspi_platform_config { - unsigned short num_cs; - unsigned int regs_offset; - unsigned int pin_dir:1; -+ size_t max_xfer_len; - }; - - struct omap2_mcspi_device_config { --- -2.20.1 - -- 2.47.3