This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: The kernel thread [spi1] state is D and cannot be restored

Part Number: PROCESSOR-SDK-AM437X

SDK:ti-processor-sdk-linux-am437x-evm-07.03.00.005

Kernel:5.4.106

I use the SPI bus to connect to other devices, SPI for host mode,Tx and Rx both Use DMA mode.

I find that the SPI thread state becomes D when running for some time.

the SPI thread PID is 47

cat /proc/47/wchan  ,return  show :omap2_mcspi_tranfer_one

then i find omap2_mcspi_txrx_dma() use completion,and set it to TASK_UNINTERRUPTIBLE,

when i use kernel 4.19.94(last SDK),Without this issue.

  • Hello,

    Please post your device tree SPI settings. Please also share any terminal output that could be helpful.

    I am having some trouble understanding "then i find omap2_mcspi_txrx_dma() use completion,and set it to TASK_UNINTERRUPTIBLE,". Could you reword that for me?

    Regards,

    Nick

  • device tree :


    &spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins_default>;
    ti,spi-num-cs = <1>;
    ti,pindir-d0-out-d1-in = <1>;
    dmas = <&edma_xbar 16 0 16>,
    <&edma_xbar 17 0 17>;
    dma-names = "tx0", "rx0";


       spidev:mainboard@0 {
       #address-cells = <1>;
       #size-cells = <0>;
       compatible = "spi,spi_mainboard";
       spi-max-frequency = <2000000>;
       reg = <0>;

       pinctrl-names = "default";
       pinctrl-0 = <&hw_version_pins>;

       hwver0-gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
       hwver1-gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>;
       hwver2-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;

      };
    };

    terminal output:

    Call relationship:omap2_mcspi_transfer_one()->omap2_mcspi_txrx_dma()->mcspi_wait_for_completion(),Maybe there's something wrong with this place,It can make the thread TASK_UNINTERRUPTIBLE.I guess.

    The problem is contingency,Sometimes it comes quickly, sometimes it takes a long time.But the probability of occurrence is quite high.

  • Hello,

    Apologies for the delayed response. Are you seeing something similar to this thread here? Are you able to get the problem to go away by making similar driver modifications?

    (+) Linux/AM3358: SPI DMA issue - Processors forum - Processors - TI E2E support forums

    There were changes made to the spi-omap2-mcspi driver between Linux 4.19 and Linux 5.4, I have not had time to try to look deeply through what has changed. Going to talk with the development team and get back to you.

    Regards,

    Nick

  • Hello,

    Were you able to resolve the problem based on the discussion in the linked post?

    I have not heard back from the dev team. I am pinging them again. I'll be on vacation the next couple of days, but I will return midway through next week.

    Regards,

    Nick