linux-spi.vger.kernel.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
       [not found] ` <1350181976-18233-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2012-10-14  2:32 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Marek Vasut, Fabio Estevam, Shawn Guo, Mark Brown, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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-ynQEQJNshbs@public.gmane.org>
Cc: Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Cc: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

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

* [PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout
       [not found] ` <1350181976-18233-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
@ 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: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Marek Vasut, Fabio Estevam, Shawn Guo, Mark Brown, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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-ynQEQJNshbs@public.gmane.org>
Cc: Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Cc: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

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

* Re: [PATCH 1/2] spi: mxs: Assign message status after transfer finished
       [not found] ` <1350181976-18233-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
  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
       [not found]     ` <20121017071026.GB14199-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-10-17  7:10 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Shawn Guo,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct

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

* Re: [PATCH 1/2] spi: mxs: Assign message status after transfer finished
       [not found]     ` <20121017071026.GB14199-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 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: Mark Brown
  Cc: Fabio Estevam, Shawn Guo,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct

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

* Re: [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
       [not found]           ` <20121026130459.GW18814-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-10-26 13:05 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Shawn Guo, Grant Likely, spi-devel-general,
	Chris Ball, linux-arm-kernel


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

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?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 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] 6+ messages in thread

* Re: [PATCH 1/2] spi: mxs: Assign message status after transfer finished
       [not found]           ` <20121026130459.GW18814-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 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: Mark Brown
  Cc: Fabio Estevam, Shawn Guo,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct

^ 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
     [not found] ` <1350181976-18233-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
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
     [not found]     ` <20121017071026.GB14199-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-10-26 12:31       ` Marek Vasut
2012-10-26 13:05         ` Mark Brown
     [not found]           ` <20121026130459.GW18814-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
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).