linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: mxs: Assign message status after transfer finished
@ 2012-10-14  2:32 Marek Vasut
  2012-10-14  2:32 ` [PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout Marek Vasut
  2012-10-17  7:10 ` [PATCH 1/2] spi: mxs: Assign message status after transfer finished Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2012-10-14  2:32 UTC (permalink / raw)
  To: linux-arm-kernel

In the current code implementing the MXS SPI driver, every transferred
message had assigned status = 0, which is not correct. Properly assign
status returned from the I/O functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/spi/spi-mxs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index edf1360..5a63bcd 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -480,7 +480,7 @@ static int mxs_spi_transfer_one(struct spi_master *master,
 		first = last = 0;
 	}
 
-	m->status = 0;
+	m->status = status;
 	spi_finalize_current_message(master);
 
 	return status;
-- 
1.7.10.4

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

* [PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout
  2012-10-14  2:32 [PATCH 1/2] spi: mxs: Assign message status after transfer finished Marek Vasut
@ 2012-10-14  2:32 ` Marek Vasut
  2012-10-17  7:10 ` [PATCH 1/2] spi: mxs: Assign message status after transfer finished Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2012-10-14  2:32 UTC (permalink / raw)
  To: linux-arm-kernel

In case the SPI DMA times out, the DMA might still be in some kind of
inconsistent state. Issue dmaengine_terminate_all() on the particular
channel to kill off all operations before continuing.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/spi/spi-mxs.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 5a63bcd..86dd04d 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -323,6 +323,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, int cs,
 	if (!ret) {
 		dev_err(ssp->dev, "DMA transfer timeout\n");
 		ret = -ETIMEDOUT;
+		dmaengine_terminate_all(ssp->dmach);
 		goto err_vmalloc;
 	}
 
-- 
1.7.10.4

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

* [PATCH 1/2] spi: mxs: Assign message status after transfer finished
  2012-10-14  2:32 [PATCH 1/2] spi: mxs: Assign message status after transfer finished Marek Vasut
  2012-10-14  2:32 ` [PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout Marek Vasut
@ 2012-10-17  7:10 ` Mark Brown
  2012-10-26 12:31   ` Marek Vasut
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-10-17  7:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 14, 2012 at 04:32:55AM +0200, Marek Vasut wrote:
> In the current code implementing the MXS SPI driver, every transferred
> message had assigned status = 0, which is not correct. Properly assign
> status returned from the I/O functions.

Applied both, thanks.

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

* [PATCH 1/2] spi: mxs: Assign message status after transfer finished
  2012-10-17  7:10 ` [PATCH 1/2] spi: mxs: Assign message status after transfer finished Mark Brown
@ 2012-10-26 12:31   ` Marek Vasut
  2012-10-26 13:05     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2012-10-26 12:31 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Mark Brown,

> On Sun, Oct 14, 2012 at 04:32:55AM +0200, Marek Vasut wrote:
> > In the current code implementing the MXS SPI driver, every transferred
> > message had assigned status = 0, which is not correct. Properly assign
> > status returned from the I/O functions.
> 
> Applied both, thanks.

Will they hit 3.7 please?

Best regards,
Marek Vasut

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

* [PATCH 1/2] spi: mxs: Assign message status after transfer finished
  2012-10-26 12:31   ` Marek Vasut
@ 2012-10-26 13:05     ` Mark Brown
  2012-10-26 13:13       ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-10-26 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 26, 2012 at 02:31:53PM +0200, Marek Vasut wrote:
> Dear Mark Brown,

> > Applied both, thanks.

> Will they hit 3.7 please?

I hadn't been going to do that, no - nothing about them seemed
especially urgent?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121026/f86cf974/attachment.sig>

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

* [PATCH 1/2] spi: mxs: Assign message status after transfer finished
  2012-10-26 13:05     ` Mark Brown
@ 2012-10-26 13:13       ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2012-10-26 13:13 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Mark Brown,

> On Fri, Oct 26, 2012 at 02:31:53PM +0200, Marek Vasut wrote:
> > Dear Mark Brown,
> > 
> > > Applied both, thanks.
> > 
> > Will they hit 3.7 please?
> 
> I hadn't been going to do that, no - nothing about them seemed
> especially urgent?

They're fixes, I'd be glad if you could slip them in. They're not urgent, but 
it'd be nice to have them included. Esp. since 3.7 seems like a really _good_ 
kernel for MXS, I'd love to have everything nicely polished in it.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-10-26 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14  2:32 [PATCH 1/2] spi: mxs: Assign message status after transfer finished Marek Vasut
2012-10-14  2:32 ` [PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout Marek Vasut
2012-10-17  7:10 ` [PATCH 1/2] spi: mxs: Assign message status after transfer finished Mark Brown
2012-10-26 12:31   ` Marek Vasut
2012-10-26 13:05     ` Mark Brown
2012-10-26 13:13       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).