public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* i2c-mxs woes
@ 2013-04-19 11:37 Alexandre Belloni
       [not found] ` <51712C8B.7070302-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Belloni @ 2013-04-19 11:37 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: l.stach-bIcnvbaLZ9MEGnE8C9+IrQ, wsa-z923LK4zBo2bacvFa/9K2g,
	Marek Vasut, Maxime Ripard

Hi,

I'm having some issues with the i2c-mxs driver in 3.9. Marek already
pointed me to the patches from Lucas and that greatly improved the
situation.

For the context, my board has three nau7802 adcs, connected to a gpio
i2c-muxer, connected to i2c1.

Here is what I observe:

On 3.9:

# time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw 
2620
real	0m 7.08s
user	0m 0.00s
sys	0m 0.02s
# time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw 
2623
real	0m 6.07s
user	0m 0.01s
sys	0m 0.01s
# 



On 3.9 but using i2c-gpio to bitbang on the bus:

# time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw 
2661
real	0m 0.08s
user	0m 0.00s
sys	0m 0.06s
# time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw 
2270
real	0m 0.08s
user	0m 0.00s
sys	0m 0.05s
#



On 3.7, i2c-mxs:

# time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw
2643
real    0m 0.06s
user    0m 0.01s
sys    0m 0.02s
# time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw
1546
real    0m 0.05s
user    0m 0.00s
sys    0m 0.02s
#

Any input would be appreciated.

Regards,

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: i2c-mxs woes
       [not found] ` <51712C8B.7070302-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2013-04-19 11:49   ` Marek Vasut
       [not found]     ` <201304191349.05971.marex-ynQEQJNshbs@public.gmane.org>
  2013-04-19 11:53   ` Lucas Stach
  1 sibling, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-04-19 11:49 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, l.stach-bIcnvbaLZ9MEGnE8C9+IrQ,
	wsa-z923LK4zBo2bacvFa/9K2g, Maxime Ripard

Dear Alexandre Belloni,

> Hi,
> 
> I'm having some issues with the i2c-mxs driver in 3.9. Marek already
> pointed me to the patches from Lucas and that greatly improved the
> situation.
> 
> For the context, my board has three nau7802 adcs, connected to a gpio
> i2c-muxer, connected to i2c1.
> 
> Here is what I observe:
> 
> On 3.9:
> 
> # time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw
> 2620
> real	0m 7.08s
> user	0m 0.00s
> sys	0m 0.02s
> # time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw
> 2623
> real	0m 6.07s
> user	0m 0.01s
> sys	0m 0.01s
> #

Looks like there's a fixes 7-second delay. Like a timeout maybe?

Best regards,
Marek Vasut

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

* Re: i2c-mxs woes
       [not found] ` <51712C8B.7070302-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  2013-04-19 11:49   ` Marek Vasut
@ 2013-04-19 11:53   ` Lucas Stach
       [not found]     ` <1366372407.4146.3.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Lucas Stach @ 2013-04-19 11:53 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	Marek Vasut, Maxime Ripard

Hi Alexandre,

Am Freitag, den 19.04.2013, 13:37 +0200 schrieb Alexandre Belloni:
> Hi,
> 
> I'm having some issues with the i2c-mxs driver in 3.9. Marek already
> pointed me to the patches from Lucas and that greatly improved the
> situation.
> 
> For the context, my board has three nau7802 adcs, connected to a gpio
> i2c-muxer, connected to i2c1.
> 
> Here is what I observe:
> 
> On 3.9:
> 
> # time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw 
> 2620
> real	0m 7.08s
> user	0m 0.00s
> sys	0m 0.02s
> # time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw 
> 2623
> real	0m 6.07s
> user	0m 0.01s
> sys	0m 0.01s
> # 
> 
Is this with or without my patches? Before introduction of the error
handling in PIO code there were a lot of situations where the controller
would signal an error, but the driver would go on as usual, so the next
transaction wouldn't succeed and stop for a whole second until the
timeout hits and resets the controller.

Regards,
Lucas
-- 
Pengutronix e.K.                           | Lucas Stach                 |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: i2c-mxs woes
       [not found]     ` <201304191349.05971.marex-ynQEQJNshbs@public.gmane.org>
@ 2013-04-19 12:05       ` Alexandre Belloni
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2013-04-19 12:05 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, l.stach-bIcnvbaLZ9MEGnE8C9+IrQ,
	wsa-z923LK4zBo2bacvFa/9K2g, Maxime Ripard

On 19/04/2013 13:49, Marek Vasut wrote:
> Looks like there's a fixes 7-second delay. Like a timeout maybe?

Yeah, probably, I'm reading 6 times 3 registers of the ADC

BTW, the code is there:
https://github.com/crystalfontz/cfa_10036_kernel/blob/cfa-3.9-12-10049-i2c-adc/drivers/iio/adc/nau7802.c

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: i2c-mxs woes
       [not found]     ` <1366372407.4146.3.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
@ 2013-04-19 12:07       ` Alexandre Belloni
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2013-04-19 12:07 UTC (permalink / raw)
  To: Lucas Stach
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	Marek Vasut, Maxime Ripard

Hi Lucas,

On 19/04/2013 13:53, Lucas Stach wrote:
> Hi Alexandre,
>
> Am Freitag, den 19.04.2013, 13:37 +0200 schrieb Alexandre Belloni:
>> Hi,
>>
>> I'm having some issues with the i2c-mxs driver in 3.9. Marek already
>> pointed me to the patches from Lucas and that greatly improved the
>> situation.
>>
>> For the context, my board has three nau7802 adcs, connected to a gpio
>> i2c-muxer, connected to i2c1.
>>
>> Here is what I observe:
>>
>> On 3.9:
>>
>> # time cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw 
>> 2620
>> real	0m 7.08s
>> user	0m 0.00s
>> sys	0m 0.02s
>> # time cat /sys/bus/iio/devices/iio:device1/in_voltage1_raw 
>> 2623
>> real	0m 6.07s
>> user	0m 0.01s
>> sys	0m 0.01s
>> # 
>>
> Is this with or without my patches? Before introduction of the error
> handling in PIO code there were a lot of situations where the controller
> would signal an error, but the driver would go on as usual, so the next
> transaction wouldn't succeed and stop for a whole second until the
> timeout hits and resets the controller.

This is with v2 of your patches. I applied "i2c-mxs remove races in PIO
code" and "i2c-mxs do error checking and handling in PIO mode"

Regards,

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2013-04-19 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 11:37 i2c-mxs woes Alexandre Belloni
     [not found] ` <51712C8B.7070302-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-04-19 11:49   ` Marek Vasut
     [not found]     ` <201304191349.05971.marex-ynQEQJNshbs@public.gmane.org>
2013-04-19 12:05       ` Alexandre Belloni
2013-04-19 11:53   ` Lucas Stach
     [not found]     ` <1366372407.4146.3.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2013-04-19 12:07       ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox