spinlock lockup suspected

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

bseljak
Posts: 28
Joined: Thu Apr 03, 2014 1:28 am

spinlock lockup suspected

Thu Oct 26, 2017 10:00 am

Hi!
I compile Kernel 4.1.0-linux4sam_5.1 with:
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
CONFIG_DEBUG_PREEMPT=y
CONFIG_DEBUG_SPINLOCK=y

I configure USART with atmel,use-dma-tx and atmel,use-dma-rx (SAMA5D36). When I use serial port, kernel reports this message:

Code: Select all

BUG: spinlock lockup suspected on CPU#0, kworker/0:1/261
 lock: 0xcf5badc4, .magic: dead4ead, .owner: kworker/0:1/261, .owner_cpu: 0
CPU: 0 PID: 261 Comm: kworker/0:1 Not tainted 4.1.0-linux4sam_5.1
Hardware name: Atmel SAMA5
[<c0014150>] (unwind_backtrace) from [<c00122a0>] (show_stack+0x10/0x14)
[<c00122a0>] (show_stack) from [<c003ea88>] (do_raw_spin_lock+0x144/0x150)
[<c003ea88>] (do_raw_spin_lock) from [<c04bd5d4>] (_raw_spin_lock_irqsave+0x20/0x28)
[<c04bd5d4>] (_raw_spin_lock_irqsave) from [<c0229758>] (atc_terminate_all+0x2c/0x140)
[<c0229758>] (atc_terminate_all) from [<c02528a8>] (atmel_complete_tx_dma+0x38/0x12c)
[<c02528a8>] (atmel_complete_tx_dma) from [<c0229700>] (atc_chain_complete+0xdc/0x108)
[<c0229700>] (atc_chain_complete) from [<c022a2f0>] (atc_advance_work+0x100/0x14c)
[<c022a2f0>] (atc_advance_work) from [<c022a3f4>] (atc_tasklet+0x7c/0x1b8)
[<c022a3f4>] (atc_tasklet) from [<c001e814>] (tasklet_action+0x8c/0xf8)
[<c001e814>] (tasklet_action) from [<c001eb0c>] (__do_softirq+0x104/0x224)
[<c001eb0c>] (__do_softirq) from [<c001ee8c>] (irq_exit+0x80/0xb4)
[<c001ee8c>] (irq_exit) from [<c004308c>] (__handle_domain_irq+0x74/0xdc)
[<c004308c>] (__handle_domain_irq) from [<c0012d00>] (__irq_svc+0x40/0x74)
[<c0012d00>] (__irq_svc) from [<c04bd6a4>] (_raw_spin_unlock_irq+0xc/0x40)
[<c04bd6a4>] (_raw_spin_unlock_irq) from [<c003612c>] (finish_task_switch+0x40/0xd4)
[<c003612c>] (finish_task_switch) from [<c04ba8a8>] (__schedule+0x198/0x404)
[<c04ba8a8>] (__schedule) from [<c04bab54>] (schedule+0x40/0x98)
[<c04bab54>] (schedule) from [<c002e4e0>] (worker_thread+0xb8/0x488)
[<c002e4e0>] (worker_thread) from [<c003294c>] (kthread+0xd4/0xec)
[<c003294c>] (kthread) from [<c000f548>] (ret_from_fork+0x14/0x2c)
Should I worried about this?

Regards
Borut
blue_z
Location: USA
Posts: 1703
Joined: Thu Apr 19, 2007 10:15 pm

Re: spinlock lockup suspected

Mon Oct 30, 2017 1:36 am

For the same kernel version and configuration on a SAMAD36-EK, I can replicate the bug dump like you have shown. However on a SAMA5D4-XULT with the same kernel image there seems to be no issues using DMA with a USART.
Unless you're having hangs or any other issues, the message would seem to be benign.

Regards
nferre
Site Admin
Posts: 176
Joined: Wed Feb 14, 2007 11:17 am

Re: spinlock lockup suspected

Mon Oct 30, 2017 5:36 pm

Hi,

Actually sama5d3 and sama5d4 don't share the same DMA controller: one is hdmac and the newer one is xdmac. We built two different drivers for them. This is why blue_z doesn't experience the same issue on his sama5d4 xplained board.
So, what you are experiencing is a weakness of the older hdmac driver (drivers/dma/at_hdmac.c). It is known but not so easy to fix and be sure that we don't introduce regressions (letting the lock go while calling the handler was somehow forbidden when the driver was written). I would advice to not give it too much importance as we managed to live with it for quite some time but I do agree that it's somehow disturbing.
Removing CONFIG_DEBUG_SPINLOCK=y or concentrating on the "other" spinlock issue that you are trying to fix seem the way to go until we find a way to fix this reliably.

Best regards
emmastones
Posts: 1
Joined: Thu Nov 23, 2017 11:08 am

Re: spinlock lockup suspected

Thu Nov 23, 2017 11:15 am

This is the reason blue_z doesn't encounter a similar issue on his sama5d4 xplained board. In this way, what you are encountering is a shortcoming of the more seasoned hdmac driver. It is known yet not all that simple to settle and make certain that we don't present relapses. However on a SAMA5D4-XULT with a similar bit picture there is by all accounts no issues utilizing DMA with a USART. Unless you're having hangs or some other issues, the message would appear to be favorable.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 3 guests