DMA conflict in Linux and MQX in SPI0

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

DMA conflict in Linux and MQX in SPI0

Jump to solution
6,006 Views
carlovalgocela
Contributor III

I encountered an issue with DMA running in SPI0.
Currently in  MQX, I'm running an application that gathers data via SPI0 DMA.

Data gathering should not be interrupted. Its function is gather data all the time.

During the data gathering i got an error see below:


IO_IOCTL_SPI_READ_WRITE ... drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (49)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (48)
drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (48)

I already disabled the DMA for SPI0 in Linux  by disabling CONFIG_SPI_MVF_DSPI_EDMA.

Still the issue occurred.

I added some code to display the address, irq,dev_id and intr when the issue occurs.

Here is the result:

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

drivers/dma/mvf_edma.c:mcf_

drivers/dma/mvf_edma.c:mcf_edma_isr: Invalid channel 49. addr=0xf20b8000, irq=42, dev_id=8a000000, intr=0x00020000

drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)

drivers/dma/mvf_edma.c:mcf_edma_isr: Invalid channel 31. addr=0xf20b8000, irq=42, dev_id=8a000000, intr=0x00000000

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

also i tried to display the interrupts trying to get who are using the irq 42

cat /proc/interrupts

           CPU0

36:          0       GIC  mvf_sema4_handler

40:          0       GIC  mcf_edma

41:          0       GIC  mcf_edma

42:          0       GIC  mcf_edma

43:          0       GIC  mcf_edma

Labels (2)
Tags (4)
1 Solution
5,046 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

View solution in original post

0 Kudos
Reply
31 Replies
5,047 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!
0 Kudos
Reply
4,752 Views
carlovalgocela
Contributor III

Hello rendy and karinavalencia

any updates?

For now we edited the sample SPI MQX code and added some code to have an infinite loop. See attached file.

rw.BUFFER_LENGTH = 10;

    rw.WRITE_BUFFER = (char *)send_buffer;

    rw.READ_BUFFER = (char *)recv_buffer;

    printf ("IO_IOCTL_SPI_READ_WRITE ... ");

    while(1)

{

if (SPI_OK == ioctl (spifd, IO_IOCTL_SPI_READ_WRITE, &rw))

{

printf ("OK\n");

}

else

{

printf ("ERROR\n");

}

  }



When running the MQX file the error occured.

drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)

drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (49)

drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (48)

Any idea what might cause the issue?



0 Kudos
Reply
4,752 Views
carlovalgocela
Contributor III

Today we tried a test where only MQX is running by loading via DS5.

In the 2 hours testing the issue didn't occur.

timesyssupport​ and rendy​ any idea ??

0 Kudos
Reply
4,752 Views
alejandrolozan1
NXP Employee
NXP Employee

timesyssupport​, rendy​,

Have you had a chance to take a look at this problem. Any ideas are welcome.

Best Regards,

Alejandro

0 Kudos
Reply
4,752 Views
carlovalgocela
Contributor III

Hello All,

I tried to check if the issue will still occur on the latest kernel 3.13

And the issue occurred immediately with a Kernel Panic see attached picture.

DMA Error.png

# cat /proc/interrupts

            CPU0

  27:       1810       GIC  27  gt

  36:          0       GIC  36  mvf_sema4_handler

  40:          0       GIC  40  eDMA tx

  41:          0       GIC  41  eDMA err

  42:          0       GIC  42  eDMA tx

  43:          0       GIC  43  eDMA err

0 Kudos
Reply
4,752 Views
alejandrolozan1
NXP Employee
NXP Employee

timesyssupport​,

I have reproduced the error. It has been difficult to debug the problem because of Linux. I wonder if you have seen this before.

/Alejandro

0 Kudos
Reply
4,752 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ can you comment please?

0 Kudos
Reply
4,752 Views
timesyssupport
Senior Contributor II

Hello Karina,

I have asked our Vybrid maintainer to review, and follow up. He is currently working through 3.13 kernel porting, as well as DMA and MQX issues. Unfortunately I am not able to immediately provide support. Thanks for your patience.

Timesys Support

4,752 Views
carlovalgocela
Contributor III

Hello timesyssupportkarinavalenciaalejandrolozano

I edited the mvf_edma.c in Linux to reroute the DMA1 to DMA0 and observed the following:

  1.  The data gathering via DMA works fine but the error prompt still occurs.

         drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (31)

         drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (49)

         drivers/dma/mvf_edma.c:mcf_edma_isr:  No handler for DMA channel (48)

2. I then tried to remove the error message either of the following:

      - filter DMA channel 31, 49 and 48 or

      - commenting out ERR(" No handler for DMA channel (%d)\n", channel); in the mcf_edma_isr()

    Result: the data gathering failed or stop gathering

What i think is when the printing the error message, the error in the isr was not being catered or ignored.

And when the Linux is running fast by removing the print out it is being processed. There might be an issue in processing

the ISR.

0 Kudos
Reply
4,752 Views
timesyssupport
Senior Contributor II

Hello carlovalgocela​ and karinavalencia​,

I believe we have determined in the same ticket in the Timesys queue, this is using MQX 4.1.1 which is not currently compatible with either Linux 3.0.15, or 3.13 and associated MCC for Vybrid. If this is reproduce-able using MQX 4.0.2, we can investigate.

Thank you,

Timesys Support

0 Kudos
Reply
4,752 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi timesyssupport​,

Does that mean that only MQX 4.0.2 is compatible with Linux?

carlovalgocela​, which MQX version are you using?

Best Regards,

Alejandro

0 Kudos
Reply
4,752 Views
carlovalgocela
Contributor III

Hello alejandrolozano

I'm using MQX 4.1.1 as DMA is supported in DSPI0.

MCC is working fine with Linux version 3.0.15-ts-armv7l  and the MQX 4.1.1

0 Kudos
Reply
4,752 Views
timesyssupport
Senior Contributor II

As we've previously noted, MQX 4.1.1 is not supported against the 3.0.15 kernel; while it can be made to work, it's not recommended.

We are only able to support issues with MQX 4.0.2 at this time, as we are concentrating efforts on the 3.13 kernel, and corresponding MQX/MCC support.

Thank you,

Timesys Support

4,752 Views
carlovalgocela
Contributor III

timesyssupport​ do you have specific timeline when the newer MQX will be supported?

Based on my test, i found out when the function mcf_edma_isr() doesn't respond a valid result (IRQ_HANDLED)

It will stop the data gathering and make the Linux wait for a valid handler for ISR.

For now, the temporary solution i used to make it work is filter out when DMA Channel = 31, 48 and 49 and return IRQ_HANDLED.

This is not a good and clean solution.

timesyssupport​ - CAn you guide me what the DMA channel 31,48,49 corresponds to what devices?

Thanks

0 Kudos
Reply
4,752 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ do you have an update?

0 Kudos
Reply
4,752 Views
timesyssupport
Senior Contributor II

Hello Karina,

We have been working with Carlo via our internal support. We will keep the community updated on the progress on this issue. We currently have Carlo's MQX binary, but are unable to reproduce the issue.

Thanks,

Timesys Support

4,752 Views
karina_valencia
NXP Apps Support
NXP Apps Support

Thanks for  sharing the progress.

0 Kudos
Reply
4,752 Views
karina_valencia
NXP Apps Support
NXP Apps Support

Timesys Support can you share the status?

0 Kudos
Reply
4,752 Views
timesyssupport
Senior Contributor II

Hello Karina,

We are still working to reproduce this issue on our end. If we are able to identify the issue and resolve it, we will follow up.

Regards,

Timesys Support

4,752 Views
karina_valencia
NXP Apps Support
NXP Apps Support

Timesys Support can you share the status?

0 Kudos
Reply