Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: panic writing sdmmc on BeagleBoneGreen



jdbaker%mylinuxisp.com@localhost ("John D. Baker") writes:

>panic: lock error: Mutex: mutex_vector_enter: locking against myself: lock 0x9ffd5d88 cpu 0 lwp 0x9fdf50c0
>cpu0: Begin traceback...
>0x9fdedba4: netbsd:db_panic+0xc
>0x9fdedbd4: netbsd:vpanic+0x174
>0x9fdedbec: netbsd:snprintf
>0x9fdedc2c: netbsd:lockdebug_abort+0x68
>0x9fdedc4c: netbsd:obiosdhc_edma_done+0x24
>0x9fdedca4: netbsd:edma_intr+0x27c
>0x9fdedcc4: netbsd:pic_dispatch+0x28
>0x9fdedd4c: netbsd:pic_do_pending_ints+0x3a0
>0x9fdede1c: netbsd:irq_entry+0x68
>0x9fdede6c: netbsd:sdhc_exec_command+0x238
>0x9fdede8c: netbsd:sdmmc_mmc_command+0x40
>0x9fdedf14: netbsd:sdmmc_mem_write_block_subr+0xbc
>0x9fdedf5c: netbsd:sdmmc_mem_write_block+0xf4
>0x9fdedf84: netbsd:ld_sdmmc_dobio+0x54
>0x9fdedfac: netbsd:sdmmc_task_thread+0x74

That's a bug. The sdmmc driver uses a mutex at IPL_SDMMC (== IPL_BIO == IPL_VM)
while the edma interrupt occurs at IPL_SCHED which is higher and breaks
the mutex. The interrupt handler then tries to acquire the mutex itself
which leads to the panic.

Ideally IPL_BIO is the right level to handle such interrupts, but since
the DMA channels might be used for other things, it's not clear to me yet
if or how to lower the level without side effects.

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index