<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BUG of IPCF access NULL pointer in S32G</title>
    <link>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1901510#M7579</link>
    <description>&lt;P&gt;Configure ipcf to have two instances, and any one or more channels in the two instances.&lt;BR /&gt;1. First initialize the entire IPCF SRAM area and set it to all 0s.&lt;BR /&gt;2. Core A and core M call ipc_shm_init to initialize at the same time.&lt;BR /&gt;3. The M core may be initialized first, and then during the initialization process of the A core, the M core&lt;BR /&gt;A channel in instance0 continuously sends data.&lt;BR /&gt;In addition, we suspect that there is also a problem with the M core.&lt;BR /&gt;In the third step, the A core is initialized first, and then during the M core initialization process, the A core goes to&lt;BR /&gt;A channel in instance0 continuously sends data.&lt;/P&gt;&lt;P&gt;The above steps can reproduce the problem.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 01:20:11 GMT</pubDate>
    <dc:creator>jun13_chen</dc:creator>
    <dc:date>2024-07-08T01:20:11Z</dc:date>
    <item>
      <title>BUG of IPCF access NULL pointer</title>
      <link>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1899938#M7456</link>
      <description>&lt;P&gt;We found that the IPCF of core A has a bug in the multi-instance scenario. The latest IPCF version you released also has this bug.&lt;BR /&gt;Please see following log：&lt;/P&gt;&lt;P&gt;Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;Mem abort info:&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;ESR = 0x0000000096000005&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;EC = 0x25: DABT (current EL), IL = 32 bits&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;SET = 0, FnV = 0&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;EA = 0, S1PTW = 0&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;FSC = 0x05: level 1 translation fault&lt;BR /&gt;ipc-shm-sample: IPCF_Driver_Version:v6.5&lt;BR /&gt;Data abort info:&lt;BR /&gt;ISV = 0, ISS = 0x00000005&lt;BR /&gt;CM = 0, WnR = 0&lt;BR /&gt;user pgtable: 4k pages, 39-bit VAs, pgdp=0000000081c7a000&lt;BR /&gt;[0000000000000000] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000&lt;BR /&gt;Internal error: Oops: 96000005 [#1] PREEMPT SMP&lt;BR /&gt;printk: console [ttyLF0]: printing thread stopped&lt;BR /&gt;Modules linked in: ipc_shm_sample(O) ipc_shm_dev(O) pfeng_slave(O)&lt;BR /&gt;CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 5.15.119 #69&lt;BR /&gt;Hardware name: NXP S32G3XXX-EVB3 (DT)&lt;BR /&gt;pstate: a0000005 (NzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)&lt;BR /&gt;pc : ipc_queue_pop+0x24/0x84 [ipc_shm_dev]&lt;BR /&gt;lr : 0xffffffe00291a108&lt;BR /&gt;sp : ffffffc008003db0&lt;BR /&gt;x29: ffffffc008003db0 x28: ffffffe00291fd28 x27: 00000000ffffff97&lt;BR /&gt;x26: 0000000000000000 x25: 0000000000000001 x24: 00000000000008d0&lt;BR /&gt;x23: ffffffe00291f340 x22: 0000000000000001 x21: ffffffe00291fd38&lt;BR /&gt;x20: 0000000000000040 x19: ffffffe00291fd38 x18: fffffffe007ef540&lt;BR /&gt;x17: ffffffa0783f8000 x16: ffffffc008000000 x15: 0000000000000000&lt;BR /&gt;x14: 0000000000000000 x13: 000000000000013e x12: 0000000000000001&lt;BR /&gt;x11: 0000000000000040 x10: ffffffa0783f8000 x9 : 0000000000000000&lt;BR /&gt;x8 : ffffffc008980038 x7 : 0000000000000000 x6 : 0000000000000000&lt;BR /&gt;x5 : ffffffc008900038 x4 : 0000000000000080 x3 : 0000000000000000&lt;BR /&gt;x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffffc008003e50&lt;BR /&gt;Call trace:&lt;BR /&gt;ipc_queue_pop+0x24/0x84 [ipc_shm_dev]&lt;BR /&gt;ipc_queue_init+0xb8/0x200 [ipc_shm_dev]&lt;BR /&gt;tasklet_action_common.constprop.0+0x13c/0x14c&lt;BR /&gt;tasklet_action+0x24/0x30&lt;BR /&gt;_stext+0x11c/0x288&lt;BR /&gt;__irq_exit_rcu+0xa4/0xdc&lt;BR /&gt;irq_exit+0xc/0x1c&lt;BR /&gt;handle_domain_irq+0x60/0x90&lt;BR /&gt;gic_handle_irq+0x50/0x120&lt;BR /&gt;call_on_irq_stack+0x20/0x3c&lt;BR /&gt;do_interrupt_handler+0x4c/0x54&lt;BR /&gt;el1_interrupt+0x2c/0x70&lt;BR /&gt;el1h_64_irq_handler+0x14/0x20&lt;BR /&gt;el1h_64_irq+0x74/0x78&lt;BR /&gt;arch_cpu_idle+0x14/0x20&lt;BR /&gt;do_idle+0xc0/0x144&lt;BR /&gt;cpu_startup_entry+0x24/0x50&lt;BR /&gt;rest_init+0xdc/0xf0&lt;BR /&gt;arch_call_rest_init+0xc/0x14&lt;BR /&gt;start_kernel+0x500/0x53c&lt;BR /&gt;__primary_switched+0xbc/0xc4&lt;BR /&gt;Code: aa0003f3 540002e0 aa0103e0 a9408663 (b9400022)&lt;BR /&gt;---[ end trace 31e2f3acfa5788b1 ]---&lt;BR /&gt;Kernel panic - not syncing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help us check and verify whether it is true, and whether the modified plan is reasonable or there is a better way.&lt;BR /&gt;Also evaluate whether the M-core IPCF has the same problem, and what are the modification plans?&lt;/P&gt;&lt;P&gt;The IPCF version we use is SW32G_IPCF_4.8.0_D2212, and the M core is also&lt;BR /&gt;According to the call stack and registers, the analysis is that queue-&amp;gt;pop_ring in ipc_queue_pop is a null pointer, that is, mchan-&amp;gt;bd_queue&lt;BR /&gt;&lt;BR /&gt;Looking at the code combined with the phenomenon analysis, the root cause is:&lt;BR /&gt;1. In the function ipc_shm_init_instance. Instance 0 will turn on the interrupt of instance 0 at the end of the function&lt;BR /&gt;2. Then instance 1 will set the IPC_SHM_INSTANCE_ENABLED flag in ipc_os_init&lt;BR /&gt;3. ipc_shm_channel_init will initialize mchan-&amp;gt;bd_queue of instance 1&lt;BR /&gt;4. If there is an interrupt of instance 0 between step 2 and step 3&lt;BR /&gt;5. In the interrupt processing function, because the mark of instance 1 has been set, it will traverse to mchan-&amp;gt;bd_queue of instance 1&lt;BR /&gt;Because this data structure is not initialized, a null pointer is accessed.&lt;/P&gt;&lt;P&gt;We have changed a plan here, and it has been verified that it is effective,&lt;BR /&gt;which is to move the interrupt enable step in step 1 to after the initialization of all instances is completed.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;diff --git a/ipc-shm110460k/ipc-shm.c b/ipc-shm110460k/ipc-shm.c&lt;/P&gt;&lt;P&gt;index 7716f16..3e4fc0f 100644&lt;/P&gt;&lt;P&gt;--- a/ipc-shm110460k/ipc-shm.c&lt;/P&gt;&lt;P&gt;+++ b/ipc-shm110460k/ipc-shm.c&lt;/P&gt;&lt;P&gt;@@ -669,9 +669,6 @@ static int ipc_shm_init_instance(uint8_t instance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remote_chan_shm += chan_size;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable interrupt notifications */&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ipc_hw_irq_enable(instance);&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ipc_shm_priv_data[instance].global-&amp;gt;state = IPC_SHM_STATE_READY;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shm_dbg("ipc shm initialized\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@@ -771,6 +768,14 @@ int ipc_shm_init(const struct ipc_shm_instances_cfg *cfg)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (err != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return err;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; cfg-&amp;gt;num_instances; i++) {&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * enable irq only after all instances are initialized&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ipc_hw_irq_enable(i);&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Fri, 05 Jul 2024 05:25:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1899938#M7456</guid>
      <dc:creator>jun13_chen</dc:creator>
      <dc:date>2024-07-05T05:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: BUG of IPCF access NULL pointer</title>
      <link>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1900125#M7462</link>
      <description>&lt;P&gt;Hello, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220717"&gt;@jun13_chen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the post and sorry for the issues.&lt;/P&gt;
&lt;P&gt;Would you mind introducing us the brief test method that would help to reproduce the issue? I will test it on local board and discuss with internal experts for it if reproduced.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Chenyin&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 09:49:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1900125#M7462</guid>
      <dc:creator>chenyin_h</dc:creator>
      <dc:date>2024-07-05T09:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: BUG of IPCF access NULL pointer</title>
      <link>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1901510#M7579</link>
      <description>&lt;P&gt;Configure ipcf to have two instances, and any one or more channels in the two instances.&lt;BR /&gt;1. First initialize the entire IPCF SRAM area and set it to all 0s.&lt;BR /&gt;2. Core A and core M call ipc_shm_init to initialize at the same time.&lt;BR /&gt;3. The M core may be initialized first, and then during the initialization process of the A core, the M core&lt;BR /&gt;A channel in instance0 continuously sends data.&lt;BR /&gt;In addition, we suspect that there is also a problem with the M core.&lt;BR /&gt;In the third step, the A core is initialized first, and then during the M core initialization process, the A core goes to&lt;BR /&gt;A channel in instance0 continuously sends data.&lt;/P&gt;&lt;P&gt;The above steps can reproduce the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 01:20:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/BUG-of-IPCF-access-NULL-pointer/m-p/1901510#M7579</guid>
      <dc:creator>jun13_chen</dc:creator>
      <dc:date>2024-07-08T01:20:11Z</dc:date>
    </item>
  </channel>
</rss>

