All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Tim Michals <tcmichals-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: [PATCH 2/2] i2c: mxs: Do not disable the I2C SMBus quick mode
Date: Mon, 19 Nov 2012 16:19:59 +0100	[thread overview]
Message-ID: <201211191619.59877.marex@denx.de> (raw)
In-Reply-To: <CANqk_c-3t2Kn3cQjwzoSzMrKMD-W_0JByD4U=Bp_ZA3_seyuig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Dear Tim Michals,

> Mr. Marek Vasut,

Ugh, I feel so old ;-D

[...]

> diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
> index 286ca19..0670da7 100644
> --- a/drivers/i2c/busses/i2c-mxs.c
> +++ b/drivers/i2c/busses/i2c-mxs.c
> @@ -287,12 +287,14 @@ read_init_dma_fail:
>  select_init_dma_fail:
>         dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE);
>  select_init_pio_fail:
> +       dmaengine_terminate_all(i2c->dmach);
>         return -EINVAL;
> 
>  /* Write failpath. */
>  write_init_dma_fail:
>         dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE);
>  write_init_pio_fail:
> +       dmaengine_terminate_all(i2c->dmach);
>         return -EINVAL;
>  }
> 
> I tested both patches using Linux version 3.7.0-rc4 with the following
> command:

Did you test it on mx28 or on mx23? I tested it on mx28 with i2cdetect -y 0 and 
it worked.

> #  i2cdetect -r 0 20 30
[...]

Attaching my results on MX28 (and note, I also attach dmesg and I re-ran the 
test to proove it's replicable -- aka. the DMA engine doesn't stall).

~ # /i2cdetect.static -r 0 20 30
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x14-0x1e.
Continue? [Y/n] 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                                                 
10:             -- -- -- -- -- -- -- -- -- -- --    
20:                                                 
30:                                                 
40:                                                 
50:                                                 
60:                                                 
70:                                                 
~ # dmesg | tail -n 12
[    6.960000] Freeing init memory: 1348K
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
[   29.500000] mxs-dma 80024000.dma-apbx: mxs_dma_int_handler: error in channel 
6
~ # /i2cdetect.static -r 0 20 30
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x14-0x1e.
Continue? [Y/n] 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                                                 
10:             -- -- -- -- -- -- -- -- -- -- --    
20:                                                 
30:                                                 
40:                                                 
50:                                                 
60:                                                 
70:

Best regards,
Marek Vasut

  parent reply	other threads:[~2012-11-19 15:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-18  5:25 [PATCH 1/2] i2c: mxs: Handle i2c DMA failure properly Marek Vasut
     [not found] ` <1353216308-7338-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-11-18  5:25   ` [PATCH 2/2] i2c: mxs: Do not disable the I2C SMBus quick mode Marek Vasut
     [not found]     ` <CANqk_c-3t2Kn3cQjwzoSzMrKMD-W_0JByD4U=Bp_ZA3_seyuig@mail.gmail.com>
     [not found]       ` <CANqk_c-3t2Kn3cQjwzoSzMrKMD-W_0JByD4U=Bp_ZA3_seyuig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 15:19         ` Marek Vasut [this message]
     [not found]           ` <CANqk_c92YYzCKjT7ehfXpmGhJC8p0BDSNoW3vC71J9q89=XUaQ@mail.gmail.com>
     [not found]             ` <CANqk_c92YYzCKjT7ehfXpmGhJC8p0BDSNoW3vC71J9q89=XUaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 18:13               ` Marek Vasut
     [not found]                 ` <CANqk_c9xk6mtiA5NpvoLy3bSdKPhF7yAUWfe_rRefZLMeOeHNQ@mail.gmail.com>
     [not found]                   ` <CANqk_c9xk6mtiA5NpvoLy3bSdKPhF7yAUWfe_rRefZLMeOeHNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 20:02                     ` Marek Vasut
2012-11-20 11:36         ` Fabio Estevam
     [not found]     ` <1353216308-7338-2-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-11-22 22:05       ` Wolfram Sang
2012-11-19  9:25   ` [PATCH 1/2] i2c: mxs: Handle i2c DMA failure properly Wolfram Sang
     [not found]     ` <20121119092531.GE7775-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-19 14:00       ` Marek Vasut
     [not found]         ` <201211191500.32205.marex-ynQEQJNshbs@public.gmane.org>
2012-11-20  8:39           ` Wolfram Sang
     [not found]             ` <20121120083946.GB14722-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-20  8:47               ` Marek Vasut
     [not found]                 ` <201211200947.36430.marex-ynQEQJNshbs@public.gmane.org>
2012-11-20  8:54                   ` Wolfram Sang
2012-11-22 22:04   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201211191619.59877.marex@denx.de \
    --to=marex-ynqeqjnshbs@public.gmane.org \
    --cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tcmichals-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.