why mcc_get_bookeeping_data() fail!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

why mcc_get_bookeeping_data() fail!

12,703 Views
renfeiche
Contributor I

Hello Everyone!

I am writting mcc driver, when the mcc_initialize() is called, the following code always return NULL.

bookeeping_data = (MCC_BOOKEEPING_STRUCT *)mcc_get_bookeeping_data();

I checked the mcc_get_bookeeping_data() function, the following is source code:

MCC_BOOKEEPING_STRUCT *mcc_get_bookeeping_data(void)

{

  bookeeping_data = (MCC_BOOKEEPING_STRUCT *)ioremap_nocache

  (MCC_BASE_ADDRESS, sizeof(struct mcc_bookeeping_struct));

  mcc_shm_offset = (unsigned long)bookeeping_data

  - (unsigned long)MCC_BASE_ADDRESS;

  return bookeeping_data;

}

I found the ioremap_nocache() always fail and return NULL. The MCC_BASE_ADDRESS is defined in mcc_config_linux.h as follows:

/* base address of shared memory */

#define MCC_BASE_ADDRESS               (0xBFF00000)

I don't know the MCC_BASE_ADDRESS is correct or not, who can give me any idea?

Best regrads!

0 Kudos
4 Replies

851 Views
renfeiche
Contributor I

Who has the mcc experience, can give me answeer?

0 Kudos

851 Views
igorpadykov
NXP Employee
NXP Employee

Hi Renfei

MCC_BASE_ADDRESS is defined in ..include/linux/mcc_config_linux.h

also please check Chapter 53 Multi-Core Communication (MCC)

attached Linux Manual.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

851 Views
renfeiche
Contributor I

Hi, igorpadykov

Thank you for your reply. I have studied mcc in Linux Manual, but I can not find the solution. The following is the output when the function mcc_initialize() is called.

------------[ cut here ]------------

WARNING: CPU: 0 PID: 1 at arch/arm/mm/ioremap.c:301 __arm_ioremap_pfn_caller+0x184/0x1a8()

Modules linked in:

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.28-1.0.0_ga+g91cf351 #8

[<800149f8>] (unwind_backtrace) from [<80011714>] (show_stack+0x10/0x14)

[<80011714>] (show_stack) from [<806d6e40>] (dump_stack+0x7c/0xbc)

[<806d6e40>] (dump_stack) from [<8002c9e8>] (warn_slowpath_common+0x70/0x8c)

[<8002c9e8>] (warn_slowpath_common) from [<8002caa0>] (warn_slowpath_null+0x1c/0x24)

[<8002caa0>] (warn_slowpath_null) from [<8001a6c4>] (__arm_ioremap_pfn_caller+0x184/0x1a8)

[<8001a6c4>] (__arm_ioremap_pfn_caller) from [<8001a734>] (__arm_ioremap_caller+0x4c/0x54)

[<8001a734>] (__arm_ioremap_caller) from [<800219ec>] (mcc_get_bookeeping_data+0x18/0x34)

[<800219ec>] (mcc_get_bookeeping_data) from [<80020c38>] (mcc_initialize+0x38/0x23c)

[<80020c38>] (mcc_initialize) from [<80316584>] (imx_mcc_test_probe+0x14/0xd8)

[<80316584>] (imx_mcc_test_probe) from [<80336a44>] (platform_drv_probe+0x44/0xa4)

[<80336a44>] (platform_drv_probe) from [<803352cc>] (driver_probe_device+0x110/0x24c)

[<803352cc>] (driver_probe_device) from [<803354d8>] (__driver_attach+0x8c/0x90)

[<803354d8>] (__driver_attach) from [<80333824>] (bus_for_each_dev+0x6c/0xa0)

[<80333824>] (bus_for_each_dev) from [<80334a84>] (bus_add_driver+0x148/0x1f0)

[<80334a84>] (bus_add_driver) from [<80335ad4>] (driver_register+0x78/0xf8)

[<80335ad4>] (driver_register) from [<80d3fd78>] (imx_mcc_test_init+0x14/0x34)

[<80d3fd78>] (imx_mcc_test_init) from [<8000889c>] (do_one_initcall+0xf8/0x154)

[<8000889c>] (do_one_initcall) from [<80d13c54>] (kernel_init_freeable+0x138/0x1d8)

[<80d13c54>] (kernel_init_freeable) from [<806d34d8>] (kernel_init+0x8/0xe8)

[<806d34d8>] (kernel_init) from [<8000e538>] (ret_from_fork+0x14/0x3c)

---[ end trace 3a8d076a031602f2 ]---

Unable to handle kernel NULL pointer dereference at virtual address 00000000

pgd = 80004000

[00000000] *pgd=00000000

Internal error: Oops: 5 [#1] PREEMPT SMP ARM

Modules linked in:

CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W    3.14.28-1.0.0_ga+g91cf351 #8

task: a8074000 ti: a8072000 task.ti: a8072000

PC is at strcmp+0x0/0x34

LR is at mcc_initialize+0x54/0x23c

pc : [<80292944>]    lr : [<80020c54>]    psr: 60000113

sp : a8073e40  ip : 00000000  fp : 00000000

r10: 80d56fbc  r9 : 0000010a  r8 : 00000000

r7 : fffffdfb  r6 : 00000000  r5 : 80dc9364  r4 : 00000000

r3 : 80316570  r2 : 40100000  r1 : 80c11574  r0 : 00000000

Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel

Control: 10c53c7d  Table: 8000404a  DAC: 00000015

Process swapper/0 (pid: 1, stack limit = 0xa8072238)

Stack: (0xa8073e40 to 0xa8074000)

3e40: 80e1f014 a80f4200 80d8fb40 fffffdfb 00000000 80316584 80e1f014 a80f4210

3e60: 80d8fb40 80e1f014 a80f4210 80336a44 80336a00 80e1f014 a80f4210 00000000

3e80: 80d8fb40 803352cc a80f4210 80d8fb40 a80f4244 80d90490 80dc8ac0 803354d8

3ea0: 00000000 80d8fb40 8033544c 80333824 a804255c a80ea934 80d8fb40 a865a880

3ec0: 00000000 80334a84 80c49b34 80d8fb40 80d3fd64 80d8fb40 80d3fd64 80d56fb8

3ee0: 80dc8ac0 80335ad4 00000000 a8072000 80d3fd64 80d3fd78 a8072000 8000889c

3f00: a800e900 80c171ec a80a2f00 806dfe84 00000000 00000000 00008ac0 80129438

3f20: 00000000 80d788f0 60000113 00000001 00000008 00000000 abfffa34 80045808

3f40: 80c0c4a4 00000007 00000007 abfffa36 80d788e0 80d62cb8 00000007 80d56fb8

3f60: 80dc8ac0 80dc8ac0 0000010a 80d56fbc 00000000 80d13c54 00000007 00000007

3f80: 80d13514 8004e520 00000000 806d34d0 00000000 00000000 00000000 00000000

3fa0: 00000000 806d34d8 00000000 8000e538 00000000 00000000 00000000 00000000

3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 fb339fda ea7dfe51

[<80292944>] (strcmp) from [<80020c54>] (mcc_initialize+0x54/0x23c)

[<80020c54>] (mcc_initialize) from [<80316584>] (imx_mcc_test_probe+0x14/0xd8)

[<80316584>] (imx_mcc_test_probe) from [<80336a44>] (platform_drv_probe+0x44/0xa4)

[<80336a44>] (platform_drv_probe) from [<803352cc>] (driver_probe_device+0x110/0x24c)

[<803352cc>] (driver_probe_device) from [<803354d8>] (__driver_attach+0x8c/0x90)

[<803354d8>] (__driver_attach) from [<80333824>] (bus_for_each_dev+0x6c/0xa0)

[<80333824>] (bus_for_each_dev) from [<80334a84>] (bus_add_driver+0x148/0x1f0)

[<80334a84>] (bus_add_driver) from [<80335ad4>] (driver_register+0x78/0xf8)

[<80335ad4>] (driver_register) from [<80d3fd78>] (imx_mcc_test_init+0x14/0x34)

[<80d3fd78>] (imx_mcc_test_init) from [<8000889c>] (do_one_initcall+0xf8/0x154)

[<8000889c>] (do_one_initcall) from [<80d13c54>] (kernel_init_freeable+0x138/0x1d8)

[<80d13c54>] (kernel_init_freeable) from [<806d34d8>] (kernel_init+0x8/0xe8)

[<806d34d8>] (kernel_init) from [<8000e538>] (ret_from_fork+0x14/0x3c)

Code: e3520000 e5e32001 1afffffb e12fff1e (e4d03001)

---[ end trace 3a8d076a031602f3 ]---

Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

0 Kudos

851 Views
niranjanbc
Contributor IV

i have the same issue, are you able to fix the problem.

0 Kudos