Quantcast

i2c IRQ crash in omap-3.5 kernel

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

i2c IRQ crash in omap-3.5 kernel

hobbesc7
If I do a write (from userland c code) to an i2c device that's not powered up, the gumstix spins the following message in the console and locks up:

omap_i2c omap_i2c.3: XDR IRQ while no data to send
omap_i2c omap_i2c.3: XDR IRQ while no data to send
omap_i2c omap_i2c.3: XDR IRQ while no data to send
...

Otherwise, i2c is solid, and is working well.

I'm using the omap-3.5 kernel built by the meta-gumstix yocto stuff (linux-sakoman-3.5).

It seems a problem similar to above was fixed in the mainline i2c-omap.c:

http://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/commit/drivers/i2c/busses/i2c-omap.c?id=d60ece5f010043422c5fbc3609714c4420c7c9bf

I tried making the two changes referenced in this mainline commit, but I still get the same crash.

Any suggestions?  Should I move completely to a mainline kernel, which has a lot of updates to i2c-omap which are not in Sakoman's omap-3.5?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: i2c IRQ crash in omap-3.5 kernel

hobbesc7
I should clarify that I meant the tmlind kernel, and not the mainline kernel.

Also, it's not really clear to me that my patch was applied.  I put "my-i2c-omap.patch" in the linux-sakoman-3.5 directory and added "file://my-i2c-omap.patch \" to the linux-sakoman_3.5.bb recipe file.  I then ran "bitbake -c clean virtual/kernel; bitbake virtual/kernel" from my yocto/build directory.  This built OK, but I if I purposely break the patch by renaming it to something else, "bitbake -c clean virtual/kernel; bitbake virtual/kernel" still builds.  So who knows.  Seems it would be easier to just build tmlind or mainline myself outside of the yocto/bitbake stuff.

my-i2c-omap.patch:

diff --git git/drivers/i2c/busses/i2c-omap.c-orig git/drivers/i2c/busses/i2c-omap.c
index 801df60..5deb10b 100644
--- git/drivers/i2c/busses/i2c-omap.c-orig
+++ git/drivers/i2c/busses/i2c-omap.c
@@ -529,6 +529,9 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
  dev->buf = msg->buf;
  dev->buf_len = msg->len;
 
+ /* ADDED */
+ barrier();
+
  omap_i2c_write_reg(dev, OMAP_I2C_CNT_REG, dev->buf_len);
 
  /* Clear the FIFO Buffers */
@@ -584,7 +587,8 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
  */
  r = wait_for_completion_timeout(&dev->cmd_complete,
  OMAP_I2C_TIMEOUT);
- dev->buf_len = 0;
+ //Commented out:
+ //dev->buf_len = 0;
  if (r < 0)
  return r;
  if (r == 0) {
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: i2c IRQ crash in omap-3.5 kernel

hobbesc7
I moved to 3.6, and the problem has gone away.  I'm now using the omap-3.6 branch of the linux-gumstix kernel (I'm using an overo however, and not a duovero which is currently the default preferred machine for this kernel in the current Yocto stuff, so I changed that.)

However, now my onboard SD card isn't recognized.  I flash my images to NAND, and use the onboard SD card as storage only.

I can see the card isn't recognized by the kernel:

root@sbc:~# dmesg | grep mmc
[    4.252960] omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
[    4.259246] omap_hsmmc omap_hsmmc.0: unable to obtain RX DMA engine channel 62
[    4.267364] omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
[    4.273895] omap_hsmmc omap_hsmmc.1: unable to obtain RX DMA engine channel 48

I think my u-boot is fine, because if I switch back to 3.5 while keeping the same u-boot, I get:

root@sbc:~# dmesg | grep mmc
[    4.210906] omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
[    4.588806] omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
[    4.826690] mmc0: host does not support reading read-only switch. assuming write-enable.
[    4.852813] mmc0: new high speed SDHC card at address b368
[    4.875335] mmcblk0: mmc0:b368       7.45 GiB
[    4.882141]  mmcblk0: p1
[    4.933502] mmc1: new SDIO card at address 0001
[   11.912078] libertas_sdio: probe of mmc1:0001:1 failed with error -110

Any ideas?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: i2c IRQ crash in omap-3.5 kernel

Ash Charles
You'd need
CONFIG_DMA_OMAP=y
CONFIG_DMA_ENGINE=y

for this kernel.


On Mon, Apr 8, 2013 at 7:09 AM, hobbesc7 <[hidden email]> wrote:
I moved to 3.6, and the problem has gone away.  I'm now using the omap-3.6
branch of the linux-gumstix kernel (I'm using an overo however, and not a
duovero which is currently the default preferred machine for this kernel in
the current Yocto stuff, so I changed that.)

However, now my onboard SD card isn't recognized.  I flash my images to
NAND, and use the onboard SD card as storage only.

I can see the card isn't recognized by the kernel:

root@sbc:~# dmesg | grep mmc
[    4.252960] omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
[    4.259246] omap_hsmmc omap_hsmmc.0: unable to obtain RX DMA engine
channel 62
[    4.267364] omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
[    4.273895] omap_hsmmc omap_hsmmc.1: unable to obtain RX DMA engine
channel 48

I think my u-boot is fine, because if I switch back to 3.5 while keeping the
same u-boot, I get:

root@sbc:~# dmesg | grep mmc
[    4.210906] omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
[    4.588806] omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
[    4.826690] mmc0: host does not support reading read-only switch.
assuming write-enable.
[    4.852813] mmc0: new high speed SDHC card at address b368
[    4.875335] mmcblk0: mmc0:b368       7.45 GiB
[    4.882141]  mmcblk0: p1
[    4.933502] mmc1: new SDIO card at address 0001
[   11.912078] libertas_sdio: probe of mmc1:0001:1 failed with error -110

Any ideas?



--
View this message in context: http://gumstix.8.n6.nabble.com/i2c-IRQ-crash-in-omap-3-5-kernel-tp4967034p4967118.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: i2c IRQ crash in omap-3.5 kernel

hobbesc7
On Mon, Apr 8, 2013 at 11:45 AM, Ash Charles [via Gumstix] <[hidden email]> wrote:
You'd need
CONFIG_DMA_OMAP=y
CONFIG_DMA_ENGINE=y

for this kernel.

Still doesn't work.  I've also tried adding:

CONFIG_DMADEVICES=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
 
and still no luck.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: i2c IRQ crash in omap-3.5 kernel

hobbesc7
In reply to this post by Ash Charles
Actually, due to a mixup with my Yocto/bitbake setup, I was using the defconfig from meta-sakoman/recipes-kernel/linux/linux-sakoman-3.6/omap3-multi/.  Which looks like a 3.5 defconfig.  The defconfig in /meta-gumstix/recipes-kernel/linux/linux-gumstix-3.6/duovero/ (danny branch) already has the DMA stuff, so I'm trying that now for my 3.6 kernel build.  On bootup I can see now that the DMA channels are there, so that's an improvement, but it panics when booting from NAND, I think because the duovero defconfig is missing CONFIG_MTD_NAND_OMAP2=y.  I've added that, and am trying again.

But is it crazy to use the gumstix omap-3.6 kernel and the duovero defconfig for my overo FE?  I see a number of differences between the above two defconfigs.  The diff is about 800 lines long.  Again, the whole reason I moved to 3.6 was because it seems more stable for my i2c stuff.
Loading...