<?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: kernel panic: imx-sdma causes scheduling while atomic in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1988945#M230578</link>
    <description>&lt;P&gt;This is great to hear. As we have a workaround (by disabling PM for imx-sdma) we can manage to wait for the proper solution.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 14:57:33 GMT</pubDate>
    <dc:creator>mikoli</dc:creator>
    <dc:date>2024-11-06T14:57:33Z</dc:date>
    <item>
      <title>kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1950884#M228248</link>
      <description>&lt;P&gt;We have a custom i.MX8M Plus board running NXP Yocto&amp;nbsp;i.MX, Linux, LF5.15.71_2.2.0&lt;BR /&gt;&lt;BR /&gt;We are experiencing intermittent kernel panics that seems to be related to audio playback using ALSA aplay. After studying the call trace it seems that the imx-sdma driver causes scheduling while in atomic context (see below)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;soc_pcm_trigger() is within atomic context and&amp;nbsp;sdma_prep_dma_cyclic() allows the power manager to resume and finally locks a mutex causing a scheduling.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This seems very similar to what is described (and solved) here:&lt;BR /&gt;&lt;A href="https://lists.yoctoproject.org/g/linux-yocto/topic/v6_1_standard_nxp_sdk_6_1_nxp_soc/104235049" target="_blank"&gt;linux-yocto@lists.yoctoproject.org | [v6.1/standard/nxp-sdk-6.1/nxp-soc &amp;amp; v6.1/standard/preempt-rt/nxp-sdk-6.1/nxp-soc][PATCH] dmaengine: imx-sdma: Make runtime PM irq safe&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Its very difficult to reproduce the issue as it only happens twice a week on a live system.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Call&lt;/SPAN&gt;&lt;SPAN&gt; trace:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; dump_backtrace+0x0/0x19c&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; show_stack+0x18/0x70&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; dump_stack_lvl+0x68/0x84&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; dump_stack+0x18/0x34&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __schedule_bug+0x60/0x80&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __schedule+0x658/0x710&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; schedule+0x88/0x100&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; schedule_preempt_disabled+0x24/0x40&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __mutex_lock.constprop.0+0x18c/0x56c&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __mutex_lock_slowpath+0x14/0x20&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; mutex_lock+0x48/0x54&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; clk_prepare_lock+0x44/0xa0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; clk_unprepare+0x24/0x44&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; clk_bulk_unprepare+0x3c/0x60&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; genpd_runtime_resume+0x26c/0x2b0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __rpm_callback+0x48/0x1a0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; rpm_callback+0x6c/0x80&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; rpm_resume+0x378/0x614&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; __pm_runtime_resume+0x3c/0x8c&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; sdma_prep_dma_cyclic+0x58/0x294&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; snd_dmaengine_pcm_trigger+0xec/0x1c0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; dmaengine_pcm_trigger+0x18/0x24&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; snd_soc_pcm_component_trigger+0x164/0x230&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; soc_pcm_trigger+0xbc/0x1c0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Sep 2024 08:46:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1950884#M228248</guid>
      <dc:creator>mikoli</dc:creator>
      <dc:date>2024-09-10T08:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1951169#M228266</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The SDMA firmware is provided by both meta-freescale and meta-imx layers, the latter provides a newer version of it.&lt;BR /&gt;The NXP Yocto user guide&amp;nbsp;&lt;A title="IMX Yocto User Guide" href="https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf" target="_blank" rel="noopener nofollow noreferrer"&gt;IMX Yocto User Guide&lt;/A&gt;, suggests to use the layers referenced in the nxp release manifests&amp;nbsp;&lt;A title="imx-manifests" href="https://github.com/nxp-imx/imx-manifest" target="_blank" rel="noopener nofollow noreferrer"&gt;imx-manifests&lt;/A&gt; which include the meta-imx layer as well.&lt;BR /&gt;The meta-imx is not strictly necessary for machine support since it should only add new patches which should later be merged into the meta-freescale-distro layer. However, also the fsl-image-machine-test image, which is the basic official image with no GUI or multimedia packages provided by the meta-freescale layer, adds the firmwared daemon package to load the firmware from userspace via udev signaling.&lt;/P&gt;
&lt;P&gt;Besides that, I also confirm that after configuring the imx-sdma driver as module , the firmware gets loaded in direct mode immediately after the module gets loaded, in my case it corresponds to about 10 seconds since boot start.&lt;/P&gt;
&lt;PRE&gt;# dmesg | grep sdma&lt;BR /&gt;[ 10.459118] imx-sdma 20ec000.sdma: TEST DEBUG: sdma_probe&lt;BR /&gt;[ 10.541432] imx-sdma 20ec000.sdma: firmware found.&lt;BR /&gt;[ 10.576034] imx-sdma 20ec000.sdma: loaded firmware 3.6&lt;/PRE&gt;
&lt;P&gt;I agree this is a better option, even without the synchronous loading patch, than relying on firmwared daemon because hardly a sdma transfer would take place between the module loading and firmware loading. I am not sure if this applies to all cases, I think it has been opted for a user space loader in the NXP image to support lazy firmware loading for all the possible drivers so that it is not necessary to configure them as module. I hope that usually a safe driver checks whether or not the firmware has been loaded before starting a transfer, or otherwise fails safely without panic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 14:25:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1951169#M228266</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-09-10T14:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1952027#M228312</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34846"&gt;@Bio_TICFSL&lt;/a&gt;&amp;nbsp;I've read your reply multiple times and I do not understand how this is connected to my question? Anyway, in my build firmware-imx-8m v8.18 from meta-imx is used.&lt;BR /&gt;&lt;BR /&gt;My issue seems to be somewhere in the region of how the i.MX ALSA SoC Platform driver uses sDMA while its in atomic context.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Embedded in the log I attached I also see:&lt;BR /&gt;&lt;SPAN&gt;tlv320aic3x&lt;/SPAN&gt; &lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;0018&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;ASoC&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;error&lt;/SPAN&gt; &lt;SPAN&gt;at&lt;/SPAN&gt; &lt;SPAN&gt;snd_soc_component_update_bits&lt;/SPAN&gt; &lt;SPAN&gt;on&lt;/SPAN&gt; &lt;SPAN&gt;tlv320aic3x&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;0018&lt;/SPAN&gt;&lt;SPAN&gt;: -&lt;/SPAN&gt;&lt;SPAN&gt;110&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tlv320aic3x is our ASoC Codec driver, not sure if this is the cause or the symptom&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Sep 2024 11:12:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1952027#M228312</guid>
      <dc:creator>mikoli</dc:creator>
      <dc:date>2024-09-11T11:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1956536#M228566</link>
      <description>&lt;P&gt;We found a workaround by disabling runtime pm for the imx-sdma driver which strengthens our beliefs that this is an issue with the NXP imx-sdma driver.&lt;BR /&gt;This is the workaround:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo on &amp;gt;&amp;nbsp;/sys/devices/platform/soc@0/30c00000.bus/30e10000.dma-controller/power/control&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 10:03:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1956536#M228566</guid>
      <dc:creator>mikoli</dc:creator>
      <dc:date>2024-09-18T10:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1956688#M228584</link>
      <description>&lt;P&gt;Got it! will escalated this issue hope it works now thanks.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 13:52:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1956688#M228584</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-09-18T13:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1974907#M229743</link>
      <description>&lt;P&gt;Any update on this?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 07:16:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1974907#M229743</guid>
      <dc:creator>mikoli</dc:creator>
      <dc:date>2024-10-16T07:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1976084#M229800</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Have you update the kernel to see if this happens? I could not reproduce it with latest BSP. however the case is in hand of the developer if it fixed i will appear fixed until next bsp release.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 12:35:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1976084#M229800</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-10-17T12:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1988931#M230577</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;We already reproduced this issue and this is going to appear public a fixed in next Q1 2025 release.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 14:35:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1988931#M230577</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-11-06T14:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1988945#M230578</link>
      <description>&lt;P&gt;This is great to hear. As we have a workaround (by disabling PM for imx-sdma) we can manage to wait for the proper solution.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 14:57:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/1988945#M230578</guid>
      <dc:creator>mikoli</dc:creator>
      <dc:date>2024-11-06T14:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2119208#M238384</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm encountering the same issue on the iMX8MP running NXP Yocto i.MX, Linux, LF5.10.72_2.2.3 (hardknott).&lt;BR /&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34846"&gt;@Bio_TICFSL&lt;/a&gt;&amp;nbsp;, you mentioned that a fix was planned for Q1 2025—has it already been released? Where has it been applied, and how can I make use of it?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 08:03:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2119208#M238384</guid>
      <dc:creator>ggpr</dc:creator>
      <dc:date>2025-06-19T08:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2119212#M238385</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm encountering the same issue on the iMX8MP running NXP Yocto i.MX, Linux, LF5.10.72_2.2.3 (hardknott).&lt;BR /&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34846"&gt;@Bio_TICFSL&lt;/a&gt;&amp;nbsp;, you mentioned that a fix was planned for Q1 2025—has it already been released? Where has it been applied, and how can I make use of it?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 08:06:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2119212#M238385</guid>
      <dc:creator>ggpr</dc:creator>
      <dc:date>2025-06-19T08:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: kernel panic: imx-sdma causes scheduling while atomic</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2335434#M244553</link>
      <description>&lt;P&gt;I know this thread is old, but has this issue been addressed in a patch? I am seeing the same kernel panic periodically on linux-imx 5.10&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 21:10:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kernel-panic-imx-sdma-causes-scheduling-while-atomic/m-p/2335434#M244553</guid>
      <dc:creator>user123412</dc:creator>
      <dc:date>2026-03-18T21:10:05Z</dc:date>
    </item>
  </channel>
</rss>

