imx-sdma: All bds consumed,restart now.

  • Hi,


    I noticed that with the latest release from F+S (2024.01) the imx tty handling changed. I now get a (maybe) kernel message very often when I run a special UART communication (9 Bit (Mark/Space Parity)) (see also [0]:


    All bds consumed,restart now.


    In my case the UART communication is fine and I can send and receive data. But the kernel log is flooded with the message (see [1]).

    I already found a post about the issue under [3]. I then checked the F+S Kernel sources and noticed that the changes from [3] are already applied to the kernel of F+S (5.15).


    But because [3] advise changes for kernel version "6.1" I compiled and run the upstream linux kernel 6.11 and where able to run the uart example program without any kernel message (see [2]).



    Is this a serious issue or is it easy to fix?



    Best regards.

    Maik


    [0]:

    # ./serial_gateway

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    ADR: 0x02

    LEN: 0x1C

    DATA: 0x02 0x1C 0x00 0x01 0x0A 0x04 0x04 0x00 0xB7 0x6A 0x61 0x6E 0x2E 0x20 0x32 0x33 0x20 0x32 0x30 0x32 0x30 0x31 0x33 0x3A 0x30 0x35 0x3A 0x35 0x35 0x5D



    [1]:

    # uname -r

    5.15.131-F+S


    # dmesg | grep -i sdma

    imx-sdma 20ec000.sdma: alloc bd from iram.

    imx-sdma 20ec000.sdma: firmware found.

    imx-sdma 20ec000.sdma: loaded firmware 3.6

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    imx-sdma 20ec000.sdma: All bds consumed,restart now.



    [2]:

    # uname -r

    6.11.0-rc4-F+S+


    # dmesg | grep -i sdma

    imx-sdma 20ec000.sdma: alloc bd from iram.

    imx-sdma 20ec000.sdma: loaded firmware 3.6



    [3]:

    https://community.nxp.com/t5/i…T-lost-bytes/td-p/1696008

  • Hello,


    the reason, why this message is not displayed with mainline kernel 6.11 should be, that the warning does not exist in the imx-sdma driver code there:


    linux mainline 6.11-rc4:

    https://github.com/torvalds/li…ivers/dma/imx-sdma.c#L873


    linux-imx 5.15.y

    https://github.com/nxp-imx/lin…ivers/dma/imx-sdma.c#L988


    It was introduced in kernel 5.10, however, it also disappeared in newer imx-kernel versions:


    linux-imx 6.1.y

    https://github.com/nxp-imx/lin…vers/dma/imx-sdma.c#L1024


    I cannot find any commit, that removed this warning so it seems that it just was not merged into the newer kernel versions.

    This is the commit, which introduced the warning:

    [1] https://github.com/nxp-imx/lin…ce86c47c8cb10c3567a37bad0


    We did not see these kind of messages yet, however we did not do any intense sdma testing so far of the imx6sx.

    The commit message indicates, that is has something to do with high CPU loads. As the imx6sx is a Solo CPU, this might in fact be a problem.

    The fact, that the warnings where added in kernel 5.10 explain, why you did not see them so far.


    Is your CPU load very high, when these warnings occur?


    Could you try to apply the changes from [1] to the mainline kernel and see if they still not occur?


    Your F&S Support Team

  • Hi. I checked the CPU load, but as you can see in [1]: There is no average increase. Maybe its just a momentary high load, while running the example.


    But thanks for the commit research. I will check the kernel code and tell the results.



    [1]:

    # uptime

    01:55:12 up 1:55, load average: 0.06, 0.04, 0.00

    # ./serial_gateway

    imx-sdma 20ec000.sdma: All bds consumed,restart now.

    ADR: 0x02; LEN: 0x1C; DATA: 0x02 0x1C 0x00 0x01 0x0A 0x04 0x04 0x00 0xB7 0x6A 0x61 0x6E 0x2E 0x20 0x32 0x33 0x20 0x32 0x30 0x32 0x30 0x31 0x33 0x3A 0x30 0x35 0x3A 0x35 0x35 0x5D

    # uptime

    01:55:16 up 1:55, load average: 0.05, 0.04, 0.00