[SOLVED] i2c problems after kernel upgrade

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

[SOLVED] i2c problems after kernel upgrade

Postby eduardfaber » Sun Mar 12, 2017 6:57 pm

after upgrading my kernel form version 4.8.14-2 to version 4.10.1-1 I noticed I2C problems.
dmesg gave several messages as:

$this->bbcode_second_pass_code('', '
at91_i2c f8010000.i2c: controller timed out
')

during accessing the I2C-device. (temperature/humidity sensor)
Try-ing kernel 4.9.5-1 gave the same not working result.
Degrading the kernel to 4.8.14-2 solved the problem.

Who can give some help?
Its about an Arriete G25.

Ed Faber
Last edited by eduardfaber on Wed Jun 07, 2017 8:43 pm, edited 1 time in total.
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands

Re: i2c problems after kernel upgrade

Postby eduardfaber » Thu Apr 20, 2017 8:37 pm

In the previous post I gave some misleading information. The kernel 4.9.5-1 is working as expected regarding the I2C.
The problem is introduced at kernel 4.10.x. As you can see in the section below 4.9.11 is working well:
$this->bbcode_second_pass_code('', '
Arch Linux 4.9.11-1-ARCH (ttyS0)

Ariette_G25-128Mb login: root
Password:
Last login: Tue Mar 28 22:52:21 on ttyS0
[root@Ariette_G25-128Mb ~]# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
....
')
Already in the first 4.10 kernel there is something changed:

$this->bbcode_second_pass_code('', '
Linux Ariette_G25-128Mb 4.10.0-1-ARCH #1 Sun Feb 19 20:37:34 MST 2017 armv5tejl GNU/Linux
[root@Ariette_G25-128Mb ~]# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: [ 175.550000] at91_i2c f8010000.i2c: controller timed out
-- [ 175.670000] at91_i2c f8010000.i2c: controller timed out
-- [ 175.790000] at91_i2c f8010000.i2c: controller timed out
')

The more recent kernel 4.10.10 hes the same issue.
Who can help???
As soon as I have some more time I will try a i2c device on an Olinuxino.
Ed Faber
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands

Re: i2c problems after kernel upgrade

Postby eduardfaber » Fri Apr 28, 2017 12:52 pm

Still no solution. A small experiment showed that al least kernel
$this->bbcode_second_pass_code('', '
[root@RFM69_sender arietta_weather]# uname -a
Linux RFM69_sender 4.10.12-1-ARCH #1 Fri Apr 21 19:31:46 MDT 2017 armv5tejl GNU/Linux
')
is working on an iMX233-OLinuXino-MAXI:

$this->bbcode_second_pass_code('', '
[root@RFM69_sender arietta_weather]# ./lm75a
temperatuur: 22.0.
')
It is giving the right temperature on a lm75.

So it seems to be an architecture problem.
Can somebody explain what is changed recently regarding the implementation of I2C ???
Ed Faber
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands

Re: i2c problems after kernel upgrade

Postby eduardfaber » Sun May 14, 2017 7:19 pm

Yesterday I builded a 4.10.1 kernel, where the i2c was also not working. It is strange that the created config is not givving the used version was expecting 4.10.12-1 instead of 4.10.4-1, but thats an another issue:

$this->bbcode_second_pass_code('', '
Linux solartracker 4.10.12-1-ARCH #1 Fri Apr 21 19:31:46 MDT 2017 armv5tejl GNU/Linux
[root@solartracker ~]# cat /proc/config.gz |gunzip -dc|head
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.10.4-1 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_STACKTRACE_SUPPORT=y
[root@solartracker ~]#

')
I used the original configuration and tested it. I made some changes. I made i2c-at91.ko.gz and i2c-dev.ko.gz a module.
I removed 2 wm8731 items and an other gpio thing to get rid of 3 messages looping every minute (or any time).

Here is the result:

$this->bbcode_second_pass_code('', '
[ 395.490000] at91_i2c f8010000.i2c: using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
[ 395.500000] wm8731 0-001b: Assuming static MCLK
[ 395.500000] 0-001b supply AVDD not found, using dummy regulator
[ 395.510000] 0-001b supply HPVDD not found, using dummy regulator
[ 395.510000] 0-001b supply DCVDD not found, using dummy regulator
[ 395.520000] 0-001b supply DBVDD not found, using dummy regulator
[ 395.580000] wm8731 0-001b: Failed to issue reset: -121
[ 395.590000] wm8731: probe of 0-001b failed with error -121
[ 395.590000] at91_i2c f8010000.i2c: AT91 i2c bus driver (hw version: 0x402).
[ 395.600000] at91_i2c f8014000.i2c: using dma1chan4 (tx) and dma1chan5 (rx) for DMA transfers
[ 395.610000] at91_i2c f8014000.i2c: AT91 i2c bus driver (hw version: 0x402).
[root@Ariette_G25_test ~]# insmod i2c-dev.ko.gz
[ 427.790000] i2c /dev entries driver
[root@Ariette_G25_test ~]# ./lm75a
temperatuur: 22.5.
[root@Ariette_G25_test ~]# uname -a
Linux Ariette_G25_test 4.10.1-ARCH #1 Sat May 13 20:36:48 CEST 2017 armv5tejl GNU/Linux
[root@Ariette_G25_test ~]#
')

It works like this. The question is now: whats the reason????
to be continued.
Ed Faber
Last edited by eduardfaber on Wed Jun 07, 2017 8:26 pm, edited 1 time in total.
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands

Re: i2c problems after kernel upgrade

Postby eduardfaber » Tue Jun 06, 2017 6:34 am

As overview:
- the newest kernel 4.11.3 is still not working.
- the i2c code is not significantly changed, since 4.9.x
- the dbs part is not the reason.
- If at91-i2c is build as a module, the problem is gone. The module is automaticly loaded.
- Is this a timing issue or are some gpio lines rudly claimed so i2c can not use them?

Any knowledge some where?
Any arietta users?

Ed
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands

Re: i2c problems after kernel upgrade

Postby eduardfaber » Wed Jun 07, 2017 8:21 pm

Kevin Mihelich made a change:
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 4.11.0-rc5-1 Kernel Configuration
+# Linux/arm 4.11.3-2 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
@@ -2386,7 +2386,7 @@ CONFIG_I2C_ALGOBIT=y
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
-CONFIG_I2C_AT91=y
+CONFIG_I2C_AT91=m

Now it works again.
Thanks Kevin!
eduardfaber
 
Posts: 25
Joined: Mon Jan 04, 2016 11:38 pm
Location: Netherlands


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 4 guests