Thinking About "Unable to handle kernel paging request at virtual address ffc05000"

How to think about issue like this? Maybe come back to original code modifiations, and try to refine code just input. Unfortunately, it can't track the base reason why this error occur, which could just enumerate possible answers and try to get the proper correct one. I think the right way facing this issue is "tracing back".

 

 

1. Definate what address it is?

DMA mapping address? vmalloc/ioremap space? or user space? In my case, it's DMA mapping area.

 

2. Use debugger to clarify what you think about.

Connect ICE to board, and display virtual address 0xffc05000, that is unavailable, which make kernel report this error.

 

3. Be sure which module this address belong to?

printk dma allocated address of some modules which use dma to transfer data. uart 0xffc00000 or 0xffc01000, usp 0xffc02000, 0xffc03000, 0xffc04000. Though 1kB size when alloc, but 4KB address aligned by kernel. No 0xffc05000, why?

 

4. Go into the function tty_insert_flip_string(), in which memcpy cause the error (read from oops by kernel). Only way I can do is clarify parameters I pass to memcpy. In tty function, dma address is increased by 0x700 to oxffc05000, which is original 0xffc00000. why 0x700, not 0x200 we expected?

 

5. TTY_BUFFER_PAGE equal to 0x700, goal=min(size-copied, TTY_BUFFER_PAGE), size maybe the wrong value. So next print out varialbe size. Oh, no 0xf8740000, negtive value. Search rx_dma_len in serial driver, only here modified this variable 

rx_dma_len = RX_DMA_BUF_SIZE - get_dma_residue(rx_dma_chan). 

 

6. Conclude: problem caused by get_dma_residue.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值