All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode
       [not found] <CGME20180417143022epcas2p1185d48998a1659ce6580180ea6725607@epcas2p1.samsung.com>
@ 2018-04-17 14:29   ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

Currently timeout errors in polling I/O mode transfer are silently ignored.
Fix it by returning an error when we time out waiting on the RX FIFO level
to reach the transfer length.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index baa3a9fa2638..9a990bc3138a 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -505,6 +505,8 @@ static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
 		status = readl(regs + S3C64XX_SPI_STATUS);
 	} while (RX_FIFO_LVL(status, sdd) < xfer->len && --val);
 
+	if (!val)
+		return -EIO;
 
 	/* If it was only Tx */
 	if (!xfer->rx_buf) {
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 1/8] spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode
@ 2018-04-17 14:29   ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Currently timeout errors in polling I/O mode transfer are silently ignored.
Fix it by returning an error when we time out waiting on the RX FIFO level
to reach the transfer length.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index baa3a9fa2638..9a990bc3138a 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -505,6 +505,8 @@ static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
 		status = readl(regs + S3C64XX_SPI_STATUS);
 	} while (RX_FIFO_LVL(status, sdd) < xfer->len && --val);
 
+	if (!val)
+		return -EIO;
 
 	/* If it was only Tx */
 	if (!xfer->rx_buf) {
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 2/8] spi: spi-s3c64xx: Remove unused driver data structure tgl_spi field
       [not found]   ` <CGME20180417143028epcas1p459b6358287256a1c060ea95847ce9fbd@epcas1p4.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

The tgl_spi pointer is now unused so remove it.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 9a990bc3138a..f0e28adbbc32 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -156,7 +156,6 @@ struct s3c64xx_spi_port_config {
  * @ioclk: Pointer to the i/o clock between master and slave
  * @master: Pointer to the SPI Protocol master.
  * @cntrlr_info: Platform specific data for the controller this driver manages.
- * @tgl_spi: Pointer to the last CS left untoggled by the cs_change hint.
  * @lock: Controller specific lock.
  * @state: Set of FLAGS to indicate status.
  * @rx_dmach: Controller's DMA channel for Rx.
@@ -177,7 +176,6 @@ struct s3c64xx_spi_driver_data {
 	struct platform_device          *pdev;
 	struct spi_master               *master;
 	struct s3c64xx_spi_info  *cntrlr_info;
-	struct spi_device               *tgl_spi;
 	spinlock_t                      lock;
 	unsigned long                   sfr_start;
 	struct completion               xfer_completion;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 2/8] spi: spi-s3c64xx: Remove unused driver data structure tgl_spi field
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

The tgl_spi pointer is now unused so remove it.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 9a990bc3138a..f0e28adbbc32 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -156,7 +156,6 @@ struct s3c64xx_spi_port_config {
  * @ioclk: Pointer to the i/o clock between master and slave
  * @master: Pointer to the SPI Protocol master.
  * @cntrlr_info: Platform specific data for the controller this driver manages.
- * @tgl_spi: Pointer to the last CS left untoggled by the cs_change hint.
  * @lock: Controller specific lock.
  * @state: Set of FLAGS to indicate status.
  * @rx_dmach: Controller's DMA channel for Rx.
@@ -177,7 +176,6 @@ struct s3c64xx_spi_driver_data {
 	struct platform_device          *pdev;
 	struct spi_master               *master;
 	struct s3c64xx_spi_info  *cntrlr_info;
-	struct spi_device               *tgl_spi;
 	spinlock_t                      lock;
 	unsigned long                   sfr_start;
 	struct completion               xfer_completion;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 3/8] spi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() function argument
       [not found]   ` <CGME20180417143035epcas2p2959c3987da80bf28cacc603168204f4c@epcas2p2.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

The channel argument is not used and anyway the value could be retrieved
from the passed driver data structure.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index f0e28adbbc32..4c27426bcb40 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -891,7 +891,7 @@ static irqreturn_t s3c64xx_spi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }

-static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel)
+static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 {
 	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
 	void __iomem *regs = sdd->regs;
@@ -1145,7 +1145,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	pm_runtime_get_sync(&pdev->dev);

 	/* Setup Deufult Mode */
-	s3c64xx_spi_hwinit(sdd, sdd->port_id);
+	s3c64xx_spi_hwinit(sdd);

 	spin_lock_init(&sdd->lock);
 	init_completion(&sdd->xfer_completion);
@@ -1260,7 +1260,7 @@ static int s3c64xx_spi_resume(struct device *dev)
 	if (ret < 0)
 		return ret;

-	s3c64xx_spi_hwinit(sdd, sdd->port_id);
+	s3c64xx_spi_hwinit(sdd);

 	return spi_master_resume(master);
 }
--
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 3/8] spi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() function argument
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

The channel argument is not used and anyway the value could be retrieved
from the passed driver data structure.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index f0e28adbbc32..4c27426bcb40 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -891,7 +891,7 @@ static irqreturn_t s3c64xx_spi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }

-static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel)
+static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 {
 	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
 	void __iomem *regs = sdd->regs;
@@ -1145,7 +1145,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	pm_runtime_get_sync(&pdev->dev);

 	/* Setup Deufult Mode */
-	s3c64xx_spi_hwinit(sdd, sdd->port_id);
+	s3c64xx_spi_hwinit(sdd);

 	spin_lock_init(&sdd->lock);
 	init_completion(&sdd->xfer_completion);
@@ -1260,7 +1260,7 @@ static int s3c64xx_spi_resume(struct device *dev)
 	if (ret < 0)
 		return ret;

-	s3c64xx_spi_hwinit(sdd, sdd->port_id);
+	s3c64xx_spi_hwinit(sdd);

 	return spi_master_resume(master);
 }
--
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 4/8] spi: spi-s3c64xx: Drop unused enable_datapath() function argument
       [not found]   ` <CGME20180417143039epcas2p39e2c730d107c94e5f9bf104d3a938f90@epcas2p3.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

The spi pointer argument is not used now so remove it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 4c27426bcb40..5d94915c2738 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -349,8 +349,7 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 }
 
 static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-				struct spi_device *spi,
-				struct spi_transfer *xfer, int dma_mode)
+			    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -667,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, spi, xfer, use_dma);
+	enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 4/8] spi: spi-s3c64xx: Drop unused enable_datapath() function argument
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

The spi pointer argument is not used now so remove it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 4c27426bcb40..5d94915c2738 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -349,8 +349,7 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 }
 
 static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-				struct spi_device *spi,
-				struct spi_transfer *xfer, int dma_mode)
+			    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -667,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, spi, xfer, use_dma);
+	enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 5/8] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names
       [not found]   ` <CGME20180417143045epcas2p2ac92ce458223a849647265d59b12bc70@epcas2p2.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

Add a s3c64xx_ prefix to remaining generic function names so it is clear
the code is part of the driver when grepping or looking at debug logs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 5d94915c2738..b9b406138675 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -188,7 +188,7 @@ struct s3c64xx_spi_driver_data {
 	unsigned int			port_id;
 };
 
-static void flush_fifo(struct s3c64xx_spi_driver_data *sdd)
+static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long loops;
@@ -348,8 +348,8 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 	return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
 }
 
-static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-			    struct spi_transfer *xfer, int dma_mode)
+static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+				    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -439,8 +439,8 @@ static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd,
 	return RX_FIFO_LVL(status, sdd);
 }
 
-static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -482,8 +482,8 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
 	return 0;
 }
 
-static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -666,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, xfer, use_dma);
+	s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
@@ -674,9 +674,9 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	spin_unlock_irqrestore(&sdd->lock, flags);
 
 	if (use_dma)
-		status = wait_for_dma(sdd, xfer);
+		status = s3c64xx_wait_for_dma(sdd, xfer);
 	else
-		status = wait_for_pio(sdd, xfer);
+		status = s3c64xx_wait_for_pio(sdd, xfer);
 
 	if (status) {
 		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
@@ -694,7 +694,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				dmaengine_terminate_all(sdd->rx_dma.ch);
 		}
 	} else {
-		flush_fifo(sdd);
+		s3c64xx_flush_fifo(sdd);
 	}
 
 	return status;
@@ -928,7 +928,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 	val |= (S3C64XX_SPI_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF);
 	writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
-	flush_fifo(sdd);
+	s3c64xx_flush_fifo(sdd);
 }
 
 #ifdef CONFIG_OF
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 5/8] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Add a s3c64xx_ prefix to remaining generic function names so it is clear
the code is part of the driver when grepping or looking at debug logs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 5d94915c2738..b9b406138675 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -188,7 +188,7 @@ struct s3c64xx_spi_driver_data {
 	unsigned int			port_id;
 };
 
-static void flush_fifo(struct s3c64xx_spi_driver_data *sdd)
+static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long loops;
@@ -348,8 +348,8 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 	return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
 }
 
-static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-			    struct spi_transfer *xfer, int dma_mode)
+static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+				    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -439,8 +439,8 @@ static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd,
 	return RX_FIFO_LVL(status, sdd);
 }
 
-static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -482,8 +482,8 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
 	return 0;
 }
 
-static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -666,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, xfer, use_dma);
+	s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
@@ -674,9 +674,9 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	spin_unlock_irqrestore(&sdd->lock, flags);
 
 	if (use_dma)
-		status = wait_for_dma(sdd, xfer);
+		status = s3c64xx_wait_for_dma(sdd, xfer);
 	else
-		status = wait_for_pio(sdd, xfer);
+		status = s3c64xx_wait_for_pio(sdd, xfer);
 
 	if (status) {
 		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
@@ -694,7 +694,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				dmaengine_terminate_all(sdd->rx_dma.ch);
 		}
 	} else {
-		flush_fifo(sdd);
+		s3c64xx_flush_fifo(sdd);
 	}
 
 	return status;
@@ -928,7 +928,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 	val |= (S3C64XX_SPI_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF);
 	writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
-	flush_fifo(sdd);
+	s3c64xx_flush_fifo(sdd);
 }
 
 #ifdef CONFIG_OF
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
       [not found]   ` <CGME20180417143049epcas2p1a9244272897740ac03d7a21d5dfb5d14@epcas2p1.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

Change indentation so register address offset and register bit definitions
are aligned to same column.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index b9b406138675..db33bc9b4147 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -28,15 +28,15 @@
 
 #define S3C64XX_SPI_CH_CFG		0x00
 #define S3C64XX_SPI_CLK_CFG		0x04
-#define S3C64XX_SPI_MODE_CFG	0x08
-#define S3C64XX_SPI_SLAVE_SEL	0x0C
+#define S3C64XX_SPI_MODE_CFG		0x08
+#define S3C64XX_SPI_SLAVE_SEL		0x0C
 #define S3C64XX_SPI_INT_EN		0x10
 #define S3C64XX_SPI_STATUS		0x14
 #define S3C64XX_SPI_TX_DATA		0x18
 #define S3C64XX_SPI_RX_DATA		0x1C
-#define S3C64XX_SPI_PACKET_CNT	0x20
-#define S3C64XX_SPI_PENDING_CLR	0x24
-#define S3C64XX_SPI_SWAP_CFG	0x28
+#define S3C64XX_SPI_PACKET_CNT		0x20
+#define S3C64XX_SPI_PENDING_CLR		0x24
+#define S3C64XX_SPI_SWAP_CFG		0x28
 #define S3C64XX_SPI_FB_CLK		0x2C
 
 #define S3C64XX_SPI_CH_HS_EN		(1<<6)	/* High Speed Enable */
@@ -77,9 +77,9 @@
 #define S3C64XX_SPI_INT_TX_FIFORDY_EN		(1<<0)
 
 #define S3C64XX_SPI_ST_RX_OVERRUN_ERR		(1<<5)
-#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR	(1<<4)
+#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR		(1<<4)
 #define S3C64XX_SPI_ST_TX_OVERRUN_ERR		(1<<3)
-#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR	(1<<2)
+#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR		(1<<2)
 #define S3C64XX_SPI_ST_RX_FIFORDY		(1<<1)
 #define S3C64XX_SPI_ST_TX_FIFORDY		(1<<0)
 
@@ -100,7 +100,7 @@
 #define S3C64XX_SPI_SWAP_TX_BIT			(1<<1)
 #define S3C64XX_SPI_SWAP_TX_EN			(1<<0)
 
-#define S3C64XX_SPI_FBCLK_MSK		(3<<0)
+#define S3C64XX_SPI_FBCLK_MSK			(3<<0)
 
 #define FIFO_LVL_MASK(i) ((i)->port_conf->fifo_lvl_mask[i->port_id])
 #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & \
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Change indentation so register address offset and register bit definitions
are aligned to same column.

Reviewed-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index b9b406138675..db33bc9b4147 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -28,15 +28,15 @@
 
 #define S3C64XX_SPI_CH_CFG		0x00
 #define S3C64XX_SPI_CLK_CFG		0x04
-#define S3C64XX_SPI_MODE_CFG	0x08
-#define S3C64XX_SPI_SLAVE_SEL	0x0C
+#define S3C64XX_SPI_MODE_CFG		0x08
+#define S3C64XX_SPI_SLAVE_SEL		0x0C
 #define S3C64XX_SPI_INT_EN		0x10
 #define S3C64XX_SPI_STATUS		0x14
 #define S3C64XX_SPI_TX_DATA		0x18
 #define S3C64XX_SPI_RX_DATA		0x1C
-#define S3C64XX_SPI_PACKET_CNT	0x20
-#define S3C64XX_SPI_PENDING_CLR	0x24
-#define S3C64XX_SPI_SWAP_CFG	0x28
+#define S3C64XX_SPI_PACKET_CNT		0x20
+#define S3C64XX_SPI_PENDING_CLR		0x24
+#define S3C64XX_SPI_SWAP_CFG		0x28
 #define S3C64XX_SPI_FB_CLK		0x2C
 
 #define S3C64XX_SPI_CH_HS_EN		(1<<6)	/* High Speed Enable */
@@ -77,9 +77,9 @@
 #define S3C64XX_SPI_INT_TX_FIFORDY_EN		(1<<0)
 
 #define S3C64XX_SPI_ST_RX_OVERRUN_ERR		(1<<5)
-#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR	(1<<4)
+#define S3C64XX_SPI_ST_RX_UNDERRUN_ERR		(1<<4)
 #define S3C64XX_SPI_ST_TX_OVERRUN_ERR		(1<<3)
-#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR	(1<<2)
+#define S3C64XX_SPI_ST_TX_UNDERRUN_ERR		(1<<2)
 #define S3C64XX_SPI_ST_RX_FIFORDY		(1<<1)
 #define S3C64XX_SPI_ST_TX_FIFORDY		(1<<0)
 
@@ -100,7 +100,7 @@
 #define S3C64XX_SPI_SWAP_TX_BIT			(1<<1)
 #define S3C64XX_SPI_SWAP_TX_EN			(1<<0)
 
-#define S3C64XX_SPI_FBCLK_MSK		(3<<0)
+#define S3C64XX_SPI_FBCLK_MSK			(3<<0)
 
 #define FIFO_LVL_MASK(i) ((i)->port_conf->fifo_lvl_mask[i->port_id])
 #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & \
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length
       [not found]   ` <CGME20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d@epcas1p2.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

More references to fifo_len are added in subsequent patch.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index db33bc9b4147..27cd8c59eabf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -634,6 +634,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				    struct spi_transfer *xfer)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
+	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
 	int status;
 	u32 speed;
 	u8 bpw;
@@ -655,9 +656,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
 	/* Polling method for xfers not bigger than FIFO capacity */
 	use_dma = 0;
-	if (!is_polling(sdd) &&
-	    (sdd->rx_dma.ch && sdd->tx_dma.ch &&
-	     (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1))))
+	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
+	    sdd->rx_dma.ch && sdd->tx_dma.ch)
 		use_dma = 1;
 
 	spin_lock_irqsave(&sdd->lock, flags);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

More references to fifo_len are added in subsequent patch.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index db33bc9b4147..27cd8c59eabf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -634,6 +634,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				    struct spi_transfer *xfer)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
+	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
 	int status;
 	u32 speed;
 	u8 bpw;
@@ -655,9 +656,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
 	/* Polling method for xfers not bigger than FIFO capacity */
 	use_dma = 0;
-	if (!is_polling(sdd) &&
-	    (sdd->rx_dma.ch && sdd->tx_dma.ch &&
-	     (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1))))
+	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
+	    sdd->rx_dma.ch && sdd->tx_dma.ch)
 		use_dma = 1;
 
 	spin_lock_irqsave(&sdd->lock, flags);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 8/8] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode
       [not found]   ` <CGME20180417143100epcas2p228d05e4de4ce06621635a523241d9824@epcas2p2.samsung.com>
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: broonie
  Cc: linux-samsung-soc, Sylwester Nawrocki, b.zolnierkie, krzk,
	linux-spi, kgene, andi, linux-arm-kernel, m.szyprowski

Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly
handled by the driver. Fix it by doing multiple transfers in the
s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
the FIFO size.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 99 +++++++++++++++++++++++++++++++----------------
 1 file changed, 66 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 27cd8c59eabf..755ab2dc6969 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -635,11 +635,14 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
+	const void *tx_buf = NULL;
+	void *rx_buf = NULL;
+	int target_len = 0, origin_len = 0;
+	int use_dma = 0;
 	int status;
 	u32 speed;
 	u8 bpw;
 	unsigned long flags;
-	int use_dma;
 
 	reinit_completion(&sdd->xfer_completion);
 
@@ -654,47 +657,77 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 		s3c64xx_spi_config(sdd);
 	}
 
-	/* Polling method for xfers not bigger than FIFO capacity */
-	use_dma = 0;
 	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
-	    sdd->rx_dma.ch && sdd->tx_dma.ch)
+	    sdd->rx_dma.ch && sdd->tx_dma.ch) {
 		use_dma = 1;
 
-	spin_lock_irqsave(&sdd->lock, flags);
+	} else if (is_polling(sdd) && xfer->len > fifo_len) {
+		tx_buf = xfer->tx_buf;
+		rx_buf = xfer->rx_buf;
+		origin_len = xfer->len;
 
-	/* Pending only which is to be done */
-	sdd->state &= ~RXBUSY;
-	sdd->state &= ~TXBUSY;
+		target_len = xfer->len;
+		if (xfer->len > fifo_len)
+			xfer->len = fifo_len;
+	}
+
+	do {
+		spin_lock_irqsave(&sdd->lock, flags);
 
-	s3c64xx_enable_datapath(sdd, xfer, use_dma);
+		/* Pending only which is to be done */
+		sdd->state &= ~RXBUSY;
+		sdd->state &= ~TXBUSY;
 
-	/* Start the signals */
-	s3c64xx_spi_set_cs(spi, true);
+		s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
-	spin_unlock_irqrestore(&sdd->lock, flags);
+		/* Start the signals */
+		s3c64xx_spi_set_cs(spi, true);
 
-	if (use_dma)
-		status = s3c64xx_wait_for_dma(sdd, xfer);
-	else
-		status = s3c64xx_wait_for_pio(sdd, xfer);
-
-	if (status) {
-		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
-			xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
-			(sdd->state & RXBUSY) ? 'f' : 'p',
-			(sdd->state & TXBUSY) ? 'f' : 'p',
-			xfer->len);
-
-		if (use_dma) {
-			if (xfer->tx_buf != NULL
-			    && (sdd->state & TXBUSY))
-				dmaengine_terminate_all(sdd->tx_dma.ch);
-			if (xfer->rx_buf != NULL
-			    && (sdd->state & RXBUSY))
-				dmaengine_terminate_all(sdd->rx_dma.ch);
+		spin_unlock_irqrestore(&sdd->lock, flags);
+
+		if (use_dma)
+			status = s3c64xx_wait_for_dma(sdd, xfer);
+		else
+			status = s3c64xx_wait_for_pio(sdd, xfer);
+
+		if (status) {
+			dev_err(&spi->dev,
+				"I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
+				xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
+				(sdd->state & RXBUSY) ? 'f' : 'p',
+				(sdd->state & TXBUSY) ? 'f' : 'p',
+				xfer->len);
+
+			if (use_dma) {
+				if (xfer->tx_buf && (sdd->state & TXBUSY))
+					dmaengine_terminate_all(sdd->tx_dma.ch);
+				if (xfer->rx_buf && (sdd->state & RXBUSY))
+					dmaengine_terminate_all(sdd->rx_dma.ch);
+			}
+		} else {
+			s3c64xx_flush_fifo(sdd);
 		}
-	} else {
-		s3c64xx_flush_fifo(sdd);
+		if (target_len > 0) {
+			target_len -= xfer->len;
+
+			if (xfer->tx_buf)
+				xfer->tx_buf += xfer->len;
+
+			if (xfer->rx_buf)
+				xfer->rx_buf += xfer->len;
+
+			if (target_len > fifo_len)
+				xfer->len = fifo_len;
+			else
+				xfer->len = target_len;
+		}
+	} while (target_len > 0);
+
+	if (origin_len) {
+		/* Restore original xfer buffers and length */
+		xfer->tx_buf = tx_buf;
+		xfer->rx_buf = rx_buf;
+		xfer->len = origin_len;
 	}
 
 	return status;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 8/8] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode
@ 2018-04-17 14:29       ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly
handled by the driver. Fix it by doing multiple transfers in the
s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
the FIFO size.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 99 +++++++++++++++++++++++++++++++----------------
 1 file changed, 66 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 27cd8c59eabf..755ab2dc6969 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -635,11 +635,14 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
+	const void *tx_buf = NULL;
+	void *rx_buf = NULL;
+	int target_len = 0, origin_len = 0;
+	int use_dma = 0;
 	int status;
 	u32 speed;
 	u8 bpw;
 	unsigned long flags;
-	int use_dma;
 
 	reinit_completion(&sdd->xfer_completion);
 
@@ -654,47 +657,77 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 		s3c64xx_spi_config(sdd);
 	}
 
-	/* Polling method for xfers not bigger than FIFO capacity */
-	use_dma = 0;
 	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
-	    sdd->rx_dma.ch && sdd->tx_dma.ch)
+	    sdd->rx_dma.ch && sdd->tx_dma.ch) {
 		use_dma = 1;
 
-	spin_lock_irqsave(&sdd->lock, flags);
+	} else if (is_polling(sdd) && xfer->len > fifo_len) {
+		tx_buf = xfer->tx_buf;
+		rx_buf = xfer->rx_buf;
+		origin_len = xfer->len;
 
-	/* Pending only which is to be done */
-	sdd->state &= ~RXBUSY;
-	sdd->state &= ~TXBUSY;
+		target_len = xfer->len;
+		if (xfer->len > fifo_len)
+			xfer->len = fifo_len;
+	}
+
+	do {
+		spin_lock_irqsave(&sdd->lock, flags);
 
-	s3c64xx_enable_datapath(sdd, xfer, use_dma);
+		/* Pending only which is to be done */
+		sdd->state &= ~RXBUSY;
+		sdd->state &= ~TXBUSY;
 
-	/* Start the signals */
-	s3c64xx_spi_set_cs(spi, true);
+		s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
-	spin_unlock_irqrestore(&sdd->lock, flags);
+		/* Start the signals */
+		s3c64xx_spi_set_cs(spi, true);
 
-	if (use_dma)
-		status = s3c64xx_wait_for_dma(sdd, xfer);
-	else
-		status = s3c64xx_wait_for_pio(sdd, xfer);
-
-	if (status) {
-		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
-			xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
-			(sdd->state & RXBUSY) ? 'f' : 'p',
-			(sdd->state & TXBUSY) ? 'f' : 'p',
-			xfer->len);
-
-		if (use_dma) {
-			if (xfer->tx_buf != NULL
-			    && (sdd->state & TXBUSY))
-				dmaengine_terminate_all(sdd->tx_dma.ch);
-			if (xfer->rx_buf != NULL
-			    && (sdd->state & RXBUSY))
-				dmaengine_terminate_all(sdd->rx_dma.ch);
+		spin_unlock_irqrestore(&sdd->lock, flags);
+
+		if (use_dma)
+			status = s3c64xx_wait_for_dma(sdd, xfer);
+		else
+			status = s3c64xx_wait_for_pio(sdd, xfer);
+
+		if (status) {
+			dev_err(&spi->dev,
+				"I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
+				xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
+				(sdd->state & RXBUSY) ? 'f' : 'p',
+				(sdd->state & TXBUSY) ? 'f' : 'p',
+				xfer->len);
+
+			if (use_dma) {
+				if (xfer->tx_buf && (sdd->state & TXBUSY))
+					dmaengine_terminate_all(sdd->tx_dma.ch);
+				if (xfer->rx_buf && (sdd->state & RXBUSY))
+					dmaengine_terminate_all(sdd->rx_dma.ch);
+			}
+		} else {
+			s3c64xx_flush_fifo(sdd);
 		}
-	} else {
-		s3c64xx_flush_fifo(sdd);
+		if (target_len > 0) {
+			target_len -= xfer->len;
+
+			if (xfer->tx_buf)
+				xfer->tx_buf += xfer->len;
+
+			if (xfer->rx_buf)
+				xfer->rx_buf += xfer->len;
+
+			if (target_len > fifo_len)
+				xfer->len = fifo_len;
+			else
+				xfer->len = target_len;
+		}
+	} while (target_len > 0);
+
+	if (origin_len) {
+		/* Restore original xfer buffers and length */
+		xfer->tx_buf = tx_buf;
+		xfer->rx_buf = rx_buf;
+		xfer->len = origin_len;
 	}
 
 	return status;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 4/8] spi: spi-s3c64xx: Drop unused enable_datapath() function argument
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-17 18:09         ` andi at etezian.org
  -1 siblings, 0 replies; 38+ messages in thread
From: andi @ 2018-04-17 18:09 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, broonie, kgene,
	linux-arm-kernel, m.szyprowski

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> The spi pointer argument is not used now so remove it.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Thanks for splitting it!

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 4/8] spi: spi-s3c64xx: Drop unused enable_datapath() function argument
@ 2018-04-17 18:09         ` andi at etezian.org
  0 siblings, 0 replies; 38+ messages in thread
From: andi at etezian.org @ 2018-04-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> The spi pointer argument is not used now so remove it.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Thanks for splitting it!

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 5/8] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-17 18:11         ` andi at etezian.org
  -1 siblings, 0 replies; 38+ messages in thread
From: andi @ 2018-04-17 18:11 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, broonie, kgene,
	linux-arm-kernel, m.szyprowski

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> Add a s3c64xx_ prefix to remaining generic function names so it is 
> clear
> the code is part of the driver when grepping or looking at debug logs.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thank you :)

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 5/8] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names
@ 2018-04-17 18:11         ` andi at etezian.org
  0 siblings, 0 replies; 38+ messages in thread
From: andi at etezian.org @ 2018-04-17 18:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> Add a s3c64xx_ prefix to remaining generic function names so it is 
> clear
> the code is part of the driver when grepping or looking at debug logs.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thank you :)

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-17 18:14         ` andi at etezian.org
  -1 siblings, 0 replies; 38+ messages in thread
From: andi @ 2018-04-17 18:14 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, broonie, kgene,
	linux-arm-kernel, m.szyprowski

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> More references to fifo_len are added in subsequent patch.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thanks also for this! It's trivial, but I like it better
on a separate patch.

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length
@ 2018-04-17 18:14         ` andi at etezian.org
  0 siblings, 0 replies; 38+ messages in thread
From: andi at etezian.org @ 2018-04-17 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> More references to fifo_len are added in subsequent patch.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thanks also for this! It's trivial, but I like it better
on a separate patch.

Reviewed-by: Andi Shyti <andi@etezian.org>

Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 8/8] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-17 18:27         ` andi at etezian.org
  -1 siblings, 0 replies; 38+ messages in thread
From: andi @ 2018-04-17 18:27 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, broonie, kgene,
	linux-arm-kernel, m.szyprowski

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> Some variants of the SPI controller have no DMA support, in such case
> SPI transfers longer than the FIFO length are not currently properly
> handled by the driver. Fix it by doing multiple transfers in the
> s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
> the FIFO size.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thank you! it looks good.

Unfortunately I don't have right now the device with me
to test it, in any case you can add

Reviewed-by: Andi Shyti <andi@etezian.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 8/8] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode
@ 2018-04-17 18:27         ` andi at etezian.org
  0 siblings, 0 replies; 38+ messages in thread
From: andi at etezian.org @ 2018-04-17 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

On 17.04.2018 23:29, Sylwester Nawrocki wrote:
> Some variants of the SPI controller have no DMA support, in such case
> SPI transfers longer than the FIFO length are not currently properly
> handled by the driver. Fix it by doing multiple transfers in the
> s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
> the FIFO size.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

thank you! it looks good.

Unfortunately I don't have right now the device with me
to test it, in any case you can add

Reviewed-by: Andi Shyti <andi@etezian.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-18 10:47         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 10:47 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, kgene, andi,
	linux-arm-kernel, m.szyprowski


[-- Attachment #1.1: Type: text/plain, Size: 242 bytes --]

On Tue, Apr 17, 2018 at 04:29:52PM +0200, Sylwester Nawrocki wrote:
> Change indentation so register address offset and register bit definitions
> are aligned to same column.

This doesn't apply against current code, please check and resend.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
@ 2018-04-18 10:47         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 17, 2018 at 04:29:52PM +0200, Sylwester Nawrocki wrote:
> Change indentation so register address offset and register bit definitions
> are aligned to same column.

This doesn't apply against current code, please check and resend.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180418/3a28d070/attachment.sig>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode" to the spi tree
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-18 11:40         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, broonie, krzk, linux-spi, kgene,
	andi, linux-arm-kernel, m.szyprowski

The patch

   spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0af7af7da6510f12595b81ba98bb15dd7ffed1f3 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:54 +0200
Subject: [PATCH] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO
 mode

Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly
handled by the driver. Fix it by doing multiple transfers in the
s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
the FIFO size.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 99 ++++++++++++++++++++++++++-------------
 1 file changed, 66 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 27cd8c59eabf..755ab2dc6969 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -635,11 +635,14 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
+	const void *tx_buf = NULL;
+	void *rx_buf = NULL;
+	int target_len = 0, origin_len = 0;
+	int use_dma = 0;
 	int status;
 	u32 speed;
 	u8 bpw;
 	unsigned long flags;
-	int use_dma;
 
 	reinit_completion(&sdd->xfer_completion);
 
@@ -654,47 +657,77 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 		s3c64xx_spi_config(sdd);
 	}
 
-	/* Polling method for xfers not bigger than FIFO capacity */
-	use_dma = 0;
 	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
-	    sdd->rx_dma.ch && sdd->tx_dma.ch)
+	    sdd->rx_dma.ch && sdd->tx_dma.ch) {
 		use_dma = 1;
 
-	spin_lock_irqsave(&sdd->lock, flags);
+	} else if (is_polling(sdd) && xfer->len > fifo_len) {
+		tx_buf = xfer->tx_buf;
+		rx_buf = xfer->rx_buf;
+		origin_len = xfer->len;
 
-	/* Pending only which is to be done */
-	sdd->state &= ~RXBUSY;
-	sdd->state &= ~TXBUSY;
+		target_len = xfer->len;
+		if (xfer->len > fifo_len)
+			xfer->len = fifo_len;
+	}
+
+	do {
+		spin_lock_irqsave(&sdd->lock, flags);
 
-	s3c64xx_enable_datapath(sdd, xfer, use_dma);
+		/* Pending only which is to be done */
+		sdd->state &= ~RXBUSY;
+		sdd->state &= ~TXBUSY;
 
-	/* Start the signals */
-	s3c64xx_spi_set_cs(spi, true);
+		s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
-	spin_unlock_irqrestore(&sdd->lock, flags);
+		/* Start the signals */
+		s3c64xx_spi_set_cs(spi, true);
 
-	if (use_dma)
-		status = s3c64xx_wait_for_dma(sdd, xfer);
-	else
-		status = s3c64xx_wait_for_pio(sdd, xfer);
-
-	if (status) {
-		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
-			xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
-			(sdd->state & RXBUSY) ? 'f' : 'p',
-			(sdd->state & TXBUSY) ? 'f' : 'p',
-			xfer->len);
-
-		if (use_dma) {
-			if (xfer->tx_buf != NULL
-			    && (sdd->state & TXBUSY))
-				dmaengine_terminate_all(sdd->tx_dma.ch);
-			if (xfer->rx_buf != NULL
-			    && (sdd->state & RXBUSY))
-				dmaengine_terminate_all(sdd->rx_dma.ch);
+		spin_unlock_irqrestore(&sdd->lock, flags);
+
+		if (use_dma)
+			status = s3c64xx_wait_for_dma(sdd, xfer);
+		else
+			status = s3c64xx_wait_for_pio(sdd, xfer);
+
+		if (status) {
+			dev_err(&spi->dev,
+				"I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
+				xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
+				(sdd->state & RXBUSY) ? 'f' : 'p',
+				(sdd->state & TXBUSY) ? 'f' : 'p',
+				xfer->len);
+
+			if (use_dma) {
+				if (xfer->tx_buf && (sdd->state & TXBUSY))
+					dmaengine_terminate_all(sdd->tx_dma.ch);
+				if (xfer->rx_buf && (sdd->state & RXBUSY))
+					dmaengine_terminate_all(sdd->rx_dma.ch);
+			}
+		} else {
+			s3c64xx_flush_fifo(sdd);
 		}
-	} else {
-		s3c64xx_flush_fifo(sdd);
+		if (target_len > 0) {
+			target_len -= xfer->len;
+
+			if (xfer->tx_buf)
+				xfer->tx_buf += xfer->len;
+
+			if (xfer->rx_buf)
+				xfer->rx_buf += xfer->len;
+
+			if (target_len > fifo_len)
+				xfer->len = fifo_len;
+			else
+				xfer->len = target_len;
+		}
+	} while (target_len > 0);
+
+	if (origin_len) {
+		/* Restore original xfer buffers and length */
+		xfer->tx_buf = tx_buf;
+		xfer->rx_buf = rx_buf;
+		xfer->len = origin_len;
 	}
 
 	return status;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode" to the spi tree
@ 2018-04-18 11:40         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0af7af7da6510f12595b81ba98bb15dd7ffed1f3 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:54 +0200
Subject: [PATCH] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO
 mode

Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly
handled by the driver. Fix it by doing multiple transfers in the
s3c64xx_spi_transfer_one() function if the SPI transfer length exceeds
the FIFO size.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 99 ++++++++++++++++++++++++++-------------
 1 file changed, 66 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 27cd8c59eabf..755ab2dc6969 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -635,11 +635,14 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
+	const void *tx_buf = NULL;
+	void *rx_buf = NULL;
+	int target_len = 0, origin_len = 0;
+	int use_dma = 0;
 	int status;
 	u32 speed;
 	u8 bpw;
 	unsigned long flags;
-	int use_dma;
 
 	reinit_completion(&sdd->xfer_completion);
 
@@ -654,47 +657,77 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 		s3c64xx_spi_config(sdd);
 	}
 
-	/* Polling method for xfers not bigger than FIFO capacity */
-	use_dma = 0;
 	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
-	    sdd->rx_dma.ch && sdd->tx_dma.ch)
+	    sdd->rx_dma.ch && sdd->tx_dma.ch) {
 		use_dma = 1;
 
-	spin_lock_irqsave(&sdd->lock, flags);
+	} else if (is_polling(sdd) && xfer->len > fifo_len) {
+		tx_buf = xfer->tx_buf;
+		rx_buf = xfer->rx_buf;
+		origin_len = xfer->len;
 
-	/* Pending only which is to be done */
-	sdd->state &= ~RXBUSY;
-	sdd->state &= ~TXBUSY;
+		target_len = xfer->len;
+		if (xfer->len > fifo_len)
+			xfer->len = fifo_len;
+	}
+
+	do {
+		spin_lock_irqsave(&sdd->lock, flags);
 
-	s3c64xx_enable_datapath(sdd, xfer, use_dma);
+		/* Pending only which is to be done */
+		sdd->state &= ~RXBUSY;
+		sdd->state &= ~TXBUSY;
 
-	/* Start the signals */
-	s3c64xx_spi_set_cs(spi, true);
+		s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
-	spin_unlock_irqrestore(&sdd->lock, flags);
+		/* Start the signals */
+		s3c64xx_spi_set_cs(spi, true);
 
-	if (use_dma)
-		status = s3c64xx_wait_for_dma(sdd, xfer);
-	else
-		status = s3c64xx_wait_for_pio(sdd, xfer);
-
-	if (status) {
-		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
-			xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
-			(sdd->state & RXBUSY) ? 'f' : 'p',
-			(sdd->state & TXBUSY) ? 'f' : 'p',
-			xfer->len);
-
-		if (use_dma) {
-			if (xfer->tx_buf != NULL
-			    && (sdd->state & TXBUSY))
-				dmaengine_terminate_all(sdd->tx_dma.ch);
-			if (xfer->rx_buf != NULL
-			    && (sdd->state & RXBUSY))
-				dmaengine_terminate_all(sdd->rx_dma.ch);
+		spin_unlock_irqrestore(&sdd->lock, flags);
+
+		if (use_dma)
+			status = s3c64xx_wait_for_dma(sdd, xfer);
+		else
+			status = s3c64xx_wait_for_pio(sdd, xfer);
+
+		if (status) {
+			dev_err(&spi->dev,
+				"I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
+				xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
+				(sdd->state & RXBUSY) ? 'f' : 'p',
+				(sdd->state & TXBUSY) ? 'f' : 'p',
+				xfer->len);
+
+			if (use_dma) {
+				if (xfer->tx_buf && (sdd->state & TXBUSY))
+					dmaengine_terminate_all(sdd->tx_dma.ch);
+				if (xfer->rx_buf && (sdd->state & RXBUSY))
+					dmaengine_terminate_all(sdd->rx_dma.ch);
+			}
+		} else {
+			s3c64xx_flush_fifo(sdd);
 		}
-	} else {
-		s3c64xx_flush_fifo(sdd);
+		if (target_len > 0) {
+			target_len -= xfer->len;
+
+			if (xfer->tx_buf)
+				xfer->tx_buf += xfer->len;
+
+			if (xfer->rx_buf)
+				xfer->rx_buf += xfer->len;
+
+			if (target_len > fifo_len)
+				xfer->len = fifo_len;
+			else
+				xfer->len = target_len;
+		}
+	} while (target_len > 0);
+
+	if (origin_len) {
+		/* Restore original xfer buffers and length */
+		xfer->tx_buf = tx_buf;
+		xfer->rx_buf = rx_buf;
+		xfer->len = origin_len;
 	}
 
 	return status;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Use local variable for FIFO length" to the spi tree
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-18 11:40         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, broonie, krzk, linux-spi, kgene,
	andi, linux-arm-kernel, m.szyprowski

The patch

   spi: spi-s3c64xx: Use local variable for FIFO length

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From f6364e66c66135f40709635849620411f3f8a2ff Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:53 +0200
Subject: [PATCH] spi: spi-s3c64xx: Use local variable for FIFO length

More references to fifo_len are added in subsequent patch.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index db33bc9b4147..27cd8c59eabf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -634,6 +634,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				    struct spi_transfer *xfer)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
+	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
 	int status;
 	u32 speed;
 	u8 bpw;
@@ -655,9 +656,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
 	/* Polling method for xfers not bigger than FIFO capacity */
 	use_dma = 0;
-	if (!is_polling(sdd) &&
-	    (sdd->rx_dma.ch && sdd->tx_dma.ch &&
-	     (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1))))
+	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
+	    sdd->rx_dma.ch && sdd->tx_dma.ch)
 		use_dma = 1;
 
 	spin_lock_irqsave(&sdd->lock, flags);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Use local variable for FIFO length" to the spi tree
@ 2018-04-18 11:40         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: spi-s3c64xx: Use local variable for FIFO length

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From f6364e66c66135f40709635849620411f3f8a2ff Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:53 +0200
Subject: [PATCH] spi: spi-s3c64xx: Use local variable for FIFO length

More references to fifo_len are added in subsequent patch.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index db33bc9b4147..27cd8c59eabf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -634,6 +634,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				    struct spi_transfer *xfer)
 {
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
+	const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1;
 	int status;
 	u32 speed;
 	u8 bpw;
@@ -655,9 +656,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
 	/* Polling method for xfers not bigger than FIFO capacity */
 	use_dma = 0;
-	if (!is_polling(sdd) &&
-	    (sdd->rx_dma.ch && sdd->tx_dma.ch &&
-	     (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1))))
+	if (!is_polling(sdd) && (xfer->len > fifo_len) &&
+	    sdd->rx_dma.ch && sdd->tx_dma.ch)
 		use_dma = 1;
 
 	spin_lock_irqsave(&sdd->lock, flags);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names" to the spi tree
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-18 11:40         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, broonie, krzk, linux-spi, kgene,
	andi, linux-arm-kernel, m.szyprowski

The patch

   spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 3655d30c054816331820842b0a1db75f58aeadc9 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:51 +0200
Subject: [PATCH] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function
 names

Add a s3c64xx_ prefix to remaining generic function names so it is clear
the code is part of the driver when grepping or looking at debug logs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 38a5e9ce5f11..db33bc9b4147 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -188,7 +188,7 @@ struct s3c64xx_spi_driver_data {
 	unsigned int			port_id;
 };
 
-static void flush_fifo(struct s3c64xx_spi_driver_data *sdd)
+static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long loops;
@@ -348,8 +348,8 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 	return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
 }
 
-static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-			    struct spi_transfer *xfer, int dma_mode)
+static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+				    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -439,8 +439,8 @@ static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd,
 	return RX_FIFO_LVL(status, sdd);
 }
 
-static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -482,8 +482,8 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
 	return 0;
 }
 
-static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -666,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, xfer, use_dma);
+	s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
@@ -674,9 +674,9 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	spin_unlock_irqrestore(&sdd->lock, flags);
 
 	if (use_dma)
-		status = wait_for_dma(sdd, xfer);
+		status = s3c64xx_wait_for_dma(sdd, xfer);
 	else
-		status = wait_for_pio(sdd, xfer);
+		status = s3c64xx_wait_for_pio(sdd, xfer);
 
 	if (status) {
 		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
@@ -694,7 +694,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				dmaengine_terminate_all(sdd->rx_dma.ch);
 		}
 	} else {
-		flush_fifo(sdd);
+		s3c64xx_flush_fifo(sdd);
 	}
 
 	return status;
@@ -928,7 +928,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 	val |= (S3C64XX_SPI_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF);
 	writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
-	flush_fifo(sdd);
+	s3c64xx_flush_fifo(sdd);
 }
 
 #ifdef CONFIG_OF
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names" to the spi tree
@ 2018-04-18 11:40         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 3655d30c054816331820842b0a1db75f58aeadc9 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:51 +0200
Subject: [PATCH] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function
 names

Add a s3c64xx_ prefix to remaining generic function names so it is clear
the code is part of the driver when grepping or looking at debug logs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 38a5e9ce5f11..db33bc9b4147 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -188,7 +188,7 @@ struct s3c64xx_spi_driver_data {
 	unsigned int			port_id;
 };
 
-static void flush_fifo(struct s3c64xx_spi_driver_data *sdd)
+static void s3c64xx_flush_fifo(struct s3c64xx_spi_driver_data *sdd)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long loops;
@@ -348,8 +348,8 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 	return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
 }
 
-static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-			    struct spi_transfer *xfer, int dma_mode)
+static void s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+				    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -439,8 +439,8 @@ static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd,
 	return RX_FIFO_LVL(status, sdd);
 }
 
-static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -482,8 +482,8 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
 	return 0;
 }
 
-static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
-			struct spi_transfer *xfer)
+static int s3c64xx_wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
+				struct spi_transfer *xfer)
 {
 	void __iomem *regs = sdd->regs;
 	unsigned long val;
@@ -666,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, xfer, use_dma);
+	s3c64xx_enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
@@ -674,9 +674,9 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	spin_unlock_irqrestore(&sdd->lock, flags);
 
 	if (use_dma)
-		status = wait_for_dma(sdd, xfer);
+		status = s3c64xx_wait_for_dma(sdd, xfer);
 	else
-		status = wait_for_pio(sdd, xfer);
+		status = s3c64xx_wait_for_pio(sdd, xfer);
 
 	if (status) {
 		dev_err(&spi->dev, "I/O Error: rx-%d tx-%d res:rx-%c tx-%c len-%d\n",
@@ -694,7 +694,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 				dmaengine_terminate_all(sdd->rx_dma.ch);
 		}
 	} else {
-		flush_fifo(sdd);
+		s3c64xx_flush_fifo(sdd);
 	}
 
 	return status;
@@ -928,7 +928,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd)
 	val |= (S3C64XX_SPI_TRAILCNT << S3C64XX_SPI_TRAILCNT_OFF);
 	writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
-	flush_fifo(sdd);
+	s3c64xx_flush_fifo(sdd);
 }
 
 #ifdef CONFIG_OF
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Drop unused enable_datapath() function argument" to the spi tree
  2018-04-17 14:29       ` Sylwester Nawrocki
@ 2018-04-18 11:40         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, broonie, krzk, linux-spi, kgene,
	andi, linux-arm-kernel, m.szyprowski

The patch

   spi: spi-s3c64xx: Drop unused enable_datapath() function argument

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 80aa0d746c10e14ac14ca03b2bc8b26a0f75c5e4 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:50 +0200
Subject: [PATCH] spi: spi-s3c64xx: Drop unused enable_datapath() function
 argument

The spi pointer argument is not used now so remove it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 54fde5c80374..38a5e9ce5f11 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -349,8 +349,7 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 }
 
 static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-				struct spi_device *spi,
-				struct spi_transfer *xfer, int dma_mode)
+			    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -667,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, spi, xfer, use_dma);
+	enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Applied "spi: spi-s3c64xx: Drop unused enable_datapath() function argument" to the spi tree
@ 2018-04-18 11:40         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: spi-s3c64xx: Drop unused enable_datapath() function argument

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 80aa0d746c10e14ac14ca03b2bc8b26a0f75c5e4 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Tue, 17 Apr 2018 16:29:50 +0200
Subject: [PATCH] spi: spi-s3c64xx: Drop unused enable_datapath() function
 argument

The spi pointer argument is not used now so remove it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-s3c64xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 54fde5c80374..38a5e9ce5f11 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -349,8 +349,7 @@ static bool s3c64xx_spi_can_dma(struct spi_master *master,
 }
 
 static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
-				struct spi_device *spi,
-				struct spi_transfer *xfer, int dma_mode)
+			    struct spi_transfer *xfer, int dma_mode)
 {
 	void __iomem *regs = sdd->regs;
 	u32 modecfg, chcfg;
@@ -667,7 +666,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	sdd->state &= ~RXBUSY;
 	sdd->state &= ~TXBUSY;
 
-	enable_datapath(sdd, spi, xfer, use_dma);
+	enable_datapath(sdd, xfer, use_dma);
 
 	/* Start the signals */
 	s3c64xx_spi_set_cs(spi, true);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
  2018-04-18 10:47         ` Mark Brown
@ 2018-04-18 12:17           ` Sylwester Nawrocki
  -1 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-18 12:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, kgene, andi,
	linux-arm-kernel, m.szyprowski

On 04/18/2018 12:47 PM, Mark Brown wrote:
> On Tue, Apr 17, 2018 at 04:29:52PM +0200, Sylwester Nawrocki wrote:
>> Change indentation so register address offset and register bit definitions
>> are aligned to same column.
>
> This doesn't apply against current code, please check and resend.

It seems there is no need to resend now as all patches from the series
are in your for-4.18 branch.

-- 
Thanks,
Sylwester

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
@ 2018-04-18 12:17           ` Sylwester Nawrocki
  0 siblings, 0 replies; 38+ messages in thread
From: Sylwester Nawrocki @ 2018-04-18 12:17 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/18/2018 12:47 PM, Mark Brown wrote:
> On Tue, Apr 17, 2018 at 04:29:52PM +0200, Sylwester Nawrocki wrote:
>> Change indentation so register address offset and register bit definitions
>> are aligned to same column.
>
> This doesn't apply against current code, please check and resend.

It seems there is no need to resend now as all patches from the series
are in your for-4.18 branch.

-- 
Thanks,
Sylwester

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
  2018-04-18 12:17           ` Sylwester Nawrocki
@ 2018-04-18 13:49             ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 13:49 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, b.zolnierkie, krzk, linux-spi, kgene, andi,
	linux-arm-kernel, m.szyprowski


[-- Attachment #1.1: Type: text/plain, Size: 390 bytes --]

On Wed, Apr 18, 2018 at 02:17:36PM +0200, Sylwester Nawrocki wrote:
> On 04/18/2018 12:47 PM, Mark Brown wrote:

> > This doesn't apply against current code, please check and resend.

> It seems there is no need to resend now as all patches from the series
> are in your for-4.18 branch.

I applied a bunch of the series yesterday, it looks like something that
was applied then. 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions
@ 2018-04-18 13:49             ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2018-04-18 13:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 18, 2018 at 02:17:36PM +0200, Sylwester Nawrocki wrote:
> On 04/18/2018 12:47 PM, Mark Brown wrote:

> > This doesn't apply against current code, please check and resend.

> It seems there is no need to resend now as all patches from the series
> are in your for-4.18 branch.

I applied a bunch of the series yesterday, it looks like something that
was applied then. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180418/12d8e2f6/attachment.sig>

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2018-04-18 13:49 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180417143022epcas2p1185d48998a1659ce6580180ea6725607@epcas2p1.samsung.com>
2018-04-17 14:29 ` [PATCH v2 1/8] spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode Sylwester Nawrocki
2018-04-17 14:29   ` Sylwester Nawrocki
     [not found]   ` <CGME20180417143028epcas1p459b6358287256a1c060ea95847ce9fbd@epcas1p4.samsung.com>
2018-04-17 14:29     ` [PATCH v2 2/8] spi: spi-s3c64xx: Remove unused driver data structure tgl_spi field Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
     [not found]   ` <CGME20180417143035epcas2p2959c3987da80bf28cacc603168204f4c@epcas2p2.samsung.com>
2018-04-17 14:29     ` [PATCH v2 3/8] spi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() function argument Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
     [not found]   ` <CGME20180417143039epcas2p39e2c730d107c94e5f9bf104d3a938f90@epcas2p3.samsung.com>
2018-04-17 14:29     ` [PATCH v2 4/8] spi: spi-s3c64xx: Drop unused enable_datapath() " Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
2018-04-17 18:09       ` andi
2018-04-17 18:09         ` andi at etezian.org
2018-04-18 11:40       ` Applied "spi: spi-s3c64xx: Drop unused enable_datapath() function argument" to the spi tree Mark Brown
2018-04-18 11:40         ` Mark Brown
     [not found]   ` <CGME20180417143045epcas2p2ac92ce458223a849647265d59b12bc70@epcas2p2.samsung.com>
2018-04-17 14:29     ` [PATCH v2 5/8] spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
2018-04-17 18:11       ` andi
2018-04-17 18:11         ` andi at etezian.org
2018-04-18 11:40       ` Applied "spi: spi-s3c64xx: Add missing s3c64xx_ prefix to function names" to the spi tree Mark Brown
2018-04-18 11:40         ` Mark Brown
     [not found]   ` <CGME20180417143049epcas2p1a9244272897740ac03d7a21d5dfb5d14@epcas2p1.samsung.com>
2018-04-17 14:29     ` [PATCH v2 6/8] spi: spi-s3c64xx: Fix indentation in the register offset definitions Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
2018-04-18 10:47       ` Mark Brown
2018-04-18 10:47         ` Mark Brown
2018-04-18 12:17         ` Sylwester Nawrocki
2018-04-18 12:17           ` Sylwester Nawrocki
2018-04-18 13:49           ` Mark Brown
2018-04-18 13:49             ` Mark Brown
     [not found]   ` <CGME20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d@epcas1p2.samsung.com>
2018-04-17 14:29     ` [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
2018-04-17 18:14       ` andi
2018-04-17 18:14         ` andi at etezian.org
2018-04-18 11:40       ` Applied "spi: spi-s3c64xx: Use local variable for FIFO length" to the spi tree Mark Brown
2018-04-18 11:40         ` Mark Brown
     [not found]   ` <CGME20180417143100epcas2p228d05e4de4ce06621635a523241d9824@epcas2p2.samsung.com>
2018-04-17 14:29     ` [PATCH v2 8/8] spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode Sylwester Nawrocki
2018-04-17 14:29       ` Sylwester Nawrocki
2018-04-17 18:27       ` andi
2018-04-17 18:27         ` andi at etezian.org
2018-04-18 11:40       ` Applied "spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode" to the spi tree Mark Brown
2018-04-18 11:40         ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.