linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
@ 2024-02-02 11:53 Ralf Schlatterbeck
  2024-02-13 17:06 ` Ralf Schlatterbeck
  2024-02-13 18:44 ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Ralf Schlatterbeck @ 2024-02-02 11:53 UTC (permalink / raw)
  To: Mark Brown, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, linux-spi, linux-arm-kernel,
	linux-kernel

There was a change in the mxs-dma engine that uses a new custom flag.
The change was not applied to the mxs spi driver.
This results in chipselect being deasserted too early.
This fixes the chipselect problem by using the new flag in the mxs-spi
driver.

Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag")
Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com>
---
For oscilloscope screenshots and a verbose explanation see my blog post
at https://blog.runtux.com/posts/2024/02/01/
History:
Omit the line break change from patch requested by Marc Kleine-Budde
<mkl@pengutronix.de>

 drivers/spi/spi-mxs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 1bf080339b5a..88cbe4f00cc3 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -39,6 +39,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/mxs-spi.h>
 #include <trace/events/spi.h>
+#include <linux/dma/mxs-dma.h>
 
 #define DRIVER_NAME		"mxs-spi"
 
@@ -252,7 +253,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi,
 		desc = dmaengine_prep_slave_sg(ssp->dmach,
 				&dma_xfer[sg_count].sg, 1,
 				(flags & TXRX_WRITE) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
-				DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+				DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END);
 
 		if (!desc) {
 			dev_err(ssp->dev,
-- 
2.20.1

-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-02 11:53 [PATCH v2 1/1] spi-mxs: Fix chipselect glitch Ralf Schlatterbeck
@ 2024-02-13 17:06 ` Ralf Schlatterbeck
  2024-02-13 17:22   ` Fabio Estevam
  2024-02-13 17:49   ` Mark Brown
  2024-02-13 18:44 ` Mark Brown
  1 sibling, 2 replies; 8+ messages in thread
From: Ralf Schlatterbeck @ 2024-02-13 17:06 UTC (permalink / raw)
  To: Mark Brown, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, linux-spi, linux-arm-kernel,
	linux-kernel

On Fri, Feb 02, 2024 at 12:53:30PM +0100, Ralf Schlatterbeck wrote:
> There was a change in the mxs-dma engine that uses a new custom flag.
> The change was not applied to the mxs spi driver.
> This results in chipselect being deasserted too early.
> This fixes the chipselect problem by using the new flag in the mxs-spi
> driver.
> 
> Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag")
> Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com>
> ---
> For oscilloscope screenshots and a verbose explanation see my blog post
> at https://blog.runtux.com/posts/2024/02/01/
> History:
> Omit the line break change from patch requested by Marc Kleine-Budde
> <mkl@pengutronix.de>
> 
>  drivers/spi/spi-mxs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
> index 1bf080339b5a..88cbe4f00cc3 100644
> --- a/drivers/spi/spi-mxs.c
> +++ b/drivers/spi/spi-mxs.c
> @@ -39,6 +39,7 @@
>  #include <linux/spi/spi.h>
>  #include <linux/spi/mxs-spi.h>
>  #include <trace/events/spi.h>
> +#include <linux/dma/mxs-dma.h>
>  
>  #define DRIVER_NAME		"mxs-spi"
>  
> @@ -252,7 +253,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi,
>  		desc = dmaengine_prep_slave_sg(ssp->dmach,
>  				&dma_xfer[sg_count].sg, 1,
>  				(flags & TXRX_WRITE) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
> -				DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +				DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END);
>  
>  		if (!desc) {
>  			dev_err(ssp->dev,
> -- 
> 2.20.1
> 
> -- 
> Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
> Open Source Consulting                  www:   www.runtux.com
> Reichergasse 131, A-3411 Weidling       email: office@runtux.com

Any news on this, will it be picked up for the next merge window?

Thanks + kind regards
Ralf Schlatterbeck
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-13 17:06 ` Ralf Schlatterbeck
@ 2024-02-13 17:22   ` Fabio Estevam
  2024-02-13 20:02     ` Ralf Schlatterbeck
  2024-02-13 17:49   ` Mark Brown
  1 sibling, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2024-02-13 17:22 UTC (permalink / raw)
  To: Ralf Schlatterbeck
  Cc: Mark Brown, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel

Hi Ralf,

On Tue, Feb 13, 2024 at 2:07 PM Ralf Schlatterbeck <rsc@runtux.com> wrote:
>
> On Fri, Feb 02, 2024 at 12:53:30PM +0100, Ralf Schlatterbeck wrote:
> > There was a change in the mxs-dma engine that uses a new custom flag.
> > The change was not applied to the mxs spi driver.
> > This results in chipselect being deasserted too early.
> > This fixes the chipselect problem by using the new flag in the mxs-spi
> > driver.
> >
> > Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag")
> > Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com>
> > ---
> > For oscilloscope screenshots and a verbose explanation see my blog post
> > at https://blog.runtux.com/posts/2024/02/01/

I suggest putting the link to your detailed explanation into the
commit log as this is useful information.

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-13 17:06 ` Ralf Schlatterbeck
  2024-02-13 17:22   ` Fabio Estevam
@ 2024-02-13 17:49   ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2024-02-13 17:49 UTC (permalink / raw)
  To: Ralf Schlatterbeck
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Tue, Feb 13, 2024 at 06:06:57PM +0100, Ralf Schlatterbeck wrote:
> On Fri, Feb 02, 2024 at 12:53:30PM +0100, Ralf Schlatterbeck wrote:

> > -- 
> > Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
> > Open Source Consulting                  www:   www.runtux.com
> > Reichergasse 131, A-3411 Weidling       email: office@runtux.com

> Any news on this, will it be picked up for the next merge window?

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.

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

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-02 11:53 [PATCH v2 1/1] spi-mxs: Fix chipselect glitch Ralf Schlatterbeck
  2024-02-13 17:06 ` Ralf Schlatterbeck
@ 2024-02-13 18:44 ` Mark Brown
  2024-02-13 20:02   ` Ralf Schlatterbeck
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2024-02-13 18:44 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel,
	Ralf Schlatterbeck

On Fri, 02 Feb 2024 12:53:30 +0100, Ralf Schlatterbeck wrote:
> There was a change in the mxs-dma engine that uses a new custom flag.
> The change was not applied to the mxs spi driver.
> This results in chipselect being deasserted too early.
> This fixes the chipselect problem by using the new flag in the mxs-spi
> driver.
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi-mxs: Fix chipselect glitch
      commit: 269e31aecdd0b70f53a05def79480f15cbcc0fd6

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


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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-13 17:22   ` Fabio Estevam
@ 2024-02-13 20:02     ` Ralf Schlatterbeck
  2024-02-13 20:04       ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Schlatterbeck @ 2024-02-13 20:02 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Mark Brown, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel

On Tue, Feb 13, 2024 at 02:22:53PM -0300, Fabio Estevam wrote:
> 
> On Tue, Feb 13, 2024 at 2:07 PM Ralf Schlatterbeck <rsc@runtux.com> wrote:
> > > ---
> > > For oscilloscope screenshots and a verbose explanation see my blog post
> > > at https://blog.runtux.com/posts/2024/02/01/
> 
> I suggest putting the link to your detailed explanation into the
> commit log as this is useful information.
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

Thanks for the review!

My blog post might go away at some point.
And I think when looking at the original patch (in the Fixes: line) it
is quite obvious that the file in question was overlooked during the
original change. So it was hard to find and I documented it but looking
at it in context should be pretty clear.

Thanks
Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-13 18:44 ` Mark Brown
@ 2024-02-13 20:02   ` Ralf Schlatterbeck
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Schlatterbeck @ 2024-02-13 20:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel

On Tue, Feb 13, 2024 at 06:44:58PM +0000, Mark Brown wrote:
> Applied to
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
> 
> Thanks!

Thanks!
Sorry for my impatience.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com

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

* Re: [PATCH v2 1/1] spi-mxs: Fix chipselect glitch
  2024-02-13 20:02     ` Ralf Schlatterbeck
@ 2024-02-13 20:04       ` Fabio Estevam
  0 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-02-13 20:04 UTC (permalink / raw)
  To: Ralf Schlatterbeck
  Cc: Mark Brown, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-spi, linux-arm-kernel, linux-kernel

On Tue, Feb 13, 2024 at 5:02 PM Ralf Schlatterbeck <rsc@runtux.com> wrote:

> My blog post might go away at some point.
> And I think when looking at the original patch (in the Fixes: line) it
> is quite obvious that the file in question was overlooked during the
> original change. So it was hard to find and I documented it but looking
> at it in context should be pretty clear.

Yes, that's fine. Mark has already applied it, so we are all good.

Thanks for the fix.

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

end of thread, other threads:[~2024-02-13 20:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 11:53 [PATCH v2 1/1] spi-mxs: Fix chipselect glitch Ralf Schlatterbeck
2024-02-13 17:06 ` Ralf Schlatterbeck
2024-02-13 17:22   ` Fabio Estevam
2024-02-13 20:02     ` Ralf Schlatterbeck
2024-02-13 20:04       ` Fabio Estevam
2024-02-13 17:49   ` Mark Brown
2024-02-13 18:44 ` Mark Brown
2024-02-13 20:02   ` Ralf Schlatterbeck

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).