2009-06-26 00:05:45     I2c sm_bus operation crash

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-06-26 00:05:45     I2c sm_bus operation crash

everest zhang (CHINA)

Message: 76348   

 

Hi ,

 

    Recently we ported 2008R1 kernel to our product, I found two issues as following:

 

   1. Our product based on BF561 platform, we use GPIO-I2C to control keypad IC pca9539, once key interrupt pin was detected valid, I use i2c_smbus_write_byte_data and i2c_smbus_read_byte_data function to write and read pca9539 to get pressed key value.  The same operation is OK on 2006R1 release, but will crash frequently on 2008R1 release, error printed as following:

 

BUG: scheduling while atomic: swapper/0x04010100/0

Hardware Trace:

   0 Target : <0x0010366c> /* unknown address */

     Source : <0x0023b5e0> /* unknown address */

   1 Target : <0x0023b5dc> /* unknown address */

     Source : <0x0010b8b2> /* unknown address */

   2 Target : <0x0010b8ae> /* unknown address */

     Source : <0x0010b89a> /* unknown address */

   3 Target : <0x0010b88e> /* unknown address */

     Source : <0x0010b858> /* unknown address */

   4 Target : <0x0010b852> /* unknown address */

     Source : <0x0010b170> /* unknown address */

   5 Target : <0x0010b16c> /* unknown address */

     Source : <0x0010b15e> /* unknown address */

   6 Target : <0x0010b140> /* unknown address */

     Source : <0x0010b362> /* unknown address */

   7 Target : <0x0010b358> /* unknown address */

     Source : <0x0010b34a> /* unknown address */

   8 Target : <0x0010b346> /* unknown address */

     Source : <0x0010b33e> /* unknown address */

   9 Target : <0x0010b33c> /* unknown address */

     Source : <0x0010b32e> /* unknown address */

  10 Target : <0x0010b308> /* unknown address */

     Source : <0x0010b208> /* unknown address */

  11 Target : <0x0010b1d6> /* unknown address */

     Source : <0x0010b2f4> /* unknown address */

  12 Target : <0x0010b2ec> /* unknown address */

     Source : <0x0010b04a> /* unknown address */

  13 Target : <0x0010b044> /* unknown address */

     Source : <0x0010b00e> /* unknown address */

  14 Target : <0x0010affe> /* unknown address */

     Source : <0x0010afee> /* unknown address */

  15 Target : <0x0010afd8> /* unknown address */

     Source : <0x0010b2e8> /* unknown address */

Stack from 00285a3c:

        00000000 0023b5e4 00284000 00108a10 00000000 002863f4 04010100 00000000

        00000000 00000000 00000000 00285a98 00108a10 00284000 00286c98 00000000

        04000000 00000048 00000048 00000003 00000000 00000000 00000000 00285ab4

        0023c1c4 00546ba0 00014335 00000000 00000000 ffa01434 00285b44 001df688

        02002040 0023d33c 00000000 001df730 00546ba0 00000006 02002040 0023d33c

        00000000 001dfce0 00546ba0 002dc674 00000000 ffffffff ffa01434 ffa01432

 

Call Trace:

[<001dfe78>][<001dd80a>][<001ddbce>][<001ddbce>][<00100001>][<001ddd70>][<001df6ac>][<001e406e>][<0011fcaa>][<001e41c0>][<001e423a>][<0011f9b8>][<00120ae6>][<00232eac>][<001073ba>][<00103c10>][<001ddbce>][<001089ba>][<001089ba>][<001089ba>][<00108960>][<0011b49a>][<0011b484>][<0011b696>][<0011b484>][<0011b6a6>][<00111694>][<0011f9b8>][<00120a7e>][<0010eeda>][<00103c10>][<00103c46>][<00100a90>][<00100aa4>][<00100aa4>][<00100a90>][<002b69a4>][<002b6350>][<002b61a6>]<5>

 

          2. The second question is that the initialized value for global array or variables will be lost, we should initiate them  again on the body of function. I think it maybe toolchain's config problem.

 

          Anyone can give some hint? thanks firstly.

QuoteReplyEditDelete

 

 

2009-06-26 00:21:52     Re: I2c sm_bus operation crash

Mike Frysinger (UNITED STATES)

Message: 76349   

 

your trace is completely useless without symbols.  either you need to enable kallsyms like the default and post the updated trace, or post a trace with the symbols decoded using your System.map.

 

the information you provided for (2) is too little to even guess at.  global initializers are placed into the .data section and we've never seen a problem with them.

 

porting to 2008R1 seems like a bad idea when 2008R1.5 already exists.  it's pointless to port to an already out-of-date version.

QuoteReplyEditDelete

 

 

2009-06-26 00:50:41     Re: I2c sm_bus operation crash

everest zhang (CHINA)

Message: 76350   

 

Hi Mike,

 

     Thank for your reply, because I always developed on 2006R1 release, so i don't know how to enable kallsysms like default,  and I was gloomy that why my code can't see the hw trace information recently.Could you tell me the steps?  and I think I know the reason of the question of global initialized value lost, thank for you hint.

QuoteReplyEditDelete

 

 

2009-06-26 01:11:33     Re: I2c sm_bus operation crash

Mike Frysinger (UNITED STATES)

Message: 76356   

 

kallsyms is under the general setup options in the kernel configuration menu

 

if you cant find it, then use the search function.  simply hit "/" to start a search.

QuoteReplyEditDelete

 

 

2009-06-28 23:12:51     Re: I2c sm_bus operation crash

everest zhang (CHINA)

Message: 76439   

 

Hi Mike,

 

        I have enabled the debug information by your hint, the print error infor as following, would you please help me find the error, thank you.

 

BUG: scheduling while atomic: stamp/0x04000100/679

Hardware Trace:

   0 Target : <0x001036f8> { _dump_stack + 0x0 }

     Source : <0x002410d8> { ___sched_text_start + 0x50 }

   1 Target : <0x002410d4> { ___sched_text_start + 0x4c }

     Source : <0x0010ba06> { _printk + 0x16 }

   2 Target : <0x0010ba02> { _printk + 0x12 }

     Source : <0x0010b9ee> { _vprintk + 0x2d2 }

   3 Target : <0x0010b9e2> { _vprintk + 0x2c6 }

     Source : <0x0010b9ba> { _vprintk + 0x29e }

   4 Target : <0x0010b9a6> { _vprintk + 0x28a }

     Source : <0x0010b2c4> { _wake_up_klogd + 0x30 }

   5 Target : <0x0010b2c0> { _wake_up_klogd + 0x2c }

     Source : <0x0010b2b2> { _wake_up_klogd + 0x1e }

   6 Target : <0x0010b294> { _wake_up_klogd + 0x0 }

     Source : <0x0010b4b6> { _release_console_sem + 0x1ee }

   7 Target : <0x0010b4ac> { _release_console_sem + 0x1e4 }

     Source : <0x0010b49e> { _release_console_sem + 0x1d6 }

   8 Target : <0x0010b49a> { _release_console_sem + 0x1d2 }

     Source : <0x0010b492> { _release_console_sem + 0x1ca }

   9 Target : <0x0010b490> { _release_console_sem + 0x1c8 }

     Source : <0x0010b482> { _release_console_sem + 0x1ba }

  10 Target : <0x0010b45c> { _release_console_sem + 0x194 }

     Source : <0x0010b35c> { _release_console_sem + 0x94 }

  11 Target : <0x0010b32a> { _release_console_sem + 0x62 }

     Source : <0x0010b448> { _release_console_sem + 0x180 }

  12 Target : <0x0010b440> { _release_console_sem + 0x178 }

     Source : <0x0010b19e> { __call_console_drivers + 0x72 }

  13 Target : <0x0010b198> { __call_console_drivers + 0x6c }

     Source : <0x0010b162> { __call_console_drivers + 0x36 }

  14 Target : <0x0010b152> { __call_console_drivers + 0x26 }

     Source : <0x0010b142> { __call_console_drivers + 0x16 }

  15 Target : <0x0010b12c> { __call_console_drivers + 0x0 }

     Source : <0x0010b43c> { _release_console_sem + 0x174 }

Stack from 007c3c44:

        00000003 002410dc 007c2000 00108aac 00000001 04a4cbcc 04000100 000002a7

        00000002 127a3980 04a4cb50 007c3ca0 00108aac 007c2000 002a8cac 00000000

        04000000 00000048 00000048 00000003 00107df4 002f8e6c 00532560 007c3cbc

        00241cbc 04a57b00 ffff92d4 00000511 001e5260 002ddfc1 007c3d4c 001e523c

        00000001 0000039f 007c3cf8 001e52e4 04a57b00 00000007 00532560 002ddfc1

        002ddfc1 001e5894 04a57b00 00303f74 00000000 ffffffff 002ddfc1 002ddfb4

 

Call Trace:

[<001e5a2c>] _bit_xfer+0x138/0x374

[<001e33be>] _i2c_transfer+0x2e/0x40

[<00106654>] _timer_timeout+0x4c/0x54

[<001e3782>] _i2c_smbus_xfer+0x316/0x3e8

[<00122c88>] _handle_IRQ_event+0x28/0x5c

[<0010f06a>] ___do_softirq+0x4e/0xac

[<001e94e2>] _KeyPadRead+0x1e/0x3c

[<00107df4>] ___activate_task+0x1c/0x34

[<00108a60>] _default_wake_function+0x0/0x10

[<00107df4>] ___activate_task+0x1c/0x34

[<00100001>] _run_init_process+0x1/0x18

[<00110001>] _proc_doulongvec_minmax+0x1d/0x20

[<001e3924>] _i2c_smbus_read_byte_data+0x28/0x40

[<00107b62>] ___wake_up_common+0x2a/0x48

[<00107fc6>] _task_running_tick+0x146/0x21c

[<00107ba0>] ___wake_up+0x20/0x40

[<00106608>] _timer_timeout+0x0/0x54

[<001e9d9e>] _ReadkeyInterface+0x12/0x24

[<001c02ac>] _bfin_serial_rx_dma_timeout+0x0/0x208

[<001118e6>] _run_timer_softirq+0xe6/0x140

[<001118e6>] _run_timer_softirq+0xe6/0x140

[<00122c88>] _handle_IRQ_event+0x28/0x5c

[<0010f06a>] ___do_softirq+0x4e/0xac

[<00103cd2>] _asm_do_IRQ+0x6a/0x7c

[<001313e8>] _sys_read+0x0/0x54

[<002ddfc1>] _bfin_init_mmr_debugfs+0x44d/0x5e04

[<002ddfb4>] _bfin_init_mmr_debugfs+0x440/0x5e04

 

 

          In addition, on the problem of initialized globle variable, I found only the globle variables allocated to L2_DATA can't be initialized successfully.

QuoteReplyEditDelete

 

 

2009-06-29 01:53:29     Re: I2c sm_bus operation crash

Mike Frysinger (UNITED STATES)

Message: 76442   

 

there is no such thing as "L2_DATA".  that is something you made up so i cant tell you anything about it.

 

L2 was not supported in 2008R1.5 and older which means it is up to *you* to make sure things are relocated/initialized/etc... properly.

QuoteReplyEditDelete

 

 

2009-06-29 05:04:27     Re: I2c sm_bus operation crash

everest zhang (CHINA)

Message: 76458   

 

I'm sorry L2_DATA is my own define, the actual meaning is section(".l2.data") , If the global variables allocated in the section of l2.data, all the initialized value are 0, even if you have set the other initialized value when define the variables. you must set the hopeful value again in the body of function. I want to know why. thanks.

QuoteReplyEditDelete

 

 

2009-06-29 06:24:30     Re: I2c sm_bus operation crash

Sonic Zhang (CHINA)

Message: 76460   

 

Could you try the i2c-bfin-twi.c on SVN 2008R1 branch head? There is some bug fixing since 2008R1 is released.

QuoteReplyEditDelete

 

 

2009-06-29 11:06:53     Re: I2c sm_bus operation crash

everest zhang (CHINA)

Message: 76468   

 

Hi Sonic,

 

      My project based on BF561 platform, so I only have to use i2c-gpio device drvier. My problem is that when I use kernel timer to scan keypad based on I2C interface(pca9539) periodically, I use i2c_smbus_write_byte_data and i2c_smbus_read_byte_data function to write and read pca9539 to get pressed key value, system will crash frequently. Could you give some hint?

QuoteReplyEditDelete

 

 

2009-06-29 12:13:06     Re: I2c sm_bus operation crash

Mike Frysinger (UNITED STATES)

Message: 76473   

 

like i said, L2 handling is completely up to you with 2008R1.5 and older.  using section names will not change anything at all.

QuoteReplyEditDelete

 

 

2009-06-30 01:40:31     Re: I2c sm_bus operation crash

supriya d (INDIA)

Message: 76488   

 

Hi Mike,

 

In continuation to L2 initialisation topic, is it that L2 is supported in your next releases, 2009R1 on.

 

TIA

QuoteReplyEditDelete

 

 

2009-06-30 01:58:11     Re: I2c sm_bus operation crash

Mike Frysinger (UNITED STATES)

Message: 76489   

 

like the documentation explains, L2 has been supported in for trunk for a while now, and thus it will be in 2009R1

QuoteReplyEditDelete

Attachments

    Outcomes